FP4 Root Access is possible, maybe a bit risky

For me from the first OTA on the procedure with trying to keep Magisk did not work at all. So I started recovering the orginal boot image, run the OTA, reboot and root the FP4 from scratch. BTW, probably I am the FPOS case @hirnsushi mentioned before :wink:

Ok - I did it. I’ve taken the “upgrade” to Android 13 as a chance and did a complete fresh install using the factory images from here: Installing Fairphone OS Manually – Support
However, I’ve stucked into the “critical partions locked” - problem. Almost same like described here Stuck with locked critical and FPOS - Help / Fairphone 4 - Fairphone Community Forum, also that solution worked for me. (Thanks @ @hirnsushi)
Additonally, I found out that my “active slot” was set to “B”. So I reset it also to slot “A”.

Even I was fine with my backup strategy (Swift backup + some manual messenger backups), it tooks a couple of hours for me.
But now I have a rooted (Magisk Delta) FPOS 13 with all my needed apps incl. data/settings.
(Even some AdAway problems seems to be solved now, the main reason to root for me, the only thing I’m missing is a reliable vanced youtube replacement).

I’m looking forward to the next OTA and hopefully the build-in magisk mechanism (install to inactive slot) will work then :slight_smile:

1 Like

As a vanced YouTube replacement I can recommend Revances YouTube or - as I use it myself - Revanced YouTube Extended.

Or do you consider it unreliable? If so, why?

1 Like

Thank you, I will ckeck them out. To be honest, I didn’t search too deep for a replacement (since the old Vanced app is still working - for now). But I’ve found only a lot of garbage: non-working, spy-ware, malware and so on. This is what I meant with “unreliable”. I’m not sure if I’ve tried your suggestions - but I will do and let you know my opinion.

1 Like

Hirnsushi, do you by accident have the boot img from the latest update? I forgot how to acquire it. The buildnumber is FP4.TP1X.C.079.20231013

Thanks a lot,

Bas

I haven’t had time to update my family member’s FP4 yet, sorry, but you can follow these instructions to get it:

If you are extracting the image after the update but before you rebooted, make sure to get the other slot you aren’t currently in. If you are already running the updated system you’ll want your current slot.

If you lost root, get the previous boot.img from the kernel page, patch that and fastboot boot it. You will get some error messages if you are on a different version, but it will do for extracting the boot.img you need.

Have fun :nerd_face:

1 Like

I have one, but I do not have a place to put it for download for everyone.

EDIT: Creating the image is rather simple:

  1. Boot into bootloader
    adb reboot bootloader
  2. Start fastboot with recovery image (i.e. Linageos 20 recovery)
    fastboot boot lineage-20231001-recovery-FP4.img
  3. get the boot image (for example from slot a)
    dd if=/dev/block/by-name/boot_a /tmp/boot_a.img
  4. Get boot image
    adb get /tmp/boot_a.img
  5. reboot and push boot image to download dir
    adb push boot_a.img /sdcard/Download/
  6. Install magisk into the image under /sdcard/Download/
  7. Check image file created by magisk install under /sdcard/Download/ and download it via adb
    adb pull /sdcard/Download/FILENAME_MAGISK.img
  8. Reboot into bootloader again and boot the rooted image
    fastboot boot FILENAME_MAGISK.img
  9. Install magisk again with the direct method
  10. Reboot and done :wink:
2 Likes

No biggie. Thanks a lot! :smile:

Thanks Lars! I will try!

It worked guys, thanks a lot!

2 Likes

Just for future memories, I had to extract the boot.img for rooting FP5, and as the phone is not yet rooted the above command is not working (missing “su”)

So that’s my procedure:

  • fastboot boot twrp-FP5.img
  • identify the current slot (“a” in my case)
  • adb shell dd if=/dev/block/by-name/boot_a of=/external_sd/boot-FP5.img

As TWRP is unable to decrypt user partition I had to insert a MicroSD card, so that’s why I copy to external_sd instead of sdcard :slight_smile:
I don’t know if there is a method without external_sd, didn’t find a way to pull it directly to the computer without copying it first to the phone…

Yes - it worked out for me now :smiley:
No more annoying searching for an appropriate USB cable :rofl:

Thanks for advising me. Now I have to fight with stupid “root detection” of Google Wallet and some other apps, but anyway - there is always something :slight_smile:

You configure Zygisk in Magisk App and hide certain apps from root, like banking apps

Thanks, for helping me.
I am using Magisk Delta exactly of that reason to hide root for other apps. This forks works with a kind of “white list”, i.e. only apps on that list should be able to see root and root is hide from all others.

This works until a couple of days completely independent from current OS OTA update. I use three different banking apps, 2 of them still working (which did not working with original Magisk).
The 3rd has retrieved an update on Nov 8th and detects root now with that version. The same for Google Wallet. I could rollback the banking app to the previous version, it is working. But still no solution for Google Wallet…
I’m a little bit tired of such annoyning games of hide & seek…

Missing “of=” in front of the out file
I cannot edit the original message, so here is the corrected one:

  • Boot into bootloader
    adb reboot bootloader
  • Start fastboot with recovery image (i.e. Linageos 20 recovery)
    fastboot boot lineage-20231001-recovery-FP4.img
  • get the boot image (for example from slot a)
    dd if=/dev/block/by-name/boot_a of=/tmp/boot_a.img
    Or use any other dir that is available for storing the out file
  • Get boot image
    adb get /tmp/boot_a.img
  • reboot and push boot image to download dir
    adb push boot_a.img /sdcard/Download/
  • Install magisk into the image under /sdcard/Download/
  • Check image file created by magisk install under /sdcard/Download/ and download it via adb
    adb pull /sdcard/Download/FILENAME_MAGISK.img
  • Reboot into bootloader again and boot the rooted image
    fastboot boot FILENAME_MAGISK.img
  • Install magisk again with the direct method
  • Reboot and done
1 Like

If your device is already rooted (and still bootable) the process is even easier:

  • Restore images in Magisk, run the OTA and don’t reboot
  • Check your slot with adb shell 'getprop | grep slot' (we want the other one)
  • dd if=/dev/block/by-name/boot_[other_slot] of=/sdcard/FPOS-[version]-boot.img
  • Run Magisk with the OTA option
  • dd if=/dev/block/by-name/boot_[other_slot] of=/sdcard/FPOS-[version]-magisk-boot.img
  • adb pull /sdcard/FPOS-[version]-boot.img && adb pull /sdcard/FPOS-[version]-magisk-boot.img

Yes that is also working. But is the kernel image already updated after the OTA process and before the final reboot? That would make it much easier, to regain root after the upgrade

It is, the (delta) OTA update takes the stuff in your current slot, applies its patches to it and writes the results to the unused slot.
Apart from some stuff that can be run after the OTA (if needed), the update is basically finished before you reboot.

2 Likes

OK, I was not aware that I could extract to boot image from the unused slot before the reboot. That makes it even easier to root after the OTA with some steps less. :+1:

Hallo everyone, I have a brand new FP4 which I rooted with magisk after unlocking the bootloader. Non change in recovery.

I see now that an update to version TP25.C.095 is available, but I have no idea of how it works on a rooted phone. Will it complete or should I remove root first and then re-root again? Or is it better not to update at all?

Thanks

Aniello