TWRP for Fairphone 3

Sure.

TWRP on the Fairphone 3/3+ is currently on the Android 9 branch of TWRP (the “9_0” in the TWRP image filename).

Dynamic partitions were introduced with Android 10 … TWRP and Android 10.

My guess is that TWRP for the Fairphone 3/3+ would need to be on a branch which can handle dynamic partitions. TWRP in general is prepared to do this, apparently.

5 posts were split to a new topic: Issues rooting a FP3

Looks like something topjohnwo would want to fix – is there a Magisk bug report for this?

Same for TWRP … just talking about it in the forum isn’t going to help IMHO.

This topic was opened by the maintainer of TWRP on the Fairphone 3/3+, so in theory posts here should not be in vain, but there’s also Issues · TeamWin/android_bootable_recovery · GitHub … there’s an issue already …

1 Like

It does not look like anyone is actually working on this :confused:
So I guess this is the end of rooting on the FP3?

Took me a while, but it’s here, first Android-11 based TWRP for FP3 with dynamic partitions and decryption:

I’ve also looked into the Magisk-Issue, see here:

8 Likes

Both (patched TWRP and patched boot image) work like a charm! Thanks a million (also for getting your patch into the next Magisk release).

May I ask you how you did this, please? At which point do you apply the boot.img and how? Thank you!

Thanks for continuing to work on this.

I just booted it and unfortunately neither mounting partitions apart from data nor decrypting data seem to work for me. It doesn’t ask for my decryption password, so doesn’t decrypt data, and mounting the other partitions looks like this …

I’m running Android 12 (S) in the form of /e/OS e-1.11-s-20230511288805-dev-FP3 … https://doc.e.foundation/devices/FP3.
Is there something I can test or try?

Switching the storage to SD card works, so apart from screenshots I can copy logs.

Please provide the /tmp/recovery.log.
Does /e/ use dynamic partitions?
What happens when you use the old 9.0-based TWRP?

Done via GitHub.

I don’t know. 9.0 based TWRP can mount partitions other than data, if that’s an indication.

Doesn’t ask for decryption password, so doesn’t decrypt, like the 11.0 based TWRP.
9.0 based TWRP decryption support was lost with /e/OS when it went from Android 11 to Android 12 on FP3.
Other partitions seem to mount fine, though (I can select them in “Mount”, too, which I can’t do in the 11.0 based TWRP) …

Seems there are two issues then for /e/.
It doesn’t seem to use dynamic partitions and the 11-based TWRP can’t decrypt the 12-based encryption.
I tried building a 12-based TWRP before, but that wasn’t able to decrypt the 11-based encryption of FPOS.
So this might need a separate TWRP-build for /e/
Would be great to get feedback from someone using LOS.

@bami: How to apply the patched boot image

  1. Make sure your FP3 is updated to the current patch level, (.0022) that it has the developer option enabled, that the boot loader is unlocked and that the current Magisk app is installed.
  2. Make sure your PC has the Android developer tools adb and fastboot installed.
  3. Download the patched boot image from https://github.com/topjohnwu/Magisk/files/11646684/FP3-8901.4.A.0022.0-boot_magisk_patched_skip_initramfs.img.zip (from the link provided in “Bootloop upon fastboot installation with FP3-8901.4.A.0021.0-gms-0b368514-user” above) and unzip it.
  4. Reboot your FP to bootloader mode with “adb reboot bootloader”
  5. Boot the downloaded image with “fastboot boot FP3-8901.4.A.0022.0-boot_magisk_patched_skip_initramfs.img” and make sure the patched image works for you.
  6. If it does then reboot again to fastboot mode as in step 4. and then install the patched image to the boot partitions of your FP3 with “fastboot flash boot_a FP3-8901.4.A.0022.0-boot_magisk_patched_skip_initramfs.img” and “fastboot flash boot_b FP3-8901.4.A.0022.0-boot_magisk_patched_skip_initramfs.img”
  7. Reboot (“fastboot reboot”) and enjoy :wink:

Note: If you want to apply any future releases to your FP3 you will have to revert to the unpatched boot image, so I strongly recommend that you keep an original boot image as contained in https://fairphone-android-builds.ams3.digitaloceanspaces.com/FP3/FP3-8901.4.A.0022.0-gms-5bdac72d-user-fastbootimage.zip handy. To flash the original boot repeat the above step 6 with the boot.img contained in the images directory of the zip.

2 Likes

Tested with:
lineage-20.0-20230508
unfortunately no password prompt, and no decryption…, but thanks for your efforts!
recovery.pdf (104.8 KB)

Many thanks, @wjg57, for your detailed instructions! These are perfect for me!

Use this one instead: https://github.com/topjohnwu/Magisk/files/11646684/FP3-8901.4.A.0022.0-boot_magisk_patched_skip_initramfs.img.zip

The one you linked breaks recovery-boot (It will just boot to system, if you try booting recovery)

Thanks for your attentiveness, @k4y0z !
In fact that’s the one I used - picked the wrong link while reconstructing the process for the step-by-step, sorry. I’ve updated the link in the step-by-step with the corrected link.

This one (obviously) doesn’t work for A.0023 anymore and we require a new magisk patched boot image for that version.

Since I’m eager to learn, given that I have an A.0023 boot.img, Magisk, development tools and a somewhat okay understanding of c/c++, what would one need to do to create such a patched boot image?

The easiest way would be to use the apk created by my PR here:
https://github.com/topjohnwu/Magisk/suites/13452929666/artifacts/738307098

If you want to build it yourself there is a guide https://topjohnwu.github.io/Magisk/build.html

2 Likes

Would it be possible to host the apk somwhere? The github artifacts are no longer available as it seems, and I can’t get the build to work…