FP4 Root Access is possible, maybe a bit risky

That’s correct. If you don’t install Magisk again once you booted the patched boot.img a reboot will bring you back to where you where before.

I’d still be careful though, make sure you can make a successful adb connection to your phone before rebooting. If you get stranded in a bootloop because Titanium Backup messed something up, there won’t be a pop-up asking you to trust your PC.

Maybe someone else already went through a Titanium Backup restore and knows how well it works. I personally always set up everything from scratch, have been burned enough times in the past :roll_eyes:

1 Like

This. Ahah experience talking. I never ever use Titanium backup. I like my device cleanly set up :smiley:

Hirnsushi can you please send me an email at [moderator edit: removed email, please use Forum DMs]. I made this account just to get ahold of you. I am from xda developers. There’s a community here that is interested in doing some things with the fp4 that could need your help. If anyone is reading this that is a developer and good with Qualcomm programming. Shoot me a message as well. Will pay $$$ for bounty.

2 Likes

Hi. I patched boot.img on my new FP4 and reboot from that as @hirnsushi says. I installed Magisk with mobile data, because WiFi don’t works. After another reboot I installed LSposed and Gravity Box and all seems working fine.

1 Like

You are not supposed to flash the boot.img, only boot from it and then run magisk installation

2 Likes

Actually, with the way to get kernel images @rar0 discovered it’s possible to directly flash a patched boot.img

The old way has the benefit of not having to look up your build number and less ways to flash wrong stuff, but it certainly is slower… your choice :man_shrugging: :smirk:

1 Like

Oops! You are right, thanks… I have rectified the mess in my post

2 Likes

Hello Everyone!

I obtained root with hirnsushi’s solution (thank you for that btw) but reverting did not work (or whatever else I was actually doing).

After I installed and set up Magisk, I played around a bit and then decided to do a Factory Reset. (At some point before or after the FR I also booted with the original boot.img from the Fairphone Source Code Website, dont know whether this is relevant)

Well… after all of that, the phone booted into the “Erasing…”-Screen for a short moment. But after that the phone loops with the “Unlocked Bootloader” Warning, some seconds of the Fairphone Logo and a reboot.
I already tried doing a Factory Reset from the Recovery Mode and also read the Troubleshooting from the Support but without a solution.

Could the flashing of the original system-image be an possible solution (not available yet) or can someone help me any further please?

The original boot.img is ancient, never flash that.
Are you still able to directly boot any of the boot images with $ fastboot boot boot.img? :thinking: That would at least tell us it’s actually the boot partition causing problems.
If that’s the case I’d suggest first switching to the other boot slot in fastboot (not at a PC right now, will have to post that command later) and if that doesn’t work flashing a newer boot.img (method to get it above :arrow_up: ).
:crossed_fingers: you get it working again :grimacing:

2 Likes

Thank you @hirnsushi, yes I can boot images. Will try the switching first.

Just a note ibw: If I boot from the patched boot.img the phone stays a little bit longer at the “Fairphone”-Logo and then shuts off, no reboot.

Alright, switching boot slots worked, Thank you @hirnsushi!
Do you know what to do with the corrupt slot?

Commands used, for everyone interested:

Get the current active boot slot:
fastboot getvar current-slot

Select the other slot: (either “a” or “b”)
fastboot --set-active=b

3 Likes

Great you got it working again :+1:
I wouldn’t worry to much about the unbootable slot, it will be reflashed with the next system update anyway. But if it bothers you, you could always extract your working slot and flash it onto the other one. I wouldn’t but you could :smirk:
Backup a copy of your working slot though, just in case.

3 Likes

Is it possible to make a copy of a slot without root?

Yes, one way to do it is essentially half the root guide without actually rooting your phone:

  • Get Magisk and patch any boot.img you have lying around
  • $ adb reboot bootloader and $ fastboot boot patched_boot.img
  • $ adb shell
  • $ su and finally # dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img for example to get boot_a
  • then just $ adb pull /sdcard/boot_a.img

I believe there is the possibility to directly dd the boot partition to your PC, don’t remember that syntax right now, sorry :man_shrugging:

Aha sounds interesting, but for my understanding the slot don’t contain the whole rom? I am on A94 boot is your earlier root guide still working? I really want to try it but i don’t want to damage my mobile. I always root all my mobile phones.

Yes, those A / B slots only contain the boot partition. When performing a system upgrade the new boot.img (so your kernel and related stuff) get written to the unused slot and at reboot your system changes to that slot. Other A / B slots (like modem, recovery…) might be updated as well, depending on the update.
I don’t know of a method to completely dump your whole system at the moment, certainly not into a reflashable custom rom kind of image. Maybe it’s possible with TWRP, haven’t looked into it. The only available TWRP for the FP4 doesn’t have access to encrypted /data anyway, so no reason to try :man_shrugging:

I can’t tell you if root still works on A94, my provider apparently doesn’t want me to update just yet. But I see no reason why it wouldn’t and early reports seem to indicate it does.
If you aren’t comfortable on the command line and with some hands on troubleshooting I wouldn’t suggest rooting at the moment, since there are still no easily flashable rom images available to recover from some worst case scenarios.

1 Like

I am familiar with Linux and commandlines input but not an expert in it. I guess I wait some more. It should be possible soon to reflash everything when things go wrong. Many thanks for the information and giving root as an option.

1 Like

I can confirm root works with A94.
As for the update not showing up you might have the same issue I had, rooting and messing with gapps basically seemed to prevent the update to show up.
I wiped my phone (after breaking too many things by trying to get Google maps to work with microG) and the second my freshly wiped device grabbed an internet connection, the update showed up…

1 Like

Yeah, I suspected that might be the case. But I’m in no rush to update, so I’ll first mess up my install enough to actually warrant a factory reset :smirk:

I have written down this procedure in some more steps as it took some tail-and-error. Feel free to provide feedback: Fairphone 4 – Root -December 2021 – Stijn D'haese

Also, any spelling errors are free of charge. :sweat_smile:

8 Likes