FP4 Root Access is possible, maybe a bit risky

Didn’t you get a update notification or did it fail during the update process and if so at what point?
Have you rerooted your phone before updating?
There has to be a way to get this working, what are we missing here :thinking:

1 Like

No, not yet rooted.
build no. still the same A.081…
all google apps activated
download: ok
installation Error

Huh, interesting… is that the same error you had before?
Maybe there’s still some modification to system files left somehow. I wouldn’t now how, but who knows :thinking:
OK, here’s a crazy idea:

  • Install the Magisk app
  • Boot (not flash) your prerooted boot.img
  • Perform a Magisk uninstall in the Magisk app

That shouldn’t work, a factory reset should have purged all the remnants of Magisk off of /data, but hey, worth a shot.

Apart from that, could Titanium Backup have messed this up somehow, I don’t really know how it works these days, haven’t used it in almost a decade…

Third option, your other boot slot could be tainted, maybe because you flashed a wrong boot.img to it at some point. The updater usually flashes to the unused slot, maybe then, the failure gets triggered.
So try flashing that boot_a.img you used to get your phone working again to the other slot.

1 Like

Have moved several posts here as proposed.

2 Likes

I tried it with the latest boot.img avaliable here ('cause I have the A.094 ROM version on my phone)

https://code.fairphone.com/projects/fairphone-4-kernel.html

https://storage.googleapis.com/fairphone-source/FP4/A.094-boot.img

And that works perfectly, that’s my daily driving phone, and no problems :wink:

4 Likes

Hey!
I tried to root my FP4 on /e/os using Magisk.
It worked using the default stock rom on FP4, so rooting the device works.
However, using /e/os Magisk just crashes when I try to modify the boot.img using the install button in Magisk.

This happens with v23 and the canary build. Does anyone have an idea how to fix it? Could it be any permission issue?

Cheers!

I just uploaded a Magisk patched version of the /e/ boot.img here.

Could you please try to flash that in fastboot

$ fastboot flash boot_a boot_magisk_e.img
$ fastboot flash boot_b boot_magisk_e.img

I hope you have your important stuff backed up from your phone, hic sunt dracones :smirk:

3 Likes

Hey!
How did u manage to patch it?

Yes. That works. However, a direct install using the app still doesnt work, after the flash.
Another user reported that he didnt have any issues with it.
I guess you also didnt have any issues with it.
I mentioned you in the ticket.

You shouldn’t have to install it again after you flashed the boot.img.
I patched the image on a phone running vanilla FPOS, so your problems with Magisk might well be connected to /e/.
If you want to figure this out, it would be really helpful if you could post your Magisk installation log, see here:

Installation log from the Magisk app (press “Save log” after installing Magisk or a module). If you experience errors when installing Magisk or modules in the Magisk app.

If that doesn’t tell us anything useful, a logcat would be the next logical step.

the problem is that the entire Magisk app crashes, so there’s no logs anywhere to be found.

Could you try running logcat :pray: maybe that’s revealing something useful :thinking:

  • $ adb shell "logcat -c && logcat > /sdcard/logcat.txt"
  • Open Magisk, make it crash
  • Press Ctrl+C in the terminal you have adb running
  • $ adb pull /sdcard/logcat.txt
1 Like

this did the trick for me. thanks.
had the same problem as @noodlejetski .

here is the log.
tried with different magisk versions. tried having the boot.img on the device and on a sd card.
also tried the original boot.img as well as the one /e/ provides.
but the app always crashed when altering the boot.img and leaves an empty file.

2 Likes

OK, I had a look at the logcat and the point it crashes isn’t hard to find

01-19 12:54:27.950  4611  5154 I opjohnwu.magis: Starting a blocking GC Alloc
01-19 12:54:27.967  4611  5154 I opjohnwu.magis: Alloc concurrent copying GC freed 636(24KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 6038KB/11MB, paused 20us total 16.674ms
01-19 12:54:27.967  4611  5154 W opjohnwu.magis: Throwing OutOfMemoryError "Failed to allocate a 50126864 byte allocation with 6183141 free bytes and 30MB until OOM, target footprint 12366285, growth limit 37748736" (VmSize 13313768 kB)
01-19 12:54:27.969  4611  4611 E ThreadGroup: java.lang.OutOfMemoryError: Failed to allocate a 50126864 byte allocation with 6183141 free bytes and 30MB until OOM, target footprint 12366285, growth limit 37748736
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at java.util.Arrays.copyOf(Arrays.java:3161)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at com.topjohnwu.signing.SignBoot.verifySignature(Unknown Source:23)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at a.fs0.j(Unknown Source:2)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at a.ks0.i(Unknown Source:8)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at a.bs0.g(Unknown Source:28)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at a.oo1.d(Unknown Source:3)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at a.vt1.run(Unknown Source:2)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at a.zw1.j0(Unknown Source:0)
01-19 12:54:27.969  4611  4611 E ThreadGroup: 	at a.yw1.run(Unknown Source:7)
01-19 12:54:27.971  4611  4611 I opjohnwu.magis: System.exit called, status: 1

The closest bug report i could find for Magisk is #3876, but in that case Magisk wanted a order of magnitude more memory. On /e/ it’s killed for not even 50MB, that doesn’t make sense.
The only other pointers, compared to my logcat (on vanilla FPOS, working), were some irregularities between how the files get opened. But that can just as easily be caused by the boot.img apparently being read from SD in your case (and you tried all the other ways as well). But maybe, just maybe this is somehow related to the DocumentsUI / Media Provider shipped with /e/.

I’m not a java developer and the problem isn’t obvious enough for me to grasp at the moment, so someone on /e/ will have to report this in the Magisk bug tracker, sorry :see_no_evil:
I’ll switch to /e/ on one device in the future, maybe the problem becomes more apparent if I can reproduce it myself.

Until this is resolved I’ll provide patched boot.imgs for people who need them.


Edit: So the problem seems to be not exclusive to Magisk and will be fixed in the next update, according to

3 Likes

@anon33247607
I managed to root my /e/OS FP4, so I’ll make a thread about it for everyone who needs this :wink:

1 Like

Root on /e/ has been working for quite some time, just use:

We only tried to figure out the problems with patching boot on /e/, that’s still not fixed…

2 Likes

It didn’t work for me (with mine, maybe I did something wrong) :thinking:
I patched it myself with WSA (Windows Subsystem for Android) 'cause yes, patching on Magisk was dysfunctional on the /e/OS FP4 (strange issue tho)
But when trying to boot on it, it just rebooted after showing the /e/ Logo (Android loading)
And when trying to flash, I had an error (tried a & b slots)

1 Like

Huh, interesting, now I really need to know what route you ultimately took :thinking:

Yeah, I don’t get it either why the /e/ people decided to set the jvm heapsize to a completely unusable size…

Since you already have a working (rooted) system, I wouldn’t ask you to test the boot.img I uploaded, but it seems to be working for others.
I still would be very interested in your method :smiley:

2 Likes

Do you think I might do a separate thread, or post it here ?
Maybe a separate thread for /e/OS specific could be interesting, 'cause the boot.img isn’t the same

2 Likes