[Guide] Root Pixel 4 XL with Magisk Android 13

Search This thread

Lughnasadh

Senior Member
Mar 23, 2015
6,172
7,672
Google Nexus 5
Huawei Nexus 6P
I didn't know there was a way to remove Magisk modules from fastboot. How do you do that?
Oh, I didn't mean from fastboot. I meant uninstalling them in Magisk Manager before flashing the factory image.

But if you are in a situation where you can't get into your phone due to a magisk mod, you can boot up in safe mode, which will temporarily disable the modules, and then delete them in /data/adb
 
  • Like
Reactions: Homeboy76

GravityNinja

Member
Oct 30, 2016
17
1
Dallas, TX
Google Pixel 4 XL
Ok. That should work. Before reinstalling Magisk, or even before flashing the Dec. factory image I would suggest to remove all magisk mods first. I know that there were some SystemUI changes in the December update so any mods that affect that may play havoc with your phone.
UPDATE: If you're a bonehead like me and you inadvertently left auto-updates on, the December patch was likely installed last night or will be soon. Luckily, my Magisk modules didn't cause any issues after applying the following:
  1. Download the latest factory image (December 5, 2020).
  2. Edit flash-all and remove the "-w".
  3. Run flash-all in bootloader.
  4. Extract the boot image from the zip file.
  5. Copy it to your phone once you've rebooted.
  6. Open Magisk and patch the boot image.
  7. Reboot to bootloader and flash the modified image.
  8. Reboot. You're done.
 

Lughnasadh

Senior Member
Mar 23, 2015
6,172
7,672
Google Nexus 5
Huawei Nexus 6P
UPDATE: If you're a bonehead like me and you inadvertently left auto-updates on, the December patch was likely installed last night or will be soon. Luckily, my Magisk modules didn't cause any issues after applying the following:
  1. Download the latest factory image (December 5, 2020).
  2. Edit flash-all and remove the "-w".
  3. Run flash-all in bootloader.
  4. Extract the boot image from the zip file.
  5. Copy it to your phone once you've rebooted.
  6. Open Magisk and patch the boot image.
  7. Reboot to bootloader and flash the modified image.
  8. Reboot. You're done.
Glad you got it going (y) . This is what I do every month. Of course, I disable a few Magisk Mods which modify the SystemUI (some need to be updated by the developer after an update) and Substratum overlays first.
 
  • Like
Reactions: GravityNinja

madmuthertrucker

Senior Member
Jan 4, 2013
243
122
Tucson, Az
Google Pixel 7 Pro
I've been through these directions a dozen times and I'm still at a loss as to how to apply the update. There is not a "D" under #7 period. The OTA update is not the same file structure as the factory image so that doesn't apply at all. Anyone?
I'm finding it in #4 subsection 3. I uncheck the modules in magisk, reboot, then uninstall magisk (restore images). Then flash factory image -w. It's been keeping me out of trouble.
 
  • Like
Reactions: GravityNinja

WhiteReign

Senior Member
Apr 15, 2011
1,007
465
First off great work here. Always love to see people spelling it out for us noobs.

On a Pixel 4XL
I am using PixelDust ROM 11
I do get boot loop when trying to root. Did every thing as asked but for some reason it doesn't like me. Could I have missed something? Any help would be great!
 

GravityNinja

Member
Oct 30, 2016
17
1
Dallas, TX
Google Pixel 4 XL
First off great work here. Always love to see people spelling it out for us noobs.

On a Pixel 4XL
I am using PixelDust ROM 11
I do get boot loop when trying to root. Did every thing as asked but for some reason it doesn't like me. Could I have missed something? Any help would be great!
Check out #18.
"Important Notes: If your phone boot loops try one of the following options:
Flash the 'stock' boot.img to both slots: [JCODE]fastboot flash boot boot.img --slot all[/ICODE]
Boot Safe Mode - Press Power Off button ==> Press Power Off until you see boot Safe Mode ==> Press Ok."
 

Lughnasadh

Senior Member
Mar 23, 2015
6,172
7,672
Google Nexus 5
Huawei Nexus 6P
@Homeboy76 Just wanted to give you a heads up. With the latest Magisk Beta (21.2) that came out yesterday, the patched output file is no longer named "magisk_patched.img". He added a suffix to the name so each time you patch the stock boot image a different output name will result. Thought you might want to modify #7 to address this change (y)
 

Homeboy76

Recognized Contributor
Aug 24, 2012
4,200
2,728
Google Pixel 8 Pro
@Homeboy76 Just wanted to give you a heads up. With the latest Magisk Beta (21.2) that came out yesterday, the patched output file is no longer named "magisk_patched.img". He added a suffix to the name so each time you patch the stock boot image a different output name will result. Thought you might want to modify #7 to address this change (y)
Done, thanks for the tip.:p
 
  • Like
Reactions: Lughnasadh

madmuthertrucker

Senior Member
Jan 4, 2013
243
122
Tucson, Az
Google Pixel 7 Pro
@Homeboy76 Just wanted to give you a heads up. With the latest Magisk Beta (21.2) that came out yesterday, the patched output file is no longer named "magisk_patched.img". He added a suffix to the name so each time you patch the stock boot image a different output name will result. Thought you might want to modify #7 to address this change (y)
This is why I follow this thread. It keeps me out of trouble. But now I wonder what it will be called. I suppose I could patch one and find out. I'm going to have to do it in about 6 days anyway, I will find out then.
 
  • Like
Reactions: Homeboy76

Lughnasadh

Senior Member
Mar 23, 2015
6,172
7,672
Google Nexus 5
Huawei Nexus 6P
This is why I follow this thread. It keeps me out of trouble. But now I wonder what it will be called. I suppose I could patch one and find out. I'm going to have to do it in about 6 days anyway, I will find out then.
It will be magisk_patched.xxxxxxx.img. The xxxxx suffix will change every time you patch your boot image, even if patching the same boot image.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20

    Introduction
    This Guide is for Pixel 4 XL owners that want to install a custom ROM and Root it. The Guide is divided into three parts: Information, Instructions, and Other.

    ~ ~ ~ Part I - INFORMATION ~ ~ ~
    1. Disclaimer

      1. I assume no responsibility for the malfunctioning/bricking of your phone.
    2. Prerequisites

      1. A Pixel 4 XL phone with an unlocked bootloader.
      2. A Computer with a working version of Platform-tools installed:
        Platform-tools 33.0.3
        Platform-tools 34.0.4 - Is Ok for sideloading OTA images.
      3. Important Notes:
        a. Before installing SDK Platform-tools, check for older versions of fastboot on your computer: Open a Command prompt and type fastboot --version at the prompt. If a adb/fastboot is found delete the folder containing them. Also, check the path environment for paths to them and remove it.​

        b. Update Platform Tools, regularly, for optimal performance.​

    3. NEW

    4. Update(s)

      1. Magisk Beta - Magisk v26.4.apk 4 Sep
      2. Magisk Canary - app-release (d7750b72) (26403).apk 13 Dec
      3. Magisk Stable - Magisk v26.4.apk 4 Sep
      4. SafetyNet - osm0sis Play Integrity Fork
      5. Platform-tools - 34.0.4 Jul 2023
      6. Custom ROMS and Kernels
    5. My Other Guides
    6. Credits/Thanks/Recognitions

      • bradical711 - Instructions to Pass Safety Net
    ~ ~ ~ Part II - INSTRUCTIONS ~ ~ ~
    (The Instructions listed below are not steps, they are individual sets of instructions for Pixel 4 XL.)

    1. 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.
    2. 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 (#1)
      • 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.
    3. 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.
    4. ADB Sideload

    5. Pass Safety Net with Magisk module - Play Integrity Fork

      1. Download File(s)
      2. Install osm0sis PlayIntegrityFork
        • Open Magisk
        • Tap Modules icon
        • Tap Install from storage
        • Navigate to the osm0sis PlayIntegrityFork file you downloaded.
        • Tap the osm0sis PlayIntegrityFork file.
        • When you see the confirmation screen, tap Ok.
        • After it installs tap the Disc 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.
        • Enable Denylist
        • Tap Configure DenyList => Tap 3 Dot Menu => Check ✓ Show system apps => Check ✓ Google Play Store, Google Pay, Google Wallet etc.
        • (Optional) Scroll down to Superuser and enable Enable Biometric Authentication.
      4. Get Device Certified
        • Flash the osm0sis PlayIntegrityFork module in Magisk
        • Turn Airplane mode on
        • Open Settings
        • Tap Apps & notifications
        • Tap see all...
        • Tap three dot menu
        • Tap Show system
        • Scroll to Google Wallet/Play Store/Play Services
        • Clear Google Wallet cache (if you have it)
        • Clear Google Play Store cache and data
        • Clear Google Play Services (com.google.android.gms) cache and data (Optionally skip clearing data and wait some time, ~24h, for it to resolve on its own)
        • Turn Airplane mode Off
        • Reboot
      5. Check Device Certification
        • Note: If after completeting Get Device Certified your device is not certifed or your device is certified but certain apps (Google Pay, NetFliks, etc.) are not working. Do this to verify you are passing Play Integrity.
          1. Open Google Play Store app
          2. Tap your profile icon (top right corner)
          3. Tap Settings.
          4. Open the About menu
          5. Tap the row labeled Play Store version seven times to unlock developer mode.
          6. Tap the back arrow (upper left corner)
          7. Tap your profile icon (top right corner)
          8. Tap Settings.
          9. Open the General menu
          10. Tap Developer options
          11. Tap Check integrity
          12. If you see Basic Integrity and Device Integrity, you're passing Play integrity.
    6. 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!
    7. Install/Update Magisk Modules

    ~ ~ ~ Part III - OTHER ~ ~ ~
    1. Custom ROMs

      • Need help with a Custom ROM?

        1. If you are trying to install a Custom ROM, read and follow the Installation Instructions in the OP of the Custom ROM thread.
        2. If you have questions, search the thread of the Custom ROM you are trying to install for answer(s)/solution(s) to your question(s)/problem(s)[/B]: If you don't find a answer(s)/solution(s) to your question(s)/problem(s). Post your question(s)/request(s) for help in the Custom ROM thread you are trying to install.
        3. Try installing it with 📳🔥 PixelFlasher, a GUI tool for flashing / updating / rooting / managing Pixel phones..
        4. If you are trying to install a Addon(s) {Custom Kernel, Magisk, etc.} to the Custom ROM you installed: Search the thread of the Custom Kernel, Magisk, etc. you want to install for installation instructions, and answer(s)/solution(s) to your question(s)/problem(s) about the Custom Kernel, Magisk, etc. If you don't find an answer(s)/solution(s) to your question(s)/problem(s). Post your question(s)/request(s) for help in the Custom Kernel, Magisk, etc.) thread.
      • ROMs
    2. Themes, Apps, and Mods
    4
    Having problems passing SafetyNet when using Google Pay/Wallet? Try these Play Integrity Fixes:
    1. Riru - Play Integrity Fix
    2. Zygisk - @Displax's safetynet-fix-v2.3.1-MOD.zip
    Use this app to check the status of Play Integrity on your phone: Play Integrity API Checker
    4
    @Homeboy76 Just wanted to give you a heads up. With the latest Magisk Beta (21.2) that came out yesterday, the patched output file is no longer named "magisk_patched.img". He added a suffix to the name so each time you patch the stock boot image a different output name will result. Thought you might want to modify #7 to address this change (y)
    3
    For those on latest Canary 23014 (Zygisk with GPay added to deny list),to pass safetynet and enable contactless payments

    1) Clear data for both GPay and Google Play Services. Unfortunately this also meant adding cards back in GPay app (basically reverify already added cards in your GPay profile)

    2) Apply SafetyNet fix 2.2.0 (latest).

    On the bright side no longer need Riru, Riru core, LSPosed etc. etc. Just SNF 2.2.0 + Systemless hosts like old times.
    3
    Is rooting Android 12 with stable magisk actually possible? or do i need the beta or canary version?
    Yes, it's fine. I've been using Stable version 23.0 since the first beta was released and am currently using it on yesterdays official release of Android 12 stable. Everything is fine for me.

    People on other Pixels, specifically the Pixel 5 (and maybe others) have reported that they have to disable dm-verity (and maybe another thing or two) before rooting or it will just land you in the bootloader when trying to boot. However, on my Pixel 4 XL I did not have to do anything. Just patched the boot image as usual and everything is fine for me.

    Of course, your mileage may vary.