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

Toronadian

Senior Member
Apr 17, 2013
132
7
0
Does anyone here use Cerberus anti theft? Is anyone finding that Cerberus is asking Magisk for permissive a lot, like once an hour and also every time some one sends you a text? Or isn't as bad as before where it was constant but it wasn't like this. On Magisk 18.1 (much older version of Magisk from like March) and any prior versions, Cerberus would only ask for permission whenever necessary.
 

manzul

Member
Aug 3, 2015
5
1
3
Thx OP

Getting error in fastboot "Enter reason: error boot prepare". Not working for me, on the latest 10 firmware like you.

---------- Post added at 07:36 AM ---------- Previous post was at 07:29 AM ----------

My bad wrong boot.img...

---------- Post added at 08:05 AM ---------- Previous post was at 07:36 AM ----------

works fine thx OP!

---------- Post added at 08:43 AM ---------- Previous post was at 08:05 AM ----------

Thanks OP! I have just rooted my Pixel 3 XL using this method, works fine.
I rooted my device,flash magisk_patched.img with twrp
 

Exokan

Senior Member
Sep 15, 2016
67
13
0
I'm on platform-tools_r29.0.4-windows and MM canary 578a50b4
I'm getting the same bootloop issue. Any progress?

Update: Finally caved and did a full wipe. OP process works. Must have been some leftover user data (I heard somewhere that it may be related to the Titan M chip?). Also, this was down with the October Security patch 191005.007 Magisk 19.5-f87ee3fc & MM 7.3.4-f87ee3fc
 
Last edited:

Boombap142

New member
May 16, 2017
1
0
0
Viper4Android

I had it working before I bodged a magisk module install
Im currently using it and it works fine
Make sure to download audio modification library from magisk, and make sure to get SELinuxmodeChanger.


---------- Post added at 05:12 PM ---------- Previous post was at 05:02 PM ----------

Same exact problem here, anyone have any success after getting into this situation?
Theres no way you can run TWRP with rooting using this method
 

eivissa

Senior Member
Dec 11, 2009
57
15
0
Ibiza
I've followed the tutorial step by step, but after flashing the patched boot.img my P3 goes into bootloop. All I can do is flash firmware (without wipe) again to fix it. All updated until Android 10 worked flawlessnessly with restoring magisk modules and the lot. Not sure if it it edge sense module that, when flashing the patched Boot.img gets active and prevents the phone from booting up because it's not compatible with Android 10. Though I have no idea how to get rid of Magisk modules completely now that I can't boot into TWRP anymore and a downflash to Android 9 firmware doesn't work either. Stuck with Android 10 w/o root for now
Newest October Update + latest Magisk Canary finally did the trick! It booted straight up and let me uninstall the old Edge Sense Module within Magisk that prevented me from installing and booting Magisk for the last couple of weeks :)
 

TDuck691

Member
Apr 11, 2011
25
5
0
Thanks to everybody that contributes info here. I was able to get this working, but ended up having to patch boot.img twice for some reason that I'm not knowledgeable enough to guess at. Details below in hopes it helps somebody else.

My device: Pixel 3 on Google Fi
-took the OTA update to Android 10 last night with no issue (I believe I was still on the July update of Pie, fwiw). This put me at QP1A.190711.020.C3
-downloaded the QP1A.190711.020.C3 factory image to my PC
-downloaded the latest platform tools (29.0.4 at the time) to my PC and unzipped
-extracted boot.img from the factory image into my platform tools folder
-installed the latest Canary Magisk Manager to my phone. This put me at 7.3.4-dbc8bed2 (241)
-pushed boot.img to my phone
Code:
>adb push boot.img /sdcard/boot.img
boot.img: 1 file pushed. 34.1 MB/s (67108864 bytes in 1.874s)
-From Magisk Manager: Install [Magisk] > Install > Select and Patch a File > picked the just-pushed boot.img
-pulled the resulting patched img to my PC
Code:
>adb pull /sdcard/Download/magisk_patched.img magisk_patched.img
/sdcard/Download/magisk_patched.img: 1 file pulled. 3.6 MB/s (31600640 bytes in 8.481s)
-rebooted to fastboot, flashed img, and rebooted phone
Code:
>adb reboot bootloader
*wait for fastboot to come up*
>fastboot flash boot magisk_patched.img
Sending 'boot_a' (30860 KB)                        OKAY [  0.788s]
Writing 'boot_a'                                   OKAY [  0.175s]
Finished. Total time: 1.270s
>fastboot reboot
Rebooting                                          OKAY [  0.040s]
Finished. Total time: 0.059s
-At this point, MM said that Magisk was not installed. For a sanity check, opened Titanium Backup which confirmed that it could not get root permission.
-After poking around a bit, I decided to take a shot at simply retrying my steps. I deleted the patched img from my PC, then repatched the boot.img that was still on my phone with MM, pulled the new patched img to my PC, and flashed it in fastboot
Code:
>adb pull /sdcard/Download/magisk_patched.img magisk_patched.img
/sdcard/Download/magisk_patched.img: 1 file pulled. 4.3 MB/s (31612928 bytes in 6.989s)
>adb reboot bootloader
*wait for fastboot to come up*
>fastboot flash boot magisk_patched.img
Sending 'boot_a' (30872 KB)                        OKAY [  0.809s]
Writing 'boot_a'                                   OKAY [  0.472s]
Finished. Total time: 1.559s
>fastboot reboot
Rebooting                                          OKAY [  0.050s]
Finished. Total time: 0.050s
-I note that the patched img is slightly larger than my first attempt. Magisk Manager is now reporting that Magisk 19.5-dbc8bed2 (19406) is installed.
-Added Systemless Hosts in MM settings and rebooted. Confirmed that now Titanium Backup can gain root, and AdAway can install its hosts file.
-As an added bonus, I'm also now able to setup a card for in-store purchases with Google Pay for the first time, which I'd never been able to do with Pie rooted.
 

yutzybrian

Senior Member
Feb 21, 2009
191
10
18
Just did a clean install with the newest factory image tonight, QP1A.191005.007. Installed MM Canary (c42a51dc) and when I try to patch the boot.img, I get this: "Unsupported/Unknown image format". Has anyone been successful with this combo yet?

Edit: Disregard. Thought about it on the way to work and thought I might be using the wrong .img, sure enough I was.
 
Last edited:

laupuy

Senior Member
Jul 26, 2015
1,854
2,058
153
dans tes 22
I wish i found this before i wiped my phone.
If you are in a bootloop due to enabling an unsupported magisk module, take a look at this thread.
https://forum.xda-developers.com/pixel-3-xl/themes/magisk-modules-disabler-t3966867
hope it helps
Or use adb, since Magisk Canary b19309 is out:
"Allow removing modules without root in ADB shell by magisk --remove-modules. Useful when stuck in bootloop and have access to ADB (99% of the time)"

example: https://forum.xda-developers.com/showpost.php?p=80234438&postcount=35668
 

Attachments

BillyTheBull

Member
Mar 31, 2008
16
6
0
Denver, CO
I've been holding off on upgrading my Pixel 3 to Android 10, hoping to soon be able to do it with the stable version of Magisk. Everything in this thread is talking about Magisk v19.x ... but mine updated to v20 a few days ago. Is v20 possibly going to let me use the A/B OTA method, or will I lose root (or cause other/worse problems) by doing so?
 

mhrussell1

Senior Member
Oct 28, 2011
60
3
8
Anaheim
I've been holding off on upgrading my Pixel 3 to Android 10, hoping to soon be able to do it with the stable version of Magisk. Everything in this thread is talking about Magisk v19.x ... but mine updated to v20 a few days ago. Is v20 possibly going to let me use the A/B OTA method, or will I lose root (or cause other/worse problems) by doing so?
I am running latest factory build and Magisk v20. I used the Magisk Manager to create the magisk_boot.img. I have never done an OTA update so everything is still on partition A.
 

BillyTheBull

Member
Mar 31, 2008
16
6
0
Denver, CO
I've been holding off on upgrading my Pixel 3 to Android 10, hoping to soon be able to do it with the stable version of Magisk. Everything in this thread is talking about Magisk v19.x ... but mine updated to v20 a few days ago. Is v20 possibly going to let me use the A/B OTA method, or will I lose root (or cause other/worse problems) by doing so?
Answering my own question here ... but it might help someone else in the same situation:

I went ahead and tried it last night, and it worked perfectly, both for the update to Android 10 -- the first reboot took a looooong time, so be patient -- and the subsequent Oct security update! Super easy, with no canary build required, nor downloading/pushing image files, etc.. Obviously, you'll need to have an unlocked bootloader, stock recovery, and Magisk "system-lessly" installed already on Android 9 for this method to work. Then just follow the instructions by topjohnwu (which you can find here: https://topjohnwu.github.io/Magisk/tutorials.html#ota-installation). :good:
 

fronten

Member
Jan 20, 2013
35
5
0
Reading all the messages in here I am still unsure about rooting my Pixel 3 on Android 10.
I had Magisk & Xposed, but uninstalled it for the OTA firmware update.
I am now on unrooted Android 10 - how can I install Magisk for root access?
Can I?
 

Pete02

Senior Member
Dec 6, 2011
742
231
63
Reading all the messages in here I am still unsure about rooting my Pixel 3 on Android 10.
I had Magisk & Xposed, but uninstalled it for the OTA firmware update.
I am now on unrooted Android 10 - how can I install Magisk for root access?
Can I?
I did with my pixel 3. Follow the instructions in the op. Worked like a charm. ?
 

dcarvil

Senior Member
Apr 20, 2016
331
112
43
Reading all the messages in here I am still unsure about rooting my Pixel 3 on Android 10.
I had Magisk & Xposed, but uninstalled it for the OTA firmware update.
I am now on unrooted Android 10 - how can I install Magisk for root access?
Can I?
Follow the instructions in the OP. It requires an unlocked bootloader. It specifies Magisk Canary, but that is no longer necessary. Stable Magisk has been updated to version 20.0, which incorporates the changes needed for Android 10.


Make sure you use the latest platform tools from https://developer.android.com/studio/releases/platform-tools - earlier versions may not work.
 
Last edited: