[Guide] Root Pixel 4 XL with Magisk Android 13

Search This thread

Homeboy76

Senior Member
Aug 24, 2012
3,688
2,172
Google Pixel XL
Google Pixel 7 Pro

[Guide] Root Pixel 4 XL With Magisk Android 13
Android Security Bulletin—Feburary 2023
Pixel Update Bulletin—Feburary 2023

Introduction
This Guide is for Pixel 4 XL owners that want to Root their phone, and enjoy the benefits of rooting 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. 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.
  2. Prerequisites

    1. A Pixel 4 XL phone with an unlocked bootloader.
    2. The latest Android 13 Factory or OTA Image: "coral" for Pixel 4 XL

      Factory Image

      OTA Image
    3. A Computer with the latest SDK Platform-Tools: r33.0.3 installed.
    4. Important Notes:
  3. NEW

    • "...make a 100% clean install of ANY Magisk version or fork without PC or TWRP."
  4. Update(s)

    1. Factory/OTA Images - 6 Feb
    2. Magisk Alpha - app-release_555a54ec-alpha.apk 2 Sep
    3. Magisk Beta - 25.2 21Jul
    4. Magisk Canary
      Note: Magisk Canary 25207, 25208, 25209 (some devices), and 25210 are broken.
      - Use Magisk Canary 25206
      - Tap the 3 dot menu across from 5b2934603f => Tap Go to file =>
      Tap app-release.apk => Tap the 3 dot menu across from 10.9 MB => Tap Download
    5. Magisk Cygisk - Click Pages 5 for installation Instructions.
    6. Magisk Delta - app-release
    7. Magisk Stable - 25.2 21Jul
    8. TWRP - 370_12-0... 10Oct - Waiting for T.R.W.P. for Android 13
    9. SafetyNet - kdrag0n safetynet-fix-v2.4.0.zip 09Jan
      This version only supports Zygisk (Magisk 24 and newer).
    10. SDK Platform-tools - r33.0.3 Aug 2022
    11. Custom Kernels
      1. Note: If you are using a Custom Kernel, please update using the method in the OP, Index, 4. Install/Update Factory Image keep data or wipe data, • Flash Factory Image Keep Data
      2. Google Pixel 4 XL ROMs, Kernels, Recoveries, & Other
  5. My Other Guides
  6. Credits/Thanks/Recognitions

    1. bradical711 - Instructions to Pass Safety Net
    2. Those I may have, inadvertently, forgotten.
~ ~ ~ Part II - INSTRUCTIONS ~ ~ ~
(The Instructions listed below are not steps, they are individual sets of instructions.)

  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. Install/Update Factory Image keep data, wipe data, or try badabing2003 PixelFlasher

    • Important Note(s):
      1. If the previous factory image was rooted (you used Magisk to patch the boot.img of the previous factory image). Open Magisk manager and disable all Magisk modules.
      2. If you want to Upgrade to Android 13 or update the Factory Image without wiping your phone: Do Flash Factory Image Keep Data (below).
      3. Always verify you have the latest version of SDK Platform-Tools installed on your computer before installing the Factory Image: Pixel 4XL - coral.
      4. If your phone was rooted, and you want to 'Keep Data'. Do this first open Magisk ==> unhide Magisk App (if you hid it) ==> Disable/Remove all modules ==> then Uninstall Magisk - Restore images prior flashing the Factory image. Why? The changes in the New factory image may cause Magisk modules to fail. This will cause boot loops. Additionally, before Enabling/Installing the modules you Disabled/Removed check with the Dev of the module to ensure it was updated to work with the latest factory image.
      5. If you phone bootloops
        • Press the Power button until the phone turns off.
        • Press the Power and Volume Down to boot the bootloader.
        • Open a Command Prompt in the SDK-Platform-tools folder or the folder that has adb.exe in it, and type adb wait-for-device shell magisk --remove-modules
        • fastboot Reboot
      6. 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.
      7. If you are uncomfortable manually flashing the factory image. Try PixelFlasher by badabing2003.
      8. Backup your data
      9. Download the latest Factory Image: Pixel 4XL - coral to your Computer.
      10. 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 to Upgrade to Android 13 or Update Android 13 with a text editor i.e., DroidEdit app (See Bold items below).
        * * * S T A R T - E D I T * * *
        @Echo off

        PATH=%PATH%;"%SYSTEMROOT%\System32"
        fastboot flash bootloader bootloader-crosshatch-a9-9.9-9999999.img
        fastboot reboot-bootloader
        ping -n 5 127.0.0.1 >nul
        fastboot flash radio radio-crosshatch-a9999-99999-999999-b-9999999.img
        fastboot reboot-bootloader
        ping -n 5 127.0.0.1 >nul
        fastboot update image-crosshatch-aa9a.999999.999.zip
        echo Press any key to exit...
        pause >nul
        exit
        * * * * E N D - E D I T * * * *
      • After, you have edited the flash-all.bat file. Copy/Move these files to the Platform-tools folder:
        1. bootloader-coral-....img
        2. flash-all.bat
        3. image-coral-....zip
        4. radio-coral-....img
      • On your phone: Boot the bootloader (Power off the phone => Press the Power and Down buttons until you see Start)
      • Connect your phone to the computer.
      • Open a Command Prompt on your computer in the Platform-tools and type: flash-all at the Command Prompt and press enter.
      • System will reboot when flashing is complete.
      • Do #8 to Root/Reroot...
    • Flash Factory Image Wipe Data

      • This will wipe your phones Internal Storage.
      • Open the folder you extracted the Factory Image to and Copy/Move these files to the Platform-tools folder:
        1. bootloader-coral-....img
        2. flash-all.bat
        3. image-coral-....zip
        4. radio-coral-....img
      • On your phone: Boot the bootloader (Power off the phone => Press the Power and Down buttons until you see Start)
      • Connect your phone to the computer.
      • 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.
      • Do #8 to Root/Reroot.
  5. Take the OTA Update and Maintain Root

    • This set of instructions was written by @topjohnwu: Install Magisk to Inactive Slot , use the latest Magisk Beta, Canary or Stable.
    • NOTE: After you Open Magisk and Restore Images. If you had a Custom Kernel installed, Please check the OP of the Custom Kernel thread you install for the instruction to remove the Custom Kernel and return your phone to Stock. Additionally, if you had Mods installed, Please check the OP of the Mod thread you installed for instruction to remove the Mod and return your phone to Stock before you download the OTA.
    • If you phone bootloops
      • Press the Power button until the phone turns off.
      • Press the Power and Volume Down to boot the bootloader.
      • Open a Command Prompt in the SDK-Platform-tools folder or the folder that has adb.exe in it, and type adb wait-for-device shell magisk --remove-modules
      • fastboot Reboot
  6. ADB Sideload

  7. Extract/Flash boot.img

    • Extract boot.img

      1. Download the latest Factory image to your phone.
      2. Extract the Factory Image file (coral-SQ3A.999999.999-factory-99a9a99a.zip) to a folder.
      3. Open the folder and, extract the Image file (image-coral-aa9a.999999.999.zip) into the folder.
    • Flash boot.img

      1. Flashing the boot.img removes root.
      2. Open the folder you extracted the 'image...zip' file to and copy/move 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
  8. Root/Reroot with Magisk and Pass SafetyNet.

    • Important Note(s):

      1. Upgrade to Android 13: OP, Part II - INSTRUCTIONS, 2. Install/Update Factory Image keep data or wipe data, Keep data
      2. If your phone was rooted. Do this first unhide Magisk App (if you hid it) then Uninstall Magisk - Restore Images. Why? The changes in the Factory image may cause Magisk modules to fail. This will cause boot loops.
    • Download files:

      1. Magisk App - Download to your phone
        1. Magisk Beta/Stable App
        2. Magisk Canary App
      2. Custom kernels - Download to your phone - install with Kernel Manager
        • Important Note(s): Unless otherwise directed by Kernel Devloper, Flash the Kernel after Magisk.
        1. ElementalX see EXKM for updates.
        2. [KERNEL] CleanSlate T4.9.1 |S2S|Gamma|KCal|AdBlock|VIB|WrGrd [10Sep] by tbalden Post# 664 Floral
        3. [Kernel][06.10.2022][4.14.295][A12][A13] Kirisakura 9.0.2 for Pixel 4/XL aka FLORAL by Freak07
      3. Kernel Manager - Download to your phone
    • Patching the boot.img - to root/reroot.

      1. Do #6 - Extract boot.img
      2. Install Magisk Canary - Download, app-release.apk
        or
        Magisk Beta/Stable App
      3. Open Magisk Beta/Canary/Stable App
      4. The Update Channel should be set to Beta/Canary/Stable depending on the version of Magisk you Installed.
      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/Move the patched boot.img file to your computer's Platform-tools folder or the folder that has fastboot.exe in it:
        • Copy it to a USB drive and transfer it to your computer.
        • Move it to your computer using adb push
      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, 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
        • Remove Modules
          1. Press the Power button until the phone turns off.
          2. Press the Power and Volume Down to boot the bootloader.
          3. Open a Command Prompt in the SDK-Platform-tools folder or the folder that has adb.exe in it, and type adb wait-for-device shell magisk --remove-modules
          4. fastboot Reboot.
      19. Important: If the Magisk Manager app has the Superuser and Module buttons greyed out:
    • Pass Safety Net with SafetyNet Fix

      1. Download File(s)
      2. Install kdrag0n or Displax's safetyNet Fix
        • Open Magisk
        • Tap Modules icon
        • Tap Install from storage
        • Navigate to the kdrag0n SafetyNet Fix or Displax's SafetyNet Fix file you downloaded.
        • Tap the kdrag0n SafetyNet Fix or Displax's SafetyNet Fix 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.
        • Enable Denylist
        • Tap Configure DenyList => Tap 3 Dot Menu => Check ✓ Show system apps => Check ✓ Google Play Store, Google Pay, Google Wallet etc.
        • Scroll down to Superuser and enable Enable Biometric Authentication.
      4. Get Device Certified Clear Google Play Services, Google Play Store, Google Pay, Google Wallet, etc. data[/B]
        • 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, Google Wallet, etc.
        • reboot
        • Turn Airplane mode off
      5. Check Device Certification, I may take 24 hours for Device Certification
        • Open Google Play Store app
        • Tap Menu - Circle top right
        • Tap Settings
        • Tap About
        • Check Play protect certification.
  9. 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!
  10. Install/Update Magisk Modules

    • Download Modules
    • Install Modules from Storage

      1. Open Magisk
      2. Tap the Modules icon
      3. Tap Install from storage
      4. Navigate to the folder with the Module you want to install.
      5. Tap the Module to highlite it and tap Select.
      6. After it installs, tap the Disc Icon to save the install log.
      7. Tap Reboot
    • Install Modules from Fox2Code/Fox Magisk Module Manager

      1. Open Fox2Code/Fox Magisk Module Manager
      2. Tap the Modules icon
      3. Locate the Module you want to install
      4. Tap Install
      5. After it installs, tap the Disc Icon to save the install log.
      6. Tap Reboot
    • Update Modules

      1. Open Fox2Code/Fox Magisk Module Manager
      2. You, will see the Modules that have Updates.
      3. Tap the Module you want to update.
      4. Tap install.
      5. After it installs, tap the Disc Icon to save the install log.
      6. Tap Reboot
~ ~ ~ Part III - OTHER ~ ~ ~
  1. Custom ROMs

    • Need help with a Custom ROM?
      1. If you are you are trying to install or have installed a Custom ROM, read and follow the Installation Instructions in the OP of the Custom ROM thread.
      2. Search the thread of the Custom ROM you are trying to install or have installed for answer(s)/solution(s) to your question(s)/problem(s): 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 or have installed.
      3. 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 ROM you installed or the thread of the Addon you want to add to your Custom ROMfor answer(s)/solution(s) to your question(s)/problem(s). 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 ROM or Addon (Custom Kernel, Magisk, etc.) thread.
    • ROMs
  2. Themes, Apps, and Mods
  3. T.W.R.P. Backup/Restore

    • Waiting for Android 13 T.W.R.P.
 

Attachments

  • ModulesIcon.jpg
    ModulesIcon.jpg
    13.8 KB · Views: 538
  • SuperuserIcon.jpg
    SuperuserIcon.jpg
    12.4 KB · Views: 538
Last edited:

mikepopo99

Member
Mar 25, 2010
37
9
fastboot flash boot magisk_patched.img.--slot all

i have to remove the period after the patched.img. if not i get a no such file in directory
 
  • Like
Reactions: vaishnav 2011

mikepopo99

Member
Mar 25, 2010
37
9
Bootlooping

no matter what I do I keep bootlooping. I'm doing everything on the instructions list. IM trying to root android 11 on my pixel 4 xl. I just flashed the update with the flash all and wiped everything. But when i try to root it gets stuck at the google logo. i have the Magisk Canary Channel installed and patched the boot image and everything. I get the no valid slot to boot in the bootloader.
 

Homeboy76

Senior Member
Aug 24, 2012
3,688
2,172
Google Pixel XL
Google Pixel 7 Pro
no matter what I do I keep bootlooping. I'm doing everything on the instructions list. IM trying to root android 11 on my pixel 4 xl. I just flashed the update with the flash all and wiped everything. But when i try to root it gets stuck at the google logo. i have the Magisk Canary Channel installed and patched the boot image and everything. I get the no valid slot to boot in the bootloader.
Curious
- SDK Platform-tools r 30.0.4?
- What slot did the September 2020 Factory image flash to?
 
  • Like
Reactions: vaishnav 2011

mikepopo99

Member
Mar 25, 2010
37
9
I'm not sure what slot. But yes I am using the newest platform tools. How can I check. I just did the flash all script from Google and did a clean install.
 

Badger50

Senior Moderator / Moderator Committee
Staff member
Best guide on xda.

I just wonder: Can I flash Android 11 on top of Android 10 and keep my data (by removing -w) or is it recommended to clean flash Android 11?

I would never try to tell anyone which way is the correct way since opinions vary. Having said that, I updated without the -w and have had zero problems thus far. However, I would take all necessary precautions as usual:

1. Update your platform-tools.
2. Remove/disable all magisk modules.
3. Remove your face unlock before starting.
4. You'll need to be on the latest canary magisk if you want to root.
5. If you patch your boot.img, make sure the finished image is 32.55 mb. I personally patch the new boot.img before even starting the update process so it's ready to go.

Again, this is how I like to update my device, and is not the be all end all method that others may like to use. Best of luck to you no matter which method you may choose to use. :good:
 

Homeboy76

Senior Member
Aug 24, 2012
3,688
2,172
Google Pixel XL
Google Pixel 7 Pro
I would never try to tell anyone which way is the correct way since opinions vary. Having said that, I updated without the -w and have had zero problems thus far. However, I would take all necessary precautions as usual:

1. Update your platform-tools.
2. Remove/disable all magisk modules.
3. Remove your face unlock before starting.
4. You'll need to be on the latest canary magisk if you want to root.
5. If you patch your boot.img, make sure the finished image is 32.55 mb. I personally patch the new boot.img before even starting the update process so it's ready to go.

Again, this is how I like to update my device, and is not the be all end all method that others may like to use. Best of luck to you no matter which method you may choose to use. :good:
A second opinion is good. :)
 
Last edited:

madmaverickmatt

Senior Member
Apr 26, 2009
338
34
39
Any tricks to getting Safetynet to pass? I did a clean install and build updated everything and safetynet is still failing.

Thanks all.
 

aquadisaster

New member
Sep 27, 2020
2
0
great guide! i almost messed up bad when i flashed first time it froze up and stalled i realised my ssd main drive ran out of space. freed up some space and retried and all worked great! (its a lot bigger than i thought when installing)
 

ucantescape1992

New member
Jan 15, 2011
4
1
Great guide. Boot image is patched and flashed on Android 11.

I can't pass SafetyNet however. Is anyone on Android 11 and passing? Any tips?
 

Homeboy76

Senior Member
Aug 24, 2012
3,688
2,172
Google Pixel XL
Google Pixel 7 Pro
Last edited:
  • Like
Reactions: MikiHunter

TheDiabolicaL1

Senior Member
Nov 17, 2011
793
229
So, I've been out of the flashing game for a long minute but I had to do something about all the ads I was getting. Blockada seemed to work okay but always left something to be desired. I missed Adaway, so....

I had a hard time getting Magisk installed in Android 11 on my Pixel 4xl. I followed this well written tutorial to a tee but when I flashed magisk_patched.img to boot, then "fastboot reboot," it would kick me back to fastboot after the "G" screen and spit out the error "no valid slot to boot." Three times in a row after clean flashing the factory image too!

I did end up getting it working. What I ended up doing was instead of "fastboot flash boot magisk_patched.img --slot all" I "fastboot flash boot magisk_patched.img" and for whatever reason that seemed to work.

I did not take the OTA update if it matters. I had intended to wipe the device with a clean install of Android 11, then Magisk (just for ad blocker) from the get so, I'm guessing slot b wasn't used? I'm honestly not really sure how it works.

Even then though, I had some trouble getting the order right from flashing the factory image to being rooted, so this is also what I found.

First, unlock the bootloader of your device, then clean install Android 11 and get it set up. Download Magisk manager canary, then adb push the boot.img from your computer to your device. Use Magisk manager to patch it, then adb pull magisk_patched.img back to your computer. From there, fastboot flash boot your magisk_patched.img and you're golden. Fastboot reboot should put you back in to Android and then Magisk manager will recognize root.

I had tried several times to use a boot.img I had already patched some days earlier but it never seemed to work. It would boot okay, once I figured out not to "--slot all," but Magisk would never recognize it was rooted unless Magisk manager patched it and I flashed that particular patched file. If I tried to flash any other patched file, Magisk manager wouldn't recognize root. Even recently patched boot.img's that were flashed to the device (not the days old one I had pre-prepped) wouldn't work. Magisk manager only seemed to recognize patched boot.img's that were made by it in that particular install. If I tried to use a boot.img from any other Magisk Manager install it wouldn't recognize it. Weird? I dunno, but, I got it up and running!

Thanks Homeboy76 for making this tutorial. Without it I would have been lost. :good:
 

Homeboy76

Senior Member
Aug 24, 2012
3,688
2,172
Google Pixel XL
Google Pixel 7 Pro
...I did end up getting it working. What I ended up doing was instead of "fastboot flash boot magisk_patched.img --slot all" I "fastboot flash boot magisk_patched.img" and for whatever reason that seemed to work... :good:
@TheDiabolicaL1
Thanks for the kind words.

Glad you got it working and, thanks for posting this information: fastboot flash boot magisk_patched.img

It provides an alternative method of flashing the magisk_patched boot.img for the members getting boot loops.

However, fastboot flash boot magisk_patched.img --slot all does work without boot loops:
C:\android-sdk_windows\image-coral-rp1a.200720.009\platform-tools_r30.0.4-windows>fastboot flash boot magisk_patched.img --slot all
Sending 'boot_a' (33336 KB) OKAY [ 0.234s]
Writing 'boot_a' OKAY [ 0.326s]
Sending 'boot_b' (33336 KB) OKAY [ 0.234s]
Writing 'boot_b' OKAY [ 0.335s]
Finished. Total time: 2.509s
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Magisk Canary Update
    app-release_2717feac-25209.apk
    Notes:
    • Tap 3 dots (...) across from 10.x MB, Tap Download
    1
    My pixel 4xl it's on it's way, your guide is the reason I chose this phone for my needs, thank you for your amazing work keeping it alive all these years
    1
    My pixel 4xl it's on it's way, your guide is the reason I chose this phone for my needs, thank you for your amazing work keeping it alive all these years
    Thanks for the kind words. regrettably,
    Febuary 2023 factory/OTA image may be the laat Stock images for the Google Pixel 4 XL.

    This forum:
    Google Pixel 4 XL ROMs, Kernels, Recoveries, & Oth has Custom ROMS with security updates you can use with your Google Pixel 4 XL. :)
    1
    SDK Platform-tools Update
    SDK Platform-tools r34.0.0 and r34.0.1 are not working.
    Use SDK Platform-tools r33.03.
    1
    Magisk Canary
    These versions of Magisk Canary are all broken: 25207, 25208, 25209, and 25210.

    The last working Magisk Canary 25206 - app-release.apk can be downloaded here.
  • 19

    [Guide] Root Pixel 4 XL With Magisk Android 13
    Android Security Bulletin—Feburary 2023
    Pixel Update Bulletin—Feburary 2023

    Introduction
    This Guide is for Pixel 4 XL owners that want to Root their phone, and enjoy the benefits of rooting 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. 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.
    2. Prerequisites

      1. A Pixel 4 XL phone with an unlocked bootloader.
      2. The latest Android 13 Factory or OTA Image: "coral" for Pixel 4 XL

        Factory Image

        OTA Image
      3. A Computer with the latest SDK Platform-Tools: r33.0.3 installed.
      4. Important Notes:
    3. NEW

      • "...make a 100% clean install of ANY Magisk version or fork without PC or TWRP."
    4. Update(s)

      1. Factory/OTA Images - 6 Feb
      2. Magisk Alpha - app-release_555a54ec-alpha.apk 2 Sep
      3. Magisk Beta - 25.2 21Jul
      4. Magisk Canary
        Note: Magisk Canary 25207, 25208, 25209 (some devices), and 25210 are broken.
        - Use Magisk Canary 25206
        - Tap the 3 dot menu across from 5b2934603f => Tap Go to file =>
        Tap app-release.apk => Tap the 3 dot menu across from 10.9 MB => Tap Download
      5. Magisk Cygisk - Click Pages 5 for installation Instructions.
      6. Magisk Delta - app-release
      7. Magisk Stable - 25.2 21Jul
      8. TWRP - 370_12-0... 10Oct - Waiting for T.R.W.P. for Android 13
      9. SafetyNet - kdrag0n safetynet-fix-v2.4.0.zip 09Jan
        This version only supports Zygisk (Magisk 24 and newer).
      10. SDK Platform-tools - r33.0.3 Aug 2022
      11. Custom Kernels
        1. Note: If you are using a Custom Kernel, please update using the method in the OP, Index, 4. Install/Update Factory Image keep data or wipe data, • Flash Factory Image Keep Data
        2. Google Pixel 4 XL ROMs, Kernels, Recoveries, & Other
    5. My Other Guides
    6. Credits/Thanks/Recognitions

      1. bradical711 - Instructions to Pass Safety Net
      2. Those I may have, inadvertently, forgotten.
    ~ ~ ~ Part II - INSTRUCTIONS ~ ~ ~
    (The Instructions listed below are not steps, they are individual sets of instructions.)

    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. Install/Update Factory Image keep data, wipe data, or try badabing2003 PixelFlasher

      • Important Note(s):
        1. If the previous factory image was rooted (you used Magisk to patch the boot.img of the previous factory image). Open Magisk manager and disable all Magisk modules.
        2. If you want to Upgrade to Android 13 or update the Factory Image without wiping your phone: Do Flash Factory Image Keep Data (below).
        3. Always verify you have the latest version of SDK Platform-Tools installed on your computer before installing the Factory Image: Pixel 4XL - coral.
        4. If your phone was rooted, and you want to 'Keep Data'. Do this first open Magisk ==> unhide Magisk App (if you hid it) ==> Disable/Remove all modules ==> then Uninstall Magisk - Restore images prior flashing the Factory image. Why? The changes in the New factory image may cause Magisk modules to fail. This will cause boot loops. Additionally, before Enabling/Installing the modules you Disabled/Removed check with the Dev of the module to ensure it was updated to work with the latest factory image.
        5. If you phone bootloops
          • Press the Power button until the phone turns off.
          • Press the Power and Volume Down to boot the bootloader.
          • Open a Command Prompt in the SDK-Platform-tools folder or the folder that has adb.exe in it, and type adb wait-for-device shell magisk --remove-modules
          • fastboot Reboot
        6. 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.
        7. If you are uncomfortable manually flashing the factory image. Try PixelFlasher by badabing2003.
        8. Backup your data
        9. Download the latest Factory Image: Pixel 4XL - coral to your Computer.
        10. 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 to Upgrade to Android 13 or Update Android 13 with a text editor i.e., DroidEdit app (See Bold items below).
          * * * S T A R T - E D I T * * *
          @Echo off

          PATH=%PATH%;"%SYSTEMROOT%\System32"
          fastboot flash bootloader bootloader-crosshatch-a9-9.9-9999999.img
          fastboot reboot-bootloader
          ping -n 5 127.0.0.1 >nul
          fastboot flash radio radio-crosshatch-a9999-99999-999999-b-9999999.img
          fastboot reboot-bootloader
          ping -n 5 127.0.0.1 >nul
          fastboot update image-crosshatch-aa9a.999999.999.zip
          echo Press any key to exit...
          pause >nul
          exit
          * * * * E N D - E D I T * * * *
        • After, you have edited the flash-all.bat file. Copy/Move these files to the Platform-tools folder:
          1. bootloader-coral-....img
          2. flash-all.bat
          3. image-coral-....zip
          4. radio-coral-....img
        • On your phone: Boot the bootloader (Power off the phone => Press the Power and Down buttons until you see Start)
        • Connect your phone to the computer.
        • Open a Command Prompt on your computer in the Platform-tools and type: flash-all at the Command Prompt and press enter.
        • System will reboot when flashing is complete.
        • Do #8 to Root/Reroot...
      • Flash Factory Image Wipe Data

        • This will wipe your phones Internal Storage.
        • Open the folder you extracted the Factory Image to and Copy/Move these files to the Platform-tools folder:
          1. bootloader-coral-....img
          2. flash-all.bat
          3. image-coral-....zip
          4. radio-coral-....img
        • On your phone: Boot the bootloader (Power off the phone => Press the Power and Down buttons until you see Start)
        • Connect your phone to the computer.
        • 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.
        • Do #8 to Root/Reroot.
    5. Take the OTA Update and Maintain Root

      • This set of instructions was written by @topjohnwu: Install Magisk to Inactive Slot , use the latest Magisk Beta, Canary or Stable.
      • NOTE: After you Open Magisk and Restore Images. If you had a Custom Kernel installed, Please check the OP of the Custom Kernel thread you install for the instruction to remove the Custom Kernel and return your phone to Stock. Additionally, if you had Mods installed, Please check the OP of the Mod thread you installed for instruction to remove the Mod and return your phone to Stock before you download the OTA.
      • If you phone bootloops
        • Press the Power button until the phone turns off.
        • Press the Power and Volume Down to boot the bootloader.
        • Open a Command Prompt in the SDK-Platform-tools folder or the folder that has adb.exe in it, and type adb wait-for-device shell magisk --remove-modules
        • fastboot Reboot
    6. ADB Sideload

    7. Extract/Flash boot.img

      • Extract boot.img

        1. Download the latest Factory image to your phone.
        2. Extract the Factory Image file (coral-SQ3A.999999.999-factory-99a9a99a.zip) to a folder.
        3. Open the folder and, extract the Image file (image-coral-aa9a.999999.999.zip) into the folder.
      • Flash boot.img

        1. Flashing the boot.img removes root.
        2. Open the folder you extracted the 'image...zip' file to and copy/move 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
    8. Root/Reroot with Magisk and Pass SafetyNet.

      • Important Note(s):

        1. Upgrade to Android 13: OP, Part II - INSTRUCTIONS, 2. Install/Update Factory Image keep data or wipe data, Keep data
        2. If your phone was rooted. Do this first unhide Magisk App (if you hid it) then Uninstall Magisk - Restore Images. Why? The changes in the Factory image may cause Magisk modules to fail. This will cause boot loops.
      • Download files:

        1. Magisk App - Download to your phone
          1. Magisk Beta/Stable App
          2. Magisk Canary App
        2. Custom kernels - Download to your phone - install with Kernel Manager
          • Important Note(s): Unless otherwise directed by Kernel Devloper, Flash the Kernel after Magisk.
          1. ElementalX see EXKM for updates.
          2. [KERNEL] CleanSlate T4.9.1 |S2S|Gamma|KCal|AdBlock|VIB|WrGrd [10Sep] by tbalden Post# 664 Floral
          3. [Kernel][06.10.2022][4.14.295][A12][A13] Kirisakura 9.0.2 for Pixel 4/XL aka FLORAL by Freak07
        3. Kernel Manager - Download to your phone
      • Patching the boot.img - to root/reroot.

        1. Do #6 - Extract boot.img
        2. Install Magisk Canary - Download, app-release.apk
          or
          Magisk Beta/Stable App
        3. Open Magisk Beta/Canary/Stable App
        4. The Update Channel should be set to Beta/Canary/Stable depending on the version of Magisk you Installed.
        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/Move the patched boot.img file to your computer's Platform-tools folder or the folder that has fastboot.exe in it:
          • Copy it to a USB drive and transfer it to your computer.
          • Move it to your computer using adb push
        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, 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
          • Remove Modules
            1. Press the Power button until the phone turns off.
            2. Press the Power and Volume Down to boot the bootloader.
            3. Open a Command Prompt in the SDK-Platform-tools folder or the folder that has adb.exe in it, and type adb wait-for-device shell magisk --remove-modules
            4. fastboot Reboot.
        19. Important: If the Magisk Manager app has the Superuser and Module buttons greyed out:
      • Pass Safety Net with SafetyNet Fix

        1. Download File(s)
        2. Install kdrag0n or Displax's safetyNet Fix
          • Open Magisk
          • Tap Modules icon
          • Tap Install from storage
          • Navigate to the kdrag0n SafetyNet Fix or Displax's SafetyNet Fix file you downloaded.
          • Tap the kdrag0n SafetyNet Fix or Displax's SafetyNet Fix 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.
          • Enable Denylist
          • Tap Configure DenyList => Tap 3 Dot Menu => Check ✓ Show system apps => Check ✓ Google Play Store, Google Pay, Google Wallet etc.
          • Scroll down to Superuser and enable Enable Biometric Authentication.
        4. Get Device Certified Clear Google Play Services, Google Play Store, Google Pay, Google Wallet, etc. data[/B]
          • 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, Google Wallet, etc.
          • reboot
          • Turn Airplane mode off
        5. Check Device Certification, I may take 24 hours for Device Certification
          • Open Google Play Store app
          • Tap Menu - Circle top right
          • Tap Settings
          • Tap About
          • Check Play protect certification.
    9. 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!
    10. Install/Update Magisk Modules

      • Download Modules
      • Install Modules from Storage

        1. Open Magisk
        2. Tap the Modules icon
        3. Tap Install from storage
        4. Navigate to the folder with the Module you want to install.
        5. Tap the Module to highlite it and tap Select.
        6. After it installs, tap the Disc Icon to save the install log.
        7. Tap Reboot
      • Install Modules from Fox2Code/Fox Magisk Module Manager

        1. Open Fox2Code/Fox Magisk Module Manager
        2. Tap the Modules icon
        3. Locate the Module you want to install
        4. Tap Install
        5. After it installs, tap the Disc Icon to save the install log.
        6. Tap Reboot
      • Update Modules

        1. Open Fox2Code/Fox Magisk Module Manager
        2. You, will see the Modules that have Updates.
        3. Tap the Module you want to update.
        4. Tap install.
        5. After it installs, tap the Disc Icon to save the install log.
        6. Tap Reboot
    ~ ~ ~ Part III - OTHER ~ ~ ~
    1. Custom ROMs

      • Need help with a Custom ROM?
        1. If you are you are trying to install or have installed a Custom ROM, read and follow the Installation Instructions in the OP of the Custom ROM thread.
        2. Search the thread of the Custom ROM you are trying to install or have installed for answer(s)/solution(s) to your question(s)/problem(s): 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 or have installed.
        3. 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 ROM you installed or the thread of the Addon you want to add to your Custom ROMfor answer(s)/solution(s) to your question(s)/problem(s). 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 ROM or Addon (Custom Kernel, Magisk, etc.) thread.
      • ROMs
    2. Themes, Apps, and Mods
    3. T.W.R.P. Backup/Restore

      • Waiting for Android 13 T.W.R.P.
    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.