FP4 Root Access is possible, maybe a bit risky

Hi every one,

I tried to root my FP4 but after this, my phone have been blocked in a bootloop.
I’m a bit lost and I tried to check every bootloop issue and there is always an other problem with mine.

Also I tried to follow these step (https://support.fairphone.com/hc/en-us/articles/4433978210833) but it’s blocking me at the 14 step because there is no “git-bash.exe” in this folder “bin-msys”.

Or may I need to update the firmware but I don’t know how to do this.

Someone can help me please ?

Welcome to the community :wave:

What steps did you follow to root your phone and at what point did it fail? :thinking:

Can you also boot the phone into fastboot and check the output of fastboot oem device-info please :pray:

Don’t reinstall the system for now, and whatever you do, don’t lock the bootloader!!!

Hi thanks for your quick response :smiley:

I followed these step on youtube (How To Root (Almost) Any Phone in 2020! - YouTube), the help of this forum and this (Fairphone 4 - Root | XDA Forums) with the .img for magisk
The only point who fails is for the reboot, so the last step

Here is the response of my console (I think that my computer don’t detect it in fastboot mode but in recovery the devices shows “unauthorised”) :

My phone shows actualy :
Fatsboot mode
Product_name:FP4

device state : unlocked

Thank you !

I need some more information about what you did and what the current state is:

  • What boot.img did you use?
  • Did you flash the image (like that YT video tells you) or fastboot boot as you are supposed to?
  • If you fastboot booted it, did the initial boot fail or did it stop working after you pressed Install in the Magisk app?
  • What FPOS version are you on (check the version shown in recovery as well)?

If you flashed the boot.img, the next step would be to boot from a stock (unpatched) one. Since you already downloaded the factory images just take the included boot.img and try booting from it with fastboot boot boot.img.
If that succeeds you can flash it and we’ll start process again from there.

Those instructions are quite old, the (up-to-date) instructions those are based on are here:

1 Like

I’ll try to sum up what I did:

  1. I unlocked OEM and allowed USB debugging
  2. I made an update of my driver and download adb on the support of fairphone (https: //support .fairphone. com/hc/en-us/articles/10492476238865)
  3. In adb, I reboot bootloader and I inputed fastboot flashing unlock
  4. reboot and I did the same as 1.
  5. I took the boot.img from here in the zip (https: //forum. fairphone. com/t/finally-the-fp4-rom-file-is-available/82041)
  6. I transferred it on my FP4, I downloaded and installed magisk from the boot.img.
  7. I transferred the magisk_patched.img on my laptop
  8. I reboot bootloader and I fastboot flash the magisk patched file
  9. I reboot it and here was the begenning of the bootloop

For your questions, I flashed it like the video
I was on the last FPOS, I made an update before and my recovery show this :

I tried to boot with fastboot boot boot.img and this append, the first one is from fastbootd and the second from the bootloader

So you downloaded version FP4.SP21.B.048 from here, right?!
Those are outdated, the current FPOS version is FP4.SP25.B.058, which we don’t have factory images for yet.

For future reference, no matter what people tell you, don’t flash it (if you don’t have a good reason to), that only creates problems, and you loose the ability to restore the stock images through the Magisk app before an OTA update.

That recovery doesn’t seem right, I would expect 12/SKQ1.220201.001/SP25 if you are on the latest release, notice the 12 for Android 12 at the beginning and that bold part at the end FP4.SP25.B.058.
Check your current slot with fastboot getvar current-slot, set it to the other one with fastboot --set-active plus a or b (depending on which one you’re in) and check that recovery version. I think your phone switched slots.

Bootloader is what we want. I assume your phone didn’t boot from the outdated boot.img, right? :thinking:

I’ve uploaded you a stock FPOS-B.058-boot.img and a patched FPOS-B.058-magisk-boot.img.

  • First make sure you are in the right slot
  • Then try booting that stock boot.img
  • If that works you can flash it, so we get a blank canvas to start from
  • Reboot to see if everything still works
  • Boot from the patched image and follow the rest of the installation described above

Yes I downloaded from there

Okay I’ll remember it thanks a lot

Yes you’r right

I check, I’m on the a slot, so I change it with fastboot --set-active=b and now on recovery it’s 12/SKQ1.220201.001/SP25

I boot on the bootloader your stock and it works ! It shows"Hi there"
But I don’t want make more mistake, I input this “fastboot flash boot FPOS–B.058-boot.img” in the bootloader now ?

Since you are in the right slot, that should work, yes :slightly_smiling_face:

1 Like

Thank you a lot !
Last question, should I do an update about something or this “flash boot” is like a factory reset ?

No, this doesn’t reset any data, all we are doing is restoring the boot partition to its vanilla state, so you can complete the rooting process from there.

In case you have any issues flashing, flash it explicitly to the b slot with fastboot flash boot_b.

1 Like

I had a similar problem to Lars_Henning:
restored images (after manually adding missing stock boot img), installed ota without reboot, ‘install after ota’ in magisk, then bootloop (unlocked warning → fairphone image → unlocked warning).
After switching the active partition successfully booted into (non root) pre update rom. I then updated without magisk, and reinstalled it afterwards using hirnsushi’s patched boot img. Now everything is working fine.

I will be following this process in the future:

  • Extract boot.img from ota.zip
  • patch boot.img using magisk app
  • restore images
  • update os (with reboot)
  • check if working
  • fastboot boot patched img
  • direct install using magisk app

It’s a little cumbersome and slow, but safe.

Maybe the updater only commits to the changes when restarting and magisk makes you boot to the inactive partition, causing a bootloop?

My device:
8GB RAM version
Magisk version during problem: 25.2
Magisk modules: ACC, ACP, AML, AuroraServices, Busybox NDK, DJS, JamesDSP, Universal SafetyNet Fix (Displax mod), LSPosed
Zygisk enabled
Magisk app hidden
Country: Germany
[I don’t think they are part of the Problem, since it didn’t even get to the animation part, if it is, it’s probably SafetyNet Fix]

Welcome to the community :wave:

The OTA updates are delta updates and don’t contain a full boot.img, you will have to merge the OTA update(s) with the previous factory images to get a usable boot.img.
The available factory images are also frequently several versions behind.

If you insist on taking the manual route (or have to), I’d suggest the following workflow:

  • Check the current slot adb shell 'getprop ro.boot.slot_suffix'
  • Restore images through Magisk
  • Install OTA, don’t reboot
  • Copy the new boot.img with adb shell 'su -c dd if=/dev/block/by-name/boot_{other slot} of=/sdcard/boot.img'
  • Patch that boot.img with Magisk, adb pull to PC
  • (Optional) reboot the system and check if the OTA updated was successful
  • Follow the usual fastboot boot process

The updater writes the new partitions to the inactive slot while the system is running. There is the possibility to run scripts after the new slot has been successfully booted, but I haven’t seen that break a Magisk installation so far (I’ve been updating a FPOS + a CalyxOS FP4 for well over a year without any issues).

Selecting “Install to inactive slot” in Magisk will force the phone to boot to that slot, which can be a problem if the OTA updated failed, yes. But the OTA updater should usually throw an error message in that case.

1 Like

I have FP4.SP21.048.20230215 installed on my rooted device with magisk 25.2 (25200). i tried doing the ota for SP25.B.0058 by doing the following steps:

  1. Magisk app → Uninstall → Restore Images
  2. Apply OTAs as normally (Settings → System → System Update).
    I watied for the installation to be fully done (both step 1: “installing update”, and step 2: “optimizing your device”, of the OTA). I did not pressed the “Restart now” button. Instead i did: Magisk app → Install → Install to Inactive Slot.
    Magisk completed that without any erros, so i pressed reboot in magisk.

The following reboot process didnt went well, multiple times I was seeing the unlocked bootloader page. After some times the phone booted again into (i guess the old slot). There it it is shown that my old system is installed. System update is still showing me the reboot now button and magisk says it is Uninstalled (N/A).

Im a bit of in fear of a next reboot and that i bricked my phone. Whats the best thing to do now?

Thank U

Have a look above please.

Welcome to the community :wave:

You aren’t the first with that problem, could you please list the modules you had enabled :pray:

Still looking for a pattern here, Universal SafetyNet Fix seems like a good candidate …

… that’s the one constant among all the cases so far :thinking:

As I’ve said before, I haven’t had any update issue with FPOS or CalyxOS, but both devices are only using a limited set of modules (ACC, Systemless hosts, Fullscreen/Immersive Gestures), no Zygisk and not hidden.

My money is on one of the more invasive modules causing issues.

1 Like

I created an issue in OTA Update with Magisk deactivated fails on booting · Issue #279 · kdrag0n/safetynet-fix · GitHub

1 Like

To be clear, this is nothing more than speculation at this point, might just as well be a red herring …

We would either need logs from the failed boot (if we can get them), or someone with that issue could disable modules one after the other until the OTA succeeds, which should tell us the culprit as well :thinking:

Next OTA I will try that. However, maybe other people using the module encounter the problem o other devices, too. The issue should just be a starting point for a discussion

Since I’m a absolute beginner in rooting, i had not so many modules. As far as i remember i definetely had:
Universal SafetyNet Fix
Zygisk

maybe also Shamiko (im really not sure about that one)

I guess i did not had more since this was the absoulte basic need to have a rooted phone and my banking apps to be working.

The MagiskApp itself was hidden and i had some banking apps (and maybe also google play services) on the the denylist.

Im willing to deliver logs if you tell me where to find them. Also happy to hear whats the best solution in my case to recover.

The plot thickens :smirk:

Logs don’t survive a reboot. If we are lucky and the phone gets far enough in the boot process adb logcat > logcat.txt could possibly get us logs.
Apparently there are ways to get kernel logs directly after a failed boot via TWRP, no idea if they still work and flashing TWRP would add yet another variable.

If you need to get back to a working system ASAP, check if you can start the OTA update again, reboot and if that works (you actually end up in an updated system) reroot with the usual instructions. You can use this image:

If the updater doesn’t let you install the OTA update again and / or you still get a bootloop, the new slot probably still has a patched /boot partition, at which point you can either flash a stock one …

… or try disabling modules / Magisk hide until it works.

Let’s maybe start here. So the only option you get is a reboot, right? What happens if you do that? :thinking: