[ GUIDE ] [ ANDROID 10 ROOT ] [ HOW TO ] Patching Boot.img with Magisk

rczrider

Senior Member
May 20, 2015
680
511
0
Markarth
Anyone having trouble with magisk_patched.img and the September update?

I'm not new to this, so it (probably) isn't anything I'm doing wrong. It updates to the September just fine, only the Magisk-patched boot.img doesn't take. Bootloops into fastboot; restoring stock boot.img gets me back into Android without issue. I've done a combination of flashing stock boot.img, magisk_patched.img, reboot into bootloader, etc. Nothing works.

Using the latest Magisk Manager 7.5.1 (267).
 

scooter1979

Senior Member
Oct 10, 2010
228
54
0
Ypsi
Anyone having trouble with magisk_patched.img and the September update?

I'm not new to this, so it (probably) isn't anything I'm doing wrong. It updates to the September just fine, only the Magisk-patched boot.img doesn't take. Bootloops into fastboot; restoring stock boot.img gets me back into Android without issue. I've done a combination of flashing stock boot.img, magisk_patched.img, reboot into bootloader, etc. Nothing works.

Using the latest Magisk Manager 7.5.1 (267).
You're not using the latest canary build. 7.5.1 is either stable or beta. Last I checked, the canary should look to install 20424.

FWIW, using the latest canary, I can patch my boot.img, and the phone will boot, but once I get into the actual OS (after entering security PIN), the whole phone freezes completely. Hard reboot via hold power button is the only thing that works. Had to reflash original boot.img to get back into the phone. Someone else reported this on John's Twitter thread, and there have been other mixed results reports for the Pixel 3.
 

Ipeacocks

Senior Member
Oct 26, 2012
72
10
0
Tried to root Pixel 3 on Android 11.
So far unsuccessfully. If you try to flash patched boot produced from stable Magisk manager version - you will get bootloop. For fixing that flash original boot image from ROM archive via fastboot.
I've also tried to to flash patched boot produced from canary Magisk manager version. But it leads to non-working recent apps screen in any launcher.
 

rczrider

Senior Member
May 20, 2015
680
511
0
Markarth
You're not using the latest canary build. 7.5.1 is either stable or beta. Last I checked, the canary should look to install 20424.
That's correct. I didn't see anything in this thread suggesting I should use Canary for the September update of Android 10...

...except that I'm an idiot and didn't notice that September's update is actually 11. Derp :p
 

scooter1979

Senior Member
Oct 10, 2010
228
54
0
Ypsi
For using this method on the latest A11 update:

You must use the latest Magisk Canary build (currently 20425).

If you have systemless hosts enabled (primarily for adblocking) in Magisk before updating to A11, it is possible your Pixel 3 will freeze after your initial security login after flashing the patched boot.img. If this happens, get your phone back to fastboot (power + vol down should work) and run this command from your computer:

adb wait-for-device shell magisk --remove-modules

The cmd prompt should then wait for you to reboot your phone. When your phone reboots and adb comes active, that command will manually disable your modules. Currently, it appears at least the systemless hosts is causing the freeze, but it's possible other modules may cause it as well.

The disable code comes from the Magisk troubleshooting wiki here:

https://www.didgeridoohan.com/magisk/MagiskModuleIssues

The freeze issue started in 20424, and I have tested it to be persistent in today's Canary release, 20425.

A couple folks have brought this issue up in John's Twitter feed (he's the one who made us aware of the adb line), so I would guess he's working on a fix, but again, that fix does not appear to be present in today's release.
 

rczrider

Senior Member
May 20, 2015
680
511
0
Markarth
For using this method on the latest A11 update:

You must use the latest Magisk Canary build (currently 20425).

If you have systemless hosts enabled (primarily for adblocking) in Magisk before updating to A11, it is possible your Pixel 3 will freeze after your initial security login after flashing the patched boot.img. If this happens, get your phone back to fastboot (power + vol down should work) and run this command from your computer:

adb wait-for-device shell magisk --remove-modules
Thanks for passing this along!

Does this mean you could just remove the modules prior to flashing the patched boot image, boot up, then reinstall? Or is it that the modules can't be installed at all?
 

scooter1979

Senior Member
Oct 10, 2010
228
54
0
Ypsi
Thanks for passing this along!

Does this mean you could just remove the modules prior to flashing the patched boot image, boot up, then reinstall? Or is it that the modules can't be installed at all?
Magisk Manager doesn't offer the module options until the patched boot is flashed and Magisk itself is live on the device. And, of course, the device freezes before you can get into the Magisk app to disable once installed. If you updated from A10 without disabling the modules, they'll be persistent into A11 when Magisk is reinstalled, with no way in the Magisk app to remove them. Hence, the adb command.

At this point, it does not appear the modules, at least the systemless hosts, can be used.
 
Last edited:

JustinChase

Senior Member
Jan 31, 2007
342
44
28
I had to uninstall Magisk Manager in order to install the Android 11 upgrade (Manager was stuck on loading screen). I'm now running Android 11, and have installed the latest Manager 2eb00187 (299) (10)

But it fails to patch the boot image blueline-rp1a.200720.009-factory-145e4cc4.zip

Where have I gone wrong, and what can I do to proceed?

thanks
 

mhrussell1

Senior Member
Oct 28, 2011
60
3
8
Anaheim
I had to uninstall Magisk Manager in order to install the Android 11 upgrade (Manager was stuck on loading screen). I'm now running Android 11, and have installed the latest Manager 2eb00187 (299) (10)

But it fails to patch the boot image blueline-rp1a.200720.009-factory-145e4cc4.zip

Where have I gone wrong, and what can I do to proceed?

thanks
Dumb question, but did you unzip the above zip file until you get to the image.../ directory that has a file called boot.img? That is the file to copy to the phone and let Magisk mgr to patch.
 

JustinChase

Senior Member
Jan 31, 2007
342
44
28
Dumb question, but did you unzip the above zip file until you get to the image.../ directory that has a file called boot.img? That is the file to copy to the phone and let Magisk mgr to patch.
I hope it's not a dumb question, because the answer is no, I didn't. I see nowhere in any of the guides I found that says to do this, and Magisk seems to work with the zip file, but ends up failing.

I'll unzip and put just the boot.img file on the phone and try again.

Thanks!
 

joomax

Member
Aug 8, 2020
6
0
0
Can confirm guide works perfectly for me on my pixel 3, September release of A11.
Used Canary build of manager, no hiccups.

Google Pay doesn't work yet though... SafetyNet fails everything :(
 

GrandAdmiral

Senior Member
Jan 31, 2009
683
57
58
New Orleans
Tried searching but xda produced pages upon pages of results...

Is there a quick guide somewhere for switching regular Magisk to the Canary build or do I just need to back everything out?
 

Chezbel

Senior Member
Jan 16, 2011
1,979
1,664
113
Taipei
Tried searching but xda produced pages upon pages of results...

Is there a quick guide somewhere for switching regular Magisk to the Canary build or do I just need to back everything out?
If you go to Magisk Manager settings under the Manager section is an option for "update channel". I think that is what what you want.
 

mhrussell1

Senior Member
Oct 28, 2011
60
3
8
Anaheim

josh4trunks

Senior Member
Sep 16, 2010
124
26
0
I updated to android 11 using the built in updater and everything worked fine. I obviously lost magisk so today I tried tackling re-installing it. I patched the boot.img found in "blueline-rp1a.200720.009-factory-145e4cc4" and tried installing that; that got stuck on boot since I didn't use a canary build of Magisk Manager.
I tried fixing things by using "fastboot flash boot boot.img", but every time I reboot it eventually brings me back to Fastboot Mode with the reason "reboot bootloader". I see in my terminal I have flashed boot.img to both "boot_a" and "boot_b" so I am not sure what the issue is?

Any help would be appreciated. Need my phone for work and family =[

####

Checksums of boot.img are below...
md5 - 3d4d8854cbb2adb655dd5a091dfddcaf
sha256 - 48ad963af211403bf5079d2b62657cfb3b4b3031318049c432452ad62bf01a13

Production revision: blueline MP1.0(ROW)
Bootloader version: b1c1-0.2-5672671

---------- Post added at 03:44 PM ---------- Previous post was at 03:09 PM ----------

I ended up recovering using the steps in flash-all.sh. I didn't realize that would wipe my data... guess I'll need to re-set this phone, but that's ok. I usually do that when there is a new version of android anyway.
 
Last edited:

dcarvil

Senior Member
Apr 20, 2016
331
112
43
I updated to android 11 using the built in updater and everything worked fine. I obviously lost magisk so today I tried tackling re-installing it. I patched the boot.img found in "blueline-rp1a.200720.009-factory-145e4cc4" and tried installing that; that got stuck on boot since I didn't use a canary build of Magisk Manager.
I tried fixing things by using "fastboot flash boot boot.img", but every time I reboot it eventually brings me back to Fastboot Mode with the reason "reboot bootloader". I see in my terminal I have flashed boot.img to both "boot_a" and "boot_b" so I am not sure what the issue is?

Any help would be appreciated. Need my phone for work and family =[

####

Checksums of boot.img are below...
md5 - 3d4d8854cbb2adb655dd5a091dfddcaf
sha256 - 48ad963af211403bf5079d2b62657cfb3b4b3031318049c432452ad62bf01a13

Production revision: blueline MP1.0(ROW)
Bootloader version: b1c1-0.2-5672671

---------- Post added at 03:44 PM ---------- Previous post was at 03:09 PM ----------

I ended up recovering using the steps in flash-all.sh. I didn't realize that would wipe my data... guess I'll need to re-set this phone, but that's ok. I usually do that when there is a new version of android anyway.
The current stable version (20.4) of Magisk does not work with Android 11. You must use Canary or wait for version 21, which should be released very soon.