• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

How To Guide [GUIDE] Root Pixel 6 Pro "raven" with Magisk

Search This thread

Az Biker

Sr. Mod / Mod & RC-RT Committees / Shred'r of MTBs
Staff member
i am a bit confused with this guide.
i want to flash factory image without having to wipe data.. do i need to edit flash all .bat file??
step 4 says apply update how do i do that?? just flash, flash all .bat file?
You edit the FLASH-ALL (bat) file with the editor on your PC.

Remove the -w and replace it with --disable-verity --disable-verification (leave one space before and after the new text), make sure you SAVE the newly edited FLASH-ALL file.

Then in fastboot type FLASH-ALL

Then follow step 5 of the instructions for patching the boot.img file in Magisk.
 

V0latyle

Forum Moderator
Staff member
i am a bit confused with this guide.
i want to flash factory image without having to wipe data.. do i need to edit flash all .bat file??
step 4 says apply update how do i do that?? just flash, flash all .bat file?
You can edit the flash all.bat, or you can use the command I provided in your fastboot command line.

You don't flash the batch file. The batch file is just a command script; if you want to use it, make sure you edit the commands.

If you prefer to type the commands manually, like I do, then type them exactly as I provided.

If this is confusing, I would recommend you use the Android Flash Tool.
 

Lw00d

Senior Member
May 18, 2009
793
104
LA Baby!!!
You can edit the flash all.bat, or you can use the command I provided in your fastboot command line.

You don't flash the batch file. The batch file is just a command script; if you want to use it, make sure you edit the commands.

If you prefer to type the commands manually, like I do, then type them exactly as I provided.

If this is confusing, I would recommend you use the Android Flash Tool.
will using your guide wipe the data? because flash all batch file was not edited?
 

bosox284

Senior Member
Mar 16, 2012
80
37
will using your guide wipe the data? because flash all batch file was not edited?
Only if you use the flash-all command. There are two methods using a factory image:
  1. Using flash-all.bat
  2. Using fastboot update
Using flash-all without removing the -w will wipe. Fastboot update will not wipe

@V0latyle - what's the significance of this step? I.e. why do you need to patch the boot image post-update
  1. Let the system boot before you patch the boot image.
  2. Patch the boot image and copy it back to your computer.
 
  • Like
Reactions: Lw00d

Az Biker

Sr. Mod / Mod & RC-RT Committees / Shred'r of MTBs
Staff member
Only if you use the flash-all command. There are two methods using a factory image:
  1. Using flash-all.bat
  2. Using fastboot update
Using flash-all without removing the -w will wipe. Fastboot update will not wipe

@V0latyle - what's the significance of this step? I.e. why do you need to patch the boot image post-update
Using Magisk to patch the boot.img is what allows you to keep root, after you've installed the factory image. Otherwise, flashing the stock boot.img would remove root.
 
  • Like
Reactions: roirraW "edor" ehT

bosox284

Senior Member
Mar 16, 2012
80
37
Using Magisk to patch the boot.img is what allows you to keep root, after you've installed the factory image. Otherwise, flashing the stock boot.img would remove root.
No I know that, but V0latyle bolded the patching after the update is completed. I'm trying to understand why patching it after you run fastboot update is of significance. What's the difference compared to if you patched the boot image before updating?
 

Az Biker

Sr. Mod / Mod & RC-RT Committees / Shred'r of MTBs
Staff member
No I know that, but V0latyle bolded the patching after the update is completed. I'm trying to understand why patching it after you run fastboot update is of significance. What's the difference compared to if you patched the boot image before updating?
The stock boot.img from the factory image you're updating to must already be installed for it to be compatible when you patch it with Magisk.

You couldn't patch .37 boot.img with Magisk that's currently on build .36...

The .37 build must already be installed in order for Magisk to patch a .37 boot.img.

At least that's how I understand the process.

Hope that answers your question 👍
 
  • Like
Reactions: Nergal di Cuthah

mac796

Senior Member
Aug 20, 2014
1,347
467
Long Beach
Thanks for the guide. I used the ota sideload method and I'm good to go. Had to clear data in play store a couple times but finally took.

Edit. I had to uninstall systemless hosts then I got play store back. Man I hope I can get my AdAway.

Ok edit 2 wasnt able to enable systemless hosts in magisk. Play store won't work for me. I had to install a different version from GitHub now I can run AdAway again. Anyone's else have this problem?
 
Last edited:

V0latyle

Forum Moderator
Staff member
No I know that, but V0latyle bolded the patching after the update is completed. I'm trying to understand why patching it after you run fastboot update is of significance. What's the difference compared to if you patched the boot image before updating?
Two reasons:
1. It's a good idea to let the system have a "clean boot" post update
2. It's best to patch the boot image AFTER updating to minimize compatibility issues; some users have experienced boot loops and/or root not working when trying to use a boot image they patched prior to the update



Side note: I understand a lot of folks are using mobile, so you may not be able to read my signature, but I would like to make something abundantly clear. People like me are here providing support on our own time, and very few of us like being messaged directly, nor do we provide any sort of private support.

If you are having trouble with something within the context of this thread, post your question here.

If you are having trouble with a different problem, post your own thread.

DO NOT directly message forum members with your questions; you're either going to get an unpleasant message in response, or you're going to get ignored completely.

@pa.pn2 this means you.
 

mac796

Senior Member
Aug 20, 2014
1,347
467
Long Beach
I'm having some trouble with play store since I updated tonight. I did the sideload method using the safety net module 2.2. It's saying I'm not connected. At first I cleared data in play store and it worked for a bit now it's back to no signal found. I thought it might be addaway but I uninstalled it. Anyone experience this? Also says I'm passing.

Edit. I had to uninstall systemless hosts in magisk. Find a different version so I could use AdAway. Play store wouldn't work otherwise.
 
Last edited:

Cares

Senior Member
Dec 2, 2010
1,523
278
Google Pixel 4 XL
Google Pixel 4a
The stock boot.img from the factory image you're updating to must already be installed for it to be compatible when you patch it with Magisk.

You couldn't patch .37 boot.img with Magisk that's currently on build .36...

The .37 build must already be installed in order for Magisk to patch a .37 boot.img.

At least that's how I understand the process.

Hope that answers your question 👍
That's not accurate. I patched .37 boot.img while on .36 so that I can flash factory image and magiskpatchedboot in 1 restart. No issues so far.
 

s3axel

Senior Member
In OP, 3 methods are listed to upgrade:
1) via OTA
2) via factory image
3) via Google flash tool

Is the result of these 3 methods the same? Why would you prefer one over the other?

My understanding is that all will render the same result, the need for just another tool in 3) makes me avoid this - I'd rather use ADB or fastboot.....

On a sidenote: When updating to .037 I tried 2), failed due to some errors and went ahead with 1).... so I am very glad that there were alternatives described ;)
 
  • Like
Reactions: foobar66

mko000

Senior Member
Jul 27, 2011
454
220
Google Nexus 4
Huawei Nexus 6P
the need for just another tool in 3) makes me avoid this
Just for clarification and because I didn't know at first either: The Android Flash Tool is actually just a website that can connect to your phone using a Chromium browser. So nothing to download or install. Except the platform-tools and drivers, you need those either way.
 
  • Like
Reactions: roirraW "edor" ehT

V0latyle

Forum Moderator
Staff member
In OP, 3 methods are listed to upgrade:
1) via OTA
2) via factory image
3) via Google flash tool

Is the result of these 3 methods the same? Why would you prefer one over the other?
OTA not recommended, because you either have to download the factory image anyway, or use a separate unpacker to extract the boot image AND vbmeta image from the OTA payload.

Factory image is a better option because you can perform the update and disable verity/verification in the same go - plus you don't have to mess with vbmeta.

Android Flash Tool is the best option for inexperienced users - you don't have to use any fastboot commands or mess with scripts; you just start your phone in bootloader mode, connect to the website, and use the GUI to flash the update. However, you'd still need to download the factory image so as to patch the boot image, at least the first time you root.

Just for clarification and because I didn't know at first either: The Android Flash Tool is actually just a website that can connect to your phone using a Chromium browser. So nothing to download or install. Except the platform-tools and drivers, you need those either way.
Correct. While it does dues temporary storage on your PC, everything is performed via web, so you don't have to download, install, or configure anything else.
 

Top Liked Posts

  • 5
    Magisk Canary updated to 23019
    Changes:
    - [Zygisk] Skip loading modules into the Magisk app to prevent conflicts
    - [MagiskBoot] Change `zopfli` to a more reasonable config so it doesn't take forever
    - [General] Several `BusyBox` changes

    Preferred method of update is from within Magisk app.


    If installing for the first time, here is the APK Download
    4
    Changelog for Stable 24 is up so just a matter of time before Stable is released.

    2
    Changelog for Stable 24 is up so just a matter of time before Stable is released.

    Good catch!
    1
    Changelog for Stable 24 is up so just a matter of time before Stable is released.

    nice! looking forward to finally updating my ancient pixel xl gen 1 magisk from v23 to v24.

    Why do I feel like I have seen that change log a day or few ago.
    3
    Magisk v24.0 has been released 😊
  • 6
    This may be some welcome news to some of you:

    Magisk Alpha now supports installing to the inactive slot on Pixel devices, which should simplify things for those of you who prefer to update via OTA.

    This is Alpha software, use at your own risk! It will probably break some things! The last commit failed to build, but I am sure it'll be fixed soon.

    Github download page
    5
    I'm old without as much fashion! 😁
    I don't know....that new purple looks pretty fashionable on you 😅👍
    5
    Tried rebooting again? Since I haven't messed with Outlook in many years, no idea if it's normal for it to detect despite everything else. Might be detecting the unlocked bootloader or OEM unlocking toggle enabled, which as far as I know, there's no way to hide either.
    I figured it out... There are lots of dependant apps for my corporate email and though I had them all hidden, I didn't realize that checking the box didn't fully hide all parts of each app. So after expanding Outlook, Company Portal, etc. And ensuring everything was hidden, rebooted and it now works!
    5
    Do you guys have a donation link?
    For my part, I too help folks for free. I used to take donations, but I also needed the money more at the time. I don't even remember if I ever officially removed the way to donate to me from XDA. I haven't bothered to check for the way I had set to donate to me in XDA's settings since they changed their software the other year. I wasn't very active for several years until recently as well. I'm just always glad when I can help someone.

    I have pretty low expectations these days, too. I'm happy just when there's no drama going on, especially if it's not drama coming from me! 🤣

    Thanks very much for this info. I was not planning to use the Pixel 5 version unless it was known to be safe. I will wait for a Pixel 6 version to be released. I have other ways to back up apps and data but want to be able to have a system partition, etc., backup as well. Thanks for the come-back!
    For what it's worth, TWRP for one phone 99.99999% of the time will not work on any other phone, but especially not different years' phones from the same manufacturer, and on top of that, the Pixel 6/Pro uses a completely different CPU than the Pixel 5 and previous. I'm sure there were exceptions, and I even have some ideas of what they were, but they were a drop of rain in the sea, relatively speaking. Besides all this, TWRP has to be gotten to work on Android 12 in general - for any phone - first. If/when that is done (could be months, could be a year, could be never), then work getting TWRP to work on the P6 & P6P could start in earnest. So it's a long road... :D

    There's times I want to show people just how lucky they are I put up with them
    🥂 😂
    5
    For those of you interested, looks like enabling installation to the inactive slot on Pixel devices during OTAs has been merged. Think that was the final piece needed (after the bootctl update was added earlier). Looks like it will be in the next Canary.

    @V0latyle

    Screenshot 2022-01-18 081730.png
  • 69
    If you are looking for my guide on a different Pixel, find it here:
    Update 1-26-22: Magisk Beta 24.0 incorporates all previous fixes from Canary.
    Discussion thread for migration to 24.0.

    DO NOT substitute Magisk Stable 23.0 as it does not yet incorporate the necessary fixes for Android 12 and your device.


    WARNING: YOU AND YOU ALONE ARE RESPONSIBLE FOR ANYTHING THAT HAPPENS TO YOUR DEVICE. THIS GUIDE IS WRITTEN WITH THE EXPRESS ASSUMPTION THAT YOU ARE FAMILIAR WITH ADB, MAGISK, ANDROID, AND ROOT. IT IS YOUR RESPONSIBILITY TO ENSURE YOU KNOW WHAT YOU ARE DOING.

    Prerequisites:

    As many of you know by now, in order to run a patched boot image on Android 12 requires disabling Android Verified Boot.

    Verified Boot on Android 12 devices, at least Pixels with the SD765G and Tensor, is tied to device encryption. Therefore, disabling Verified Boot requires a wipe, if it was not previously disabled.

    To make this clear:
    Verified Boot is disabled by flashing /vbmeta with disable flags:
    Code:
    fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
    Verified Boot is enabled by flashing /vbmeta without flags:
    Code:
    fastboot flash vbmeta vbmeta.img

    Booting the device essentially "locks" the vbmeta state.

    I know this is confusing, Bear with me:

    If you previously disabled vbmeta, you MUST ensure it is disabled again when you update, BEFORE you boot. If you do not, you will have to wipe to regain root.

    Unfortunately, the update process enables Verified Boot by default, because it writes /vbmeta without flags.

    This means that the automatic OTA, or any other update process without intervention, WILL enable Verified Boot, which will require a wipe to disable!


    ****

    Android Source - Setting up a device for development


    1. Follow these instructions to enable Developer Options and USB Debugging.
    2. Enable OEM Unlocking. If this option is grayed out, unlocking the bootloader is not possible.
    3. Connect your device to your PC, and open a command window in your Platform Tools folder.
    4. Ensure ADB sees your device:
      Code:
      adb devices
      If you don't see a device, make sure USB Debugging is enabled, reconnect the USB cable, or try a different USB cable.
      If you see "unauthorized", you need to authorize the connection on your device.
      If you see the device without "unauthorized", you're good to go.
    5. Reboot to bootloader:
      Code:
      adb reboot bootloader
    6. Unlock bootloader: THIS WILL WIPE YOUR DEVICE!
      Code:
      fastboot flashing unlock
      Select Continue on the device screen.

    1. Install Magisk on your device.
    2. Download the factory zip for your build.
    3. Inside the factory zip is the update zip: "device-image-buildnumber.zip". Open this, and extract boot.img
    4. Copy boot.img to your device.
    5. Patch boot.img with Magisk: "Install" > "Select and Patch a File"
    6. Copy the patched image back to your PC. It will be named "magisk_patched-23xxx_xxxxx.img". Rename this to "master root.img" and retain it for future updates.
    7. Reboot your device to bootloader.
    8. Flash the patched image:
      Code:
      fastboot flash boot <drag and drop master root.img here>
    9. Reboot to Android. Open Magisk to confirm root - under Magisk at the top, you should see "Installed: <Magisk build number>

    1. Take the OTA update when prompted. To check for updates manually, go to Settings > System > System Update > Check for Update
    2. Allow the update to complete. Your device will reboot without root as the OTA overwrites the patched boot image.
    3. Reboot your device to bootloader.
    4. Boot the master root image
      Code:
      fastboot boot <drag and drop master root.img here>
      Note: If you prefer, you can download the factory zip and manually patch the new boot image. Do not flash an older boot image after updating.
    5. Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
    6. Reboot your device. You should now be updated with root.

    1. Download the OTA.
    2. Reboot to recovery and sideload the OTA:
      Code:
      adb reboot sideload
      Once in recovery:
      Code:
      adb sideload ota.zip
    3. When the OTA completes, you will be in recovery mode. Select "Reboot to system now".
    4. Allow system to boot and wait for the update to complete. You must let the system do this before proceeding.
    5. Reboot to bootloader.
    6. Boot the master root image (See note 1):
      Code:
      fastboot boot <drag and drop master root.img here>
      Note: If you prefer, you can download the factory zip and manually patch the new boot image. Do not flash an older boot image after updating.
    7. Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
    8. Reboot your device. You should now be updated with root.

    Please note that the factory update process expects an updated bootloader and radio. If these are not up to date, the update will fail.
    1. Download the factory zip and extract the contents.
    2. Reboot to bootloader.
    3. Compare bootloader versions between phone screen and bootloader.img build number
      Code:
      fastboot flash bootloader <drag and drop new bootloader.img here>
      If bootloader is updated, reboot to bootloader.
    4. Compare baseband versions between phone screen and radio.img build number
      Code:
      fastboot flash radio <drag and drop radio.img here>
      If radio is updated, reboot to bootloader.
    5. Apply update:
      Code:
      fastboot update --skip-reboot image-codename-buildnumber.zip
      When the update completes, the device will be in fastbootd. Reboot to bootloader.
    6. Boot the master root image (See note 1):
      Code:
      fastboot boot <drag and drop master root.img here>
      Note: If you prefer, you can download the factory zip and manually patch the new boot image. Do not flash an older boot image after updating.
    7. Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
    8. Reboot your device. You should now be updated with root.

    1. Follow the instructions on the Android Flash Tool to update your device. Check the "Skip reboot" box.
    2. When the update completes, the device will be in fastbootd. Reboot to bootloader.
    3. Boot the master root image (See note 1):
      Code:
      fastboot boot <drag and drop master root.img here>
      Note: If you prefer, you can download the factory zip and manually patch the new boot image. Do not flash an older boot image after updating.
    4. Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
    5. Reboot your device. You should now be updated with root.

    This is my configuration that is passing Safety Net. I will not provide instructions on how to accomplish this. Attempt at your own risk.

    Zygisk + DenyList enabled
    All subcomponents of these apps hidden under DenyList:
    • Google Play Store
    • GPay
    • Any banking/financial apps
    • Any DRM media apps
    Modules:
    To check SafetyNet status:
    I do not provide support for Magisk or modules. If you need help with Magisk, here is the Magisk General Support thread.

    Points of note:
    • The boot image is NOT the bootloader image. Do not confuse the two - YOU are expected to know the difference. Flashing the wrong image to bootloader could brick your device.
    • While the Magisk app is used for patching the boot image, the app and the patch are separate. This is what you should see in Magisk for functioning root:
      screenshot_20211218-194517-png.5486339
    • "Installed" shows the version of patch in the boot image. If this says N/A, you do not have root access - the boot image is not patched, or you have a problem with Magisk.
    • "App" simply shows the version of the app itself.
    • If you do not have a patched master boot image, you will need to download the factory zip if you haven't already, extract the system update inside it, then patch boot.img.
    • If you prefer updating with the factory image, you can also extract and manually patch the boot image if desired.


    Credits:
    Thanks to @ipdev , @kdrag0n , @Didgeridoohan , and last but not least, @topjohnwu for all their hard work![/SPOILER]
    8
    My update process is to remove vbmeta.img (in addition to removing the -w flag in the flash-all script) from the factory zip before I flash it in fastboot. Seems to have worked so far, ymmv.
    6
    This may be some welcome news to some of you:

    Magisk Alpha now supports installing to the inactive slot on Pixel devices, which should simplify things for those of you who prefer to update via OTA.

    This is Alpha software, use at your own risk! It will probably break some things! The last commit failed to build, but I am sure it'll be fixed soon.

    Github download page
    6
    Now THIS is a useful thread! Thanks 👍

    I might try to root my P6P this week-end.

    If I already took the OTA from Google, can I just go to #6? (there's no data on my phone yet, just BL unlocked)

    "6. Reflash vbmeta to disable boot verification"
    6
    Idk about that might work but would mess something else up...i remember this issue happening a couple of updates in the past and magisk was the issue and needed an update. So i would suggest dont flash Dec build to keep root lol factory reset(which might work) or just wait for an update to Magisk. Should be out later today if anything hopefully...if they made the dev aware
    I left topjohnwu a note on twitter, hopefully he'll take a look into it rather soon