• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

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

Search This thread

zedomax

Senior Member
Mar 23, 2010
1,219
2,870
Daly City, CA
HighOnAndroid.com
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.
 

shrtrnd

Member
Nov 2, 2018
9
1
Hey Mac users, I had to use the command fastboot flash boot_b magisk_patched.img
To get the patched image over to my phone. It worked out great. I was able to reboot,
and see the root in Magisk Manager.
YMMV

If I may ask, why is this only relevant for mac users? I didn't do this on windows and my phone won't boot up after flashing the patched img. Could this be the solution?
 
  • Like
Reactions: rickthecabbie

AndroidGX

Inactive Recognized Contributor
Jun 24, 2010
3,339
9,091
★ Montpellier ★
Theres nothing new in the steps described in this how-to. Those steps was known since many months ago, this is the classic and best way to flash root and keep the official updates warning from our Pixel phones.
I made a little ".bat" flashing script (for Windows) few months ago, I might share it if anybody is interested
 
  • Like
Reactions: RealDanyo

Nighthawk31

Member
Apr 15, 2018
8
4
Is anyone else trying to patch the boot.img and getting no response from the manager, I've updated everything, extracted a million times. I even extracted, transferred to a new phone, patched it on that phone and back. And I'm not gaining root.
 
Trust me, I've already made a bunch of mistakes.

If I may ask, why is this only relevant for mac users? I didn't do this on windows and my phone won't boot up after flashing the patched img. Could this be the solution?

Since I work with both Mac and Windows P.C. I like to let people know which machine I use to produce X results. Bottom line is that it is probably irrelevant but, "it's how I roll."

If I were you, I would give it a go but I would be sure to flash the active partition which your phone will indicate in bootloader mode.
Be sure to use your own patched image, I once used one that I did not create, and it screwed up my phone. Maybe they are all the same,
but I am not willing to chance it any more.
 

shinjizh

Member
Apr 2, 2018
8
0
HsinChu
I get very strange issue.
Follow the instruction, root is successful.

However, system starts to freeze and reboot after few minutes using.
In this condition, only root is active, but all apks not have root authorized.
After re-flash boot.img in factory image, phone is well as normal.

Even using newer magisk canary version or sideload full OTA, phone still freeze again after flash magisk patched boot.img.
Does anyone have similar experience before?
 

rob42ert

Member
Nov 14, 2016
21
3
Manchester
Last time i had root on my pixel 3xl i had to revert, because Google Pay wont work, magisk couldn't hide my root.
Is the issue on Android 10 still affecting GPay?
Looking forward to root again, only if gpay works.
 

sliding_billy

Senior Member
Apr 23, 2012
1,750
608
North Texas
Last time i had root on my pixel 3xl i had to revert, because Google Pay wont work, magisk couldn't hide my root.
Is the issue on Android 10 still affecting GPay?
Looking forward to root again, only if gpay works.

There is a lot of info in this thread https://forum.xda-developers.com/apps/magisk/magisk-google-pay-gms-17-1-22-pie-t3929950 as well as modules creates to automate the process, but to be honest the process is very simple. I have been using the OP method on a Pixel 3 and Pixel 3 XL since the day it was posted. No issues over the course of multiple monthly updates all done with flash-all (minus -w). The Pixel 3 I have updated to 10 in the same way (3 XL is on custom ROM so do update yet), and all is fine. Since nothing is written to anywhere that needs redone (like Magisk root or installed TWRP do) after update, it is not lost. I verify the database codes and R/O status of the db are intact after update just to be safe. There was word that folks had to spoof their fingerprint to Android 9 to get GPay working, but now that 10 is public that is no longer necessary. I just paid with the Pixel 3 a couple of hours ago.
 
  • Like
Reactions: rob42ert

rob42ert

Member
Nov 14, 2016
21
3
Manchester
There is a lot of info in this thread https://forum.xda-developers.com/apps/magisk/magisk-google-pay-gms-17-1-22-pie-t3929950 as well as modules creates to automate the process, but to be honest the process is very simple. I have been using the OP method on a Pixel 3 and Pixel 3 XL since the day it was posted. No issues over the course of multiple monthly updates all done with flash-all (minus -w). The Pixel 3 I have updated to 10 in the same way (3 XL is on custom ROM so do update yet), and all is fine. Since nothing is written to anywhere that needs redone (like Magisk root or installed TWRP do) after update, it is not lost. I verify the database codes and R/O status of the db are intact after update just to be safe. There was word that folks had to spoof their fingerprint to Android 9 to get GPay working, but now that 10 is public that is no longer necessary. I just paid with the Pixel 3 a couple of hours ago.
Ok, thanks. I will give it another try.
 
  • Like
Reactions: sliding_billy

rob42ert

Member
Nov 14, 2016
21
3
Manchester
There is a lot of info in this thread https://forum.xda-developers.com/apps/magisk/magisk-google-pay-gms-17-1-22-pie-t3929950 as well as modules creates to automate the process, but to be honest the process is very simple. I have been using the OP method on a Pixel 3 and Pixel 3 XL since the day it was posted. No issues over the course of multiple monthly updates all done with flash-all (minus -w). The Pixel 3 I have updated to 10 in the same way (3 XL is on custom ROM so do update yet), and all is fine. Since nothing is written to anywhere that needs redone (like Magisk root or installed TWRP do) after update, it is not lost. I verify the database codes and R/O status of the db are intact after update just to be safe. There was word that folks had to spoof their fingerprint to Android 9 to get GPay working, but now that 10 is public that is no longer necessary. I just paid with the Pixel 3 a couple of hours ago.

Sent you a PM. Still not working GPay
 

rob42ert

Member
Nov 14, 2016
21
3
Manchester
Still not working.

Steps I followed:

Bootloader unlock.

Then the step by step that @ibolito posted.

I have a patched the boot.img before a did the bootloader unlock, should I use that file to flash?
After I unlocked bootloader I extracted boot.img again then flashed and is not working. When I try to add existing cards from GPay it says that the phone is rooted bla bla bla :eek:
God I am fuming, I wiped my phone, now have to put everything back on, and GPay still not working.
 

sliding_billy

Senior Member
Apr 23, 2012
1,750
608
North Texas
Still not working.

Steps I followed:

Bootloader unlock.

Then the step by step that @ibolito posted.

I have a patched the boot.img before a did the bootloader unlock, should I use that file to flash?
After I unlocked bootloader I extracted boot.img again then flashed and is not working. When I try to add existing cards from GPay it says that the phone is rooted bla bla bla :eek:
God I am fuming, I wiped my phone, now have to put everything back on, and GPay still not working.

Reply sent to your PM.
 

eivissa

Senior Member
Dec 11, 2009
57
15
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 ?
 

shrtrnd

Member
Nov 2, 2018
9
1
Sounds exactly like my problem. :/
I also don't know how to get rid of everything magisk related when I don't have twrp and or root.
 
Last edited:

sdzbwxp

Senior Member
Aug 2, 2012
77
50
Victoria
maybe a silly question: Can I update Magisk through the APP using direct install after successfully patched and subsequently there is an update available?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    Here's how to root the Pixel 3 running on official and stock Android 10 release, step by step :

    (not tested on Pixel 3 XL but it might work the same, just use the right firmware for your device)

    What do you need :
    > Pixel 3 phone with Android 10
    > Unlocked bootloader on your Pixel device
    > Latest ADB and FASTBOOT tools on your computer


    1 ) Download the latest Android 10 factory image for your device ("Blueline" is the regular Pixel 3) :
    Link > Android 10 factory image

    2 ) Extract the "boot.img" file on your phone

    3 ) Download latest Magisk Manager application on your phone and install it :
    Link > https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

    4 )Press on the Install Magisk button (the one on the top, not the Magisk Manager), then Install > Select and Patch a File and now select the Boot.img file you extracted earlier. When the process is done, just put the patched boot.img file on your computer in the same folder as your ADB and FASTBOOT tools, the file's name is magisk_patched

    5 ) Enable adb debugging on your Pixel phone and connect it to your computer via USB.
    Open a command prompt on your computer and migrate to the folder where the ADB and Fastboot tools are located.
    (for exemple, for me it's : cd C:\\adb).

    7 ) Reboot your phone to fastboot by typing adb reboot bootloader

    8 ) Flash the Boot.img you just patched with magisk by typing fastboot flash boot magisk_patched.img

    9 ) When i'ts done, reboot by typing fastboot reboot

    10 ) Open your Magisk Manager app and chek if everything is good, and it should be ! You can now install Adaway after you enable Systemless root in the Magisk settings and rebooting your phone.

    Note that this guide is actually for using adaway. I don't know if it will work for any other root related feature on your phone.
    5
    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:
    4
    Back here! So.. I actually got impatient and tried my luck to save the extra step of reinstalling Magisk after update and rebooting. There is already too many threads opened for updating in android 10 so this slightly specific way too update will be left here for your eyes only. Here goes...

    Monthly update w/o losing root (for those ignored, like me, by OTA notifications):

    Requirements :
    - an already rooted device with Magisk Manager
    - magisk modules known for causing bootloops uninstalled (active edge for instance)
    - a plugged-in device on 'File transfer/Android Auto' and with USB debugging enabled
    - the latest and greatest adb/fastboot binaries, get them there : https://developer.android.com/studio/releases/platform-tools#downloads
    - a fresh backup of your system or a pair of eyes to cry if anything goes awry

    1- Download latest image file from https://developers.google.com/android/images
    2- Unzip the contents of the zip into your folder of choice (some might say the abd/fastboot folder though it works anywhere)
    3- Unzip the boot.img from the inner archive (for march 20 update: `image-blueline-qq2a.200305.002.zip`)
    4- Copy the boot image to your phone, then in Magisk Manager press Install > Install > Select and patch file > boot.img
    5- Once Magisk is done patching, get the resulting magisk_patched.img back to your updating folder. If you cannot find it use the following command: `adb pull /sdcard/Download/magisk_patched.img` (*)

    Interlude - Your folder should look like this:
    .
    ├── blueline-qq2a.200305.002-factory-d7814508
    │ └── blueline-qq2a.200305.002
    │ ├── boot.img
    │ ├── bootloader-blueline-b1c1-0.2-6085603.img
    │ ├── flash-all.bat
    │ ├── flash-all.sh
    │ ├── flash-base.sh
    │ ├── image-blueline-qq2a.200305.002.zip
    │ ├── magisk_patched.img
    │ └── radio-blueline-g845-00096-200114-b-6134206.img
    └─── blueline-qq2a.200305.002-factory-d7814508.zip

    Now back to the fun parts.

    6- Rename magisk_patched.img to boot.img. Delete the original one, it has served its purpose
    7- Update the inner archive boot.img to the patched one
    8- Open the flash-all.sh/flash-all.bat depending on your OS and remove the '-w' from the `fastboot -w update image-blueline-<your_latest_image>.zip` line. This is what wipes your phone clean, so make sure to save the file once modified.
    9- Double check requirements #2 and #3.
    10- Run the command: `adb reboot bootloader` (*)
    11- Run your modified flash-all script.

    Hopefully, you are done and your phone is up-to-date and still rooted.

    12- Reinstall your magisk modules, you missed them too much already.

    (*) If you get an error here, try running it from the adb/fastboot folder.
    3
    Just updated the 1st post and removed the part with Canary magisk because stable magisk is doing the job now.
    2
    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.