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

[Guide] Root Pixel 5 Android 12 with Magisk

Search This thread

V0latyle

Forum Moderator
Staff member
I believe @Regys is asking questions on your thread and mine see post #398 above. :)
I did answer his question in my thread.

Given that @Regys is still on Android 11, I'm wondering if he's willing to test an idea I have to see if it may be possible to upgrade and disable vbmeta without wiping.

@Regys , either guide will work. If you want the easiest and least confusing way to do this, I would recommend using the Android Flash Tool instructions in my guide, as it's almost impossible to get wrong.
 
  • Like
Reactions: Homeboy76

mcwups1

Senior Member
May 4, 2011
2,463
479
Google Pixel 6 Pro
Okay, I transferred from the 5a to the Pixel 6 Pro. I want/have to give this phone to my daughter. If I just Factory Reset, how messed up will the phone be? Do I have to disassociate Magisk from apps permission was given? Does it reset all steps taken to give root access?

Thank you.
 

andybones

Forum Moderator
Staff member
May 18, 2010
14,777
15,069
Google Pixel 5
Okay, I transferred from the 5a to the Pixel 6 Pro. I want/have to give this phone to my daughter. If I just Factory Reset, how messed up will the phone be? Do I have to disassociate Magisk from apps permission was given? Does it reset all steps taken to give root access?

Thank you.
If willing to Factory reset, then the best way to give it to her fresh, like-new is to download either the most recent, depending what you want, either A12, or last A11 Factory Image from Google, which will remove all apps, and set up how it would come new.
I would then re-lock the bootloader.
 
  • Like
Reactions: Homeboy76

badabing2003

Senior Member
Sep 17, 2012
362
96
You can use the instructions in this guide for the Google Pixel 6. The only requirement is you must use the files for the Google Pixel 6 i.e., the factory image you must use is "oriole" for Pixel 6.
Thanks @Homeboy76
Much appreciate your quick response and the excellent guide.
This guide for me being the gold standard, I wanted to check with you first before hunting down other guides.
It could help others to mention that this guide would also be applicable to Pixel 6 series with the correct factory images.

Speaking of which, do you know the difference between these two images?
1638211658473.png


I just got a brand new Pixel 6, and before I copy my data, I want to follow the rooting, currently on the phone `.036` image is on, and was wondering if 037 should be applied or not.

Thanks
BB
 

Homeboy76

Senior Member
Aug 24, 2012
2,863
1,482
Google Pixel XL
Thanks @Homeboy76
Much appreciate your quick response and the excellent guide.
This guide for me being the gold standard, I wanted to check with you first before hunting down other guides.
It could help others to mention that this guide would also be applicable to Pixel 6 series with the correct factory images.

Speaking of which, do you know the difference between these two images?
View attachment 5470837

I just got a brand new Pixel 6, and before I copy my data, I want to follow the rooting, currently on the phone `.036` image is on, and was wondering if 037 should be applied or not.

Thanks
BB
Go to the OP => Prerequisites, => Tap Factory Image => Tap the Which one should I use? Link.
 

badabing2003

Senior Member
Sep 17, 2012
362
96
Go to the OP => Prerequisites, => Tap Factory Image => Tap the Which one should I use? Link.
Sorry, I don't want to be disrespectful, that does not answer my question regarding the differences between 036 and 037
They are identical in all aspects except the very last digit, and no indication of different providers.
In fact Which one should I use link has zero mention of 037

FYI, my system had 036, and I installed 037.
 

Homeboy76

Senior Member
Aug 24, 2012
2,863
1,482
Google Pixel XL
Sorry, I don't want to be disrespectful, that does not answer my question regarding the differences between 036 and 037
They are identical in all aspects except the very last digit, and no indication of different providers.
In fact Which one should I use link has zero mention of 037

FYI, my system had 036, and I installed 037.
You are correct it does not answer your question.

No. I do not know the specific differences between factory image 036 and 037.

Yes. The factory image 037 should be applied it is the Global update for 036.
 
  • Like
Reactions: badabing2003

badabing2003

Senior Member
Sep 17, 2012
362
96
Thanks @Homeboy76
Root, SafetyNet all working very nicely.
Two quick questions re magisk.
1- I no longer see mention of hiding Magisk, is that no longer necessary / recommended?
2- Bank apps and similar, previously were in hide list, do they now go to deny list?
 

Homeboy76

Senior Member
Aug 24, 2012
2,863
1,482
Google Pixel XL
Thanks @Homeboy76
Root, SafetyNet all working very nicely.
Two quick questions re magisk.
1- I no longer see mention of hiding Magisk, is that no longer necessary / recommended?
2- Bank apps and similar, previously were in hide list, do they now go to deny list?
I, recently, updated the OP (7. Root/Reroot with Magisk and Pass SafetyNet, Pass Safety Net with SafetyNet Fix 2.2.0)

1. It is no longer necessary/recomended when using Magisk Canary 23015.
2. Yes, Bank apps and other apps you want to hide are added to the Configure DenyList: OP, 7., Pass Safety Net with SafetyNet Fix 2.2.0, 3. Settings for Magisk Canary 23015, • Tap Configure DenyList...
 
Last edited:
  • Like
Reactions: badabing2003

badabing2003

Senior Member
Sep 17, 2012
362
96
With the latest canary magisk, I don't see any online modules.
Is that because of zygisk? or something is wrong with my setup?

Thanks
BB
 

Homeboy76

Senior Member
Aug 24, 2012
2,863
1,482
Google Pixel XL
With the latest canary magisk, I don't see any online modules.
Is that because of zygisk? or something is wrong with my setup?

Thanks
BB
Maybe, all I know is topjohnwu removed the modules from Magisk Canary 2301x.
Take a look at the OP, NEW 1.

<Edit> The link in @andybones (Staff Members)
post (below - #416) was added to the OP: #7, Pass Safety Net with SafetyNet Fix 2.2.0, 1. Download files. :)
 
Last edited:
  • Like
Reactions: badabing2003

V0latyle

Forum Moderator
Staff member
  • Like
Reactions: thekwijibo

Top Liked Posts

  • 1
    Ok, that's fine. But here is what I am struggling to understand that the guide is not clear on:
    1) When I want to simply update my phone, what is the difference between a factory update/OTA update?
    2) If I do the OTA update, can I download it directly onto the phone and run it on the phone, or does it need to be on the computer?
    3) Once the OTA update is applied, do I then proceed with patching the boot image and editing the flash-all.bat file?

    Ty
    If you do the OTA update, you can download it directly onto the phone and run it on the phone.

    Once the OTA update is applied, you then proceed with patching the boot image if you want to root your phone.

    Notes:
    - The boot.img you need to patch is in the Factory image file.
    - Use Magisk- Canary to patch it.
  • 6
    :) I hope you all have a Joyful Holiday season with your family and loves ones. :)

    ~ ~ ~ Stay safe ~ ~ ~
    3
    Between keep data or wipe data which option allows us to retain root when the new update comes?

    please advice
    Neither, please note the last comment of the Keep data and the Wipe data are the same:
    • Go-to Root/Reroot with Magisk and Pass SafetyNet, •Patching the boot.img - to root/reroot.

    Do Keep data to update the factory image. Then flash the magisk_patched...img, if you want to root/re-root your phone. It only takes a few seconds to flash the magisk_patched...img).
    fastboot flash boot magisk_patched...img
    2
    Is this compatible with Pixel 5 GTT9Q?
    Please confirm
    As long as your bootloader can be unlocked then it doesn't matter which model number you have
    2
    Thanks for your reply!

    Yes, I know that the boot command only temporarily boots the patches boot.Img.

    However,both commands (either flash or boot) does result in a boot loop.
    Did you dirty flash Android 12, removed the -w from the flash-all.bat file?

    Did you have Magisk installed with Android 11?

    Were you on the Android 11 Stock Factory image or a Custom ROM before you upgraded to Android 12?

    Did you disable/remove the Magisk Modules and unhide Magisk if you hid it before you upgraded to Android 12?

    Assuming your bootloader is unlocked and you are using the correct version of SDK Platform-tools r. 31.0.3 and Magisk Canary 23016 is, currently, installed?

    Try:
    - Boot Safe mode, when it is fully booted Reboot
    - Delete all magisk_patched.img
    - repatch the boot.img for your Factory image
    - flash the new repatched magisk_patched.img

    If it doesn't work without bootlooping. I Suggest you flash the January 2022 factory image with the -w (Wipe) and start fresh.
    1
    Ok, that's fine. But here is what I am struggling to understand that the guide is not clear on:
    1) When I want to simply update my phone, what is the difference between a factory update/OTA update?
    2) If I do the OTA update, can I download it directly onto the phone and run it on the phone, or does it need to be on the computer?
    3) Once the OTA update is applied, do I then proceed with patching the boot image and editing the flash-all.bat file?

    Ty
    If you do the OTA update, you can download it directly onto the phone and run it on the phone.

    Once the OTA update is applied, you then proceed with patching the boot image if you want to root your phone.

    Notes:
    - The boot.img you need to patch is in the Factory image file.
    - Use Magisk- Canary to patch it.
  • 32
    [Guide] Root Pixel 5 Android 12 with Magisk + Unlock/Lock Bootloader + More
    Android Security Bulletin—January 2022
    Pixel Update Bulletin—January 2022

    Introduction
    This Guide is for Pixel 5 owners that want to Root their phone, and enjoy the benefits of rooting it without installing a Custom ROM. However, for those that just can't live without a Custom ROM, take a look at 'Custom ROMs for Pixel 5'.

    NEW

    1. Understand 5G network...
    2. With the Magisk Canary update to 23016, there is no longer a need to wipe or --disable verity -- disable verification
    3. Magisk Alpha (vvb2060)
    4. The differences between the different variants of Magisk
    5. Magisk Modules for Magisk Alpha/Canary


    Update(s)

    1. Factory/OTA Images - 04Jan
    2. Magisk Stable - Magisk-23.0 12May
    3. Magisk Beta - Magisk-23.0 12May
    4. Magisk Canary - Magisk-23016 15Dec
    5. TWRP - Waiting for T.R.W.P. for Android 12
    6. SafetyNet - SafetyNetFix v2.1.3 (Riru) v2.2.1 (Zygisk) 22Dec
    7. SDK Platform-tools - r31.0.3 18Aug
    8. Custom Kernels[/INDENT]

    9. Custom ROMs
      a. ProtonAOSP[12] 01Nov


    Disclaimer

    1. I assume no responsibility for the malfunctioning/bricking of your phone.
    2. The order of listed items i.e., Custom Kernels, Custom ROMS, etc. Does not indicate my preference for them. It is your responsibility to do the research before selecting an item.

    Prerequisites

    1. A Pixel 5 phone with an unlocked bootloader.
    2. The latest Android 12 Factory or OTA Image: "redfin" for Pixel 5

      Factory Image

      OTA Image
    3. A Computer with the latest SDK Platform-Tools: r31.0.3 installed.
    4. Important Notes:
      a. Update Platform Tools, regularly, for optimal performance.​


    My Other Guides

    Credits/Thanks/Recognitions

    1. @creezalird- Flash Android 12 factory image.
    2. Those I may have, inadvertently, forgotten.

    ~ ~ ~ INSTRUCTIONS ~ ~ ~

    Unlock Bootloader/Return Phone to Stock/Lock Bootloader

    • Unlock Bootloader

      1. This will erase all user data from the device!
      2. Backup your data
      3. Activate Developer Options: Tap Settings > About Phone > Tap Build Number 7 times or until you see you are a Developer. Tap back > System > Advanced > Developer Options. Enable OEM Unlock and, USB Debugging.
      4. Boot fastboot mode
      5. Connect the phone to the Computer with USB cord.
      6. Open a Command Prompt on your computer and type fastboot flashing unlock and press enter.
      7. You should see a request for confirmation on your phone, use the volume keys to scroll and the power key to select.
      8. Allow the process to complete and then type fastboot reboot at the Command Prompt and press enter.
      9. When your phone reboots disconnect your usb cable.
        Notes: After unlocking your bootloader, you'll see a warning: The bootloader is unlocked and... You will see this warning until, you relock the bootloader.
        Do not relock your bootloader until you have returned the device to Stock.
    • Return Phone to Stock

      1. Backup your data/Internal storage
      2. Settings > System > Advanced > Reset Options > Erase all data (factory reset)
      3. Log in
      4. Set up phone
    • Lock Bootloader

      1. Return the phone to Stock before locking the bootloader, failure to do so could brick your phone
      2. This will erase all user data from the device!
      3. Boot fastboot mode
      4. Open a Command Prompt and type this at the Prompt: fastboot flashing lock
      5. You should see a request for confirmation on your phone, use the volume keys to scroll and the power key to select.
      6. Allow the process to complete, then type this at the Command Prompt: fastboot reboot
      7. Enable Developer Options: Settings > About phone > Tap Build number 7 times or until you see 'you are a developer'.
      8. Tap Back > Developer options and toggle OEM Unlock off.

    Install/Update Factory Image keep data or wipe data

    • Important Note(s):
      1. Install Magisk Canary 23016
        Note: Tap 3 dot menu across from canary => Download, app-debug.apk
      2. Always verify you have the latest version of SDK Platform-Tools installed on your computer before installing the Factory Image: Pixel 5 - redfin.
      3. If you get an error: while flashing, try one of these options:
        • Change the USB port to a non charging USB port.
        • Change the USB cord.
        • Change Computers.
      4. Backup your data
      5. Download the latest Factory Image: Pixel 5 - redfin to your Computer.
      6. Extract the factory Image to a folder.
    • Flash Factory Image Keep Data

      • Open the folder you extracted the Factory Image to and Edit the flash-all.bat file with a file editor i.e., DroidEdit app.
        1. Change this line: fastboot -w update image-redfin-aa9a.999999.999.zip
        2. to this: fastboot update image-redfin-sp1a.999999.999.zip
        3. Note: If you do not remove the -w your internal storage will be wiped.
      • After, you have edited the flash-all.bat file. Copy/Move these files to the Platform-tools folder:
        1. bootloader-redfin-....img
        2. flash-all.bat
        3. image-redfin-....zip
        4. radio-redfin-....img
      • Open a Command Prompt on your computer in the Platform-tools folder and type: flash-all at the Command Prompt and press enter.
      • The phone will reboot when flashing is completed.
      • Go-to Root/Reroot with Magisk and Pass SafetyNet, • Patching the boot.img - to root/reroot.
    • Flash Factory Image Wipe Data

      • This will wipe your phone's Internal Storage.
      • Open the folder you extracted the Factory Image to and Copy/Move these files to the Platform-tools folder:
        1. bootloader-redfin-....img
        2. flash-all.bat
        3. image-redfin-....zip
        4. radio-redfin-....img
      • Open a Command Prompt on your computer in the Platform-tools folder and type: flash-all at the Command Prompt and press enter.
      • The phone will reboot when flashing is complete.
      • Setup phone
      • Enable Developer Mode and USB Debugging
        1. Setup => About phone => Tap Build number 7 times or untill you see you are a 'Devloper'.
        2. Setup => System => Developer options => Enable Developer options => enable USB Debugging
      • Go-to Root/Reroot with Magisk and Pass SafetyNet, • Patching the boot.img - to root/reroot.

    Root/Reroot with Magisk and Pass SafetyNet.

    • Android 12

      • Upgrade to Android 12: OP, INSTRUCTIONS, Install/Update Factory Image keep data or wipe data, Keep data
    • Patching the boot.img - to root/reroot.

      1. Do #6 - Extract boot.img
      2. Install Magisk Canary
        Note: Tap 3 dot menu across from canary => Tap Go to file => Download, app-debug.apk
      3. Open Magisk Canary App
      4. Set the Update Channel Canary.
      5. Tap Install (next to Magisk)
      6. Tap, Select and Patch a File
      7. Select the boot.img file you extracted from the latest factory image.
      8. Tap the ✓ (Check Mark)
      9. Tap Let's Go
      10. When you see done, the boot.img has been patched (magisk_patched_xxxxxx.img), and stored in the download folder.
      11. Reboot
      12. Copy the patched boot.img file to your computer's Platform-tools folder or the folder that has fastboot.exe in it.
      13. Boot fastboot mode
      14. Connect the phone to the Computer with USB cord.
      15. Open a Command Prompt in the folder you copied the patched boot.img to.
      16. Type fastboot flash boot "name of patched boot".img without the quote marks at the Prompt and press enter.
      17. Type fastboot reboot at the Prompt and press enter.
      18. Important Notes: If your phone boot loops try one of the following options:
        • Flash the 'stock' boot.img to both slots: fastboot flash boot boot.img --slot all
        • Boot Safe Mode - Press Power Off button ==> Press Power Off until you see boot Safe Mode ==> Press Ok.
    • Pass Safety Net with SafetyNet Fix 2.2.1

      1. Download File(s)
      2. Install SafetyNet Fix 2.2.1
        • Open Magisk
        • Tap Modules icon
        • Tap Install from storage
        • Navigate to the SafetyNetFix file you downloaded
        • Tap the SafetyNetFix file
        • Tap the check mark (✓ at the bottom) to start the installation.
        • After it installs tap the Save icon to save the log
        • Tap Reboot.
      3. Settings for Magisk Canary
        • Open Magisk App
        • Tap the Setup icon.
        • Scroll down to App and set the Update Channel to Canary.
        • Scroll down to Check Updates and enable it.
        • Scroll down to Magisk and enable Zygisk and Enforce DenyList.
        • Tap Configure DenyList => Tap 3 Dot Menu => Check ✓ Show system apps => Check ✓ Google Play Store, Google Pay, etc.
        • Scroll down to Superuser and enable Enable Biometric Authentication.
      4. Get Device Certified Clear Google Play Services, Google Play Store, Google Pay, etc. data
        • Turn Airplane mode on
        • Open Settings
        • Tap Apps & notifications
        • Tap see all...
        • Tap three dot menu
        • Tap Show system
        • Scroll down to Google Play Store
        • Tap Storage and Cache
        • Tap Clear storage
          Note: Repeat the 3 steps above for Google Play Services, Google Pay, etc.
        • reboot
        • Turn Airplane mode off
      5. Check Device Certification
        • Open Google Play Store app
        • Tap Menu - Circle top right
        • Tap Settings
        • Tap About
        • Check Play protect certification.

    Open a Command Prompt/Boot Fastboot Mode/Boot Recovery

    • Open a Command Prompt on Computer
      1. Open File Explorer, click the platform-tools folder ==> click the folder icon (left side of address bar) to highlight it type cmd and press enter.
      2. Open a Powershell Command Prompt on Computer: Open File Explorer, click the platform-tools folder ==> click the folder icon (left side of address bar) to highlight it type powershell and press enter.
      3. Notes:
        • Enable USB Debugging, on your phone: Settings ==> System ==> Advanced ==> Developer options ==> Scroll down to USB debugging and enable it.
        • When using the Powershell Command Prompt Commands must be preceeded with ./: i.e, ./fastboot devices
        • If you do not want to open a Command Prompt every time you want to use the fastboot command, add the path to the Platform-tools folder to Windows environment variables.
    • Boot fastboot mode (bootloader):
      • Power off phone, press and hold the power and volume down buttons until you see Start.
    • Boot Recovery
      • Power off phone, press and hold the power and volume down buttons until you see Start. Use volume up/down button until you see Recovery mode. Press power button.

    Test fastboot

    • Enable Developer Options - Tap Settings > About phone > Build number 7 times or until you should see 'you are a Developer'.
    • Enable USB Debugging - Tap Settings > System > Advanced > Developer options >
      Enable USB Debugging.
    • Open a Command Prompt on your computer in the Platform-tools folder.
    • Boot fastboot mode on your phone
    • Connect the phone to the Computer.
    • At the prompt type: fastboot devices to verify communication with phone. It should return your phone's serial number.

    ADB Sideload


    Extract/Flash boot.img

    • Extract boot.img

      1. Download the latest Factory image to your phone.
      2. Extract the Factory Image file (redfin-spa1.999999.999-factory-99a9a99a.zip) to a folder.
      3. Open the folder and, extract the Image file (image-redfin-spa1.999999.999.zip) into the folder.
      4. Copy the boot.img file to the computer's Platform-tools folder.
    • Flash boot.img

      1. Flashing the boot.img removes root.
      2. Open the folder you extracted the 'image...zip' file to and copy the boot.img file to your computer's platform-tools folder or to the folder that has fastboot.exe in it.
      3. Boot fastboot mode
      4. Connect the phone to the Computer
      5. Open a Command Prompt and type the following command at the prompt:
        fastboot flash boot --slot all boot.img
      6. Reboot

    Set Magisk App Update Channel/Update Magisk

    • Set Magisk App Update Channel

      • Open Magisk App > Tap Settings icon > Update Channel > Select Stable, Beta, Canary or Custom.
    • Update Magisk

      1. When Magisk App notifies you of an update:
      2. Tap install.
      3. Select, Direct Install (Recommended)
      4. When it finishes installing
      5. Tap, Save Log
      6. Log location: /storage/emulated/0/Download
      7. Tap, Reboot
      8. Done!

    Custom ROMs

    • Need help with a Custom ROM?
      • First, read and follow the Installation Instructions. The installation instructions are in the OP.
      • Second, if you have a problem Installing it, Search the thread of the Custom ROM you are trying to install for a solution to problem: If you don't find a solution post your request for help on the thread.
    • ROMs
      1. Alpha/Beta

        • None
      2. Official
      3. Unofficial

        • None

    Apps/Mods/Scripts/Tethering/Themes

    T.W.R.P. Backup/Restore

    • Waiting for Android 12 T.W.R.P.
    6
    :) I hope you all have a Joyful Holiday season with your family and loves ones. :)

    ~ ~ ~ Stay safe ~ ~ ~
    5
    is there a magisk boot img with modules disabled?. i have a boot loop and need a boot img with it disabled.
    You should have your stock image you can push over. I do not think replacing the boot image with another patched image would disable anything. You can also use adb to remove any modules. Regardless heres my patched boot image and the command to remove modules. Power off, connect phone enter this command, hold power button to boot phone.

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

    Patched December build boot image
    here
    4
    For people who are having bootloops with patched boot.img
    Please pay attention to this step in the guide
    Section 7
    Under Patching boot.img
    4- Depending on the version of Magisk Manager installed: Set the Update Channel to Beta or Canary.

    Even if you install beta / canary magisk apk, if you don't select the matching channel, you'd get a bootloop, so don't forget that important step.
    3
    Thank you for your help I really appreciate it!
    Absolutely, helping each other is what makes this community work.