Reinstalling Android After Installing Ubuntu Touch

Hello,

I have installed Ubuntu Touch (maintained by Ubports) and I wish to go back to FPOS and relock the bootloader. I am unsure how to proceed with this because I am aware of risks with locking the bootloader after flashing different OSs. How would I proceed with this? I received my FP4 with the Android 11 version of FPOS, but I am wondering if there is a flashboot command that can confirm this.

1 Like

An alternative option could also be to let Fairphone do it for you ‘for a small fee’ (whatever that means), if you want to avoid any risk.

" -IMPORTANT-
Our warranty does not cover problems that occur during the installation of an alternative OS. If something goes wrong (e.g. device no longer starts), we can fix your Fairphone at our repair center for a small fee. We restore the original software that came out of the box. In other words, if you bought a Fairphone with preinstalled /e/OS, it will come back from the repair with /e/OS.
After that, the warranty continues as usual."

Reading between the lines:

They do seem to have a way to find out which version it came with. Maybe they share this information with you… for free.

I did not obtain my FP4 from Fairphone. I obtained it from Ebay, sealed and brand new (as they claimed. It did appear to be sealed and brand new because it was in the seals and looked to have original packaging.). I wish to restore to the Android 11 stock FPOS image and then return it. So, how would I restore while being able to relock the bootloader safely?

@thedeafenguy
Presumably you have come across this Fairphone resource, although I haven’t read through it fully?
https://support.fairphone.com/hc/en-us/articles/18896094650513-Install-Fairphone-OS-manually

Yes, I have. It does not say how to relock the bootloader safely.

Search here for get_unlock_ability and do some reading. Your case is a bit special as you want to install an old outdated system version.

I already have some understanding about this. Just to confirm:

  • The version of FPOS that was installed on my FP4 from factory is indexed in rollback protection (in my case, it would be the Android 11 version of FPOS)?
  • Installing a version of FPOS that is older than the one in the rollback protection index, and then locking the bootloader will brick the phone?
  • Installing a version of FPOS that is newer than the one in the rollback protection index, and then locking the bootloader would not brick my phone?

When I insatlled UT, I unlocked the bootloader and flashed the UT image with the FPOS Android 11 already on my device.

From the searching around on this forum, I would like to confirm:

  • After flashing FPOS, and not booting, if I see that get_unlock_ability is 1, then it is safe to lock the bootloader at this point and undo the other changes I had to do to unlock the bootloader (also, how would the developer settings be affected by this?)?
  • If I see that before booting FPOS, I have get_unlock_ability 0, then I should not lock the bootloader and proceed to undo changes ?

So, if I were to flash the Android 11 version of FPOS, see that get_unlock_ability is 1 before booting into FPOS, then undo my changes I initially made to unlock the bootloader (the ones detailed in the Fairphone guide to unlock the bootloader), I would be able to unlock the bootloader again in the same process detailed in the Fairphone guide to unlock the bootloader? Would I even be able to flash the Android 11 version of FPOS and then lock the bootloader (Considering that version is indexed in rollback protection. I would be fine with a newer version of FPOS, as long as I can still go back and unlock the bootloader again if I need to and from there, if I need to, go back to FPOS and relock the bootloader. )?

Yes

There’s nothing really to undo, all you need to do is lock the bootloader (and optionally lock the critical partitions before that if you want to go completely stock.
Developer options etc. will all be reset since you are flashing a new system.

If you decide to lock critical beware that that comes with a reboot iirc. Make sure you catch that before it boots into Android so you don’t loose get_unlock_ability.

If you manage to get the same version or newer, yes. If you don’t have a specific reason to go that route I wouldn’t bother though.
Just use the latest factory images, you’ll still be able to unlock the bootloader in the future (unless you don’t check get_unlock_ability and brick it of course).

3 Likes

I haven’t used the script to flash the FPOS image yet, but how would I prevent the phone from booting into FPOS after flashing? Also, what order do I need to run the lock commands, and what is an iirc?

EDIT: I tried this myself. I flashed the latest FPOS 13 image, and saw I had get_unlock_ability 1. I proceeded to lock critical, and then lock the bootloader. After both of these, I saw that I still had get_unlock_ability 1. I booted into FPOS and after, I saw it reset back to 0. This is the way it is supposed to be, and I have not bricked my phone?

Yes, that’s expected behaviour. The first boot into Android userland will reset get_unlock_ability because that’s the state a new/stock phone should be in.

If everything boots fine you are finished at this point :slightly_smiling_face:

Thank you for the help!

1 Like