[Guide] Root Pixel 4 XL with Magisk Android 13

Search This thread

Broken.exe

Member
Sep 3, 2017
8
2
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
 
  • Like
Reactions: Homeboy76

Homeboy76

Recognized Contributor
Aug 24, 2012
3,872
2,310
Google Pixel XL
Google Pixel 7 Pro
  • Like
Reactions: Broken.exe

Broken.exe

Member
Sep 3, 2017
8
2

Broken.exe

Member
Sep 3, 2017
8
2
Just a quick beginner question.
To root my device with magisk, I just have to unlock bootloader, patch boot.img using magisk, then flash the new patched image using platform tools and fastboot commands provided in your steps, right? I'm not missing any extra steps in between?
 

Homeboy76

Recognized Contributor
Aug 24, 2012
3,872
2,310
Google Pixel XL
Google Pixel 7 Pro
Just a quick beginner question.
To root my device with magisk, I just have to unlock bootloader, patch boot.img using magisk, then flash the new patched image using platform tools and fastboot commands provided in your steps, right? I'm not missing any extra steps in between?
@Broken.exe,
Yes.

You are not missing anything if you are patching the stock boot.img that you extracted from the Febuary 2023 Factory image.

Note: If you use Magisk Canary to patch the boot.img, use version 25206 app-release.apk. There is a link to download 25206 at Post 370 (above]
 
Last edited:
  • Like
Reactions: Broken.exe

Homeboy76

Recognized Contributor
Aug 24, 2012
3,872
2,310
Google Pixel XL
Google Pixel 7 Pro
Magisk Canary Update
app-release_69529ac5-25211.apk
Notes:
  1. Tap app-release.apk
  2. Tap 3 dots (...) across from 10.9 MB, Tap Download
  3. ...[General] Bump minimum supported Android version to Android 6.0
  4. Google Android 14 Codename is 'Android U' or 'Upside Down Cake'
    1. ...[MagiskPolicy] Update rules to support Android U...
    2. ...This fixes boot image patching issues on Android U preview...
 

Homeboy76

Recognized Contributor
Aug 24, 2012
3,872
2,310
Google Pixel XL
Google Pixel 7 Pro
:oops: Not another broken Magisk Canary
Notes:
  1. Magisk Canary 25207, 25208, 25209 (some devices), 25210 and 25211 are broken.
  2. Magisk 25211: Some, are reporting Systemless host is still not working in this thread:
    Magisk General Support / Discussion - starting at Post #55137
  3. 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
<<Edit>> Fix for Module loading, System less Host is still broken.

Waiting for Magisk 26001.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    SDK Platform-tools Update
    SDK Platform-tools r. 34.0.3, was released May 22, 2023.

    @badabing2003 reported a problem when using it.
    https://forum.xda-developers.com/t/...7-pro-cheetah-safetynet.4502805/post-88571575

    @Lughnasadh, suggested a fix.
    https://forum.xda-developers.com/t/...7-pro-cheetah-safetynet.4502805/post-88571601

    @badabing2003, confirmed the suggested fix works.
    https://forum.xda-developers.com/t/...7-pro-cheetah-safetynet.4502805/post-88571617

    Note: If you use Windows SDK Platform- tools r. 34.0.3. You must set the environment variable.

    I think the same is true if you use Linux SDK Platform-tools r. 34.0.3. You must set the enviroment variable.
  • 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 working SDK Platform-tools r. 34.0.3 installed.
      4. Important Notes:
        1. If you use the Linux or Windows version of SDK Platform- tools r. 34.0.3 you must set the environment variable - See Note(s) for instructions on setting the enviroment Variable
        2. 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.
        3. Update Platform Tools, regularly, for optimal performance.
        4. Need Google's USB Drivers for your Pixel Phone?
    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 2023
      2. Magisk Alpha - app-release_709f25f6-26101.apk 12 Apr
      3. Magisk Beta - Magisk v26.1.apk 11 Apr
      4. Magisk Canary - app-release_47d2d4e3-26102.apk 24 May
      5. Magisk Cygisk - Click Pages 5 for installation Instructions.
      6. Magisk Delta - app-release
      7. Magisk Stable - [Magisk v26.1.apk 11 Apr
      8. TWRP - 370_12-0... 10Oct - Waiting for T.R.W.P. for Android 13
      9. SafetyNet - Displax's SafetyNet Fix, v2.4.0-MOD_1.2 14Feb
      10. SDK Platform-tools - r34.0.3 May 22, 2023
      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. ADB Sideload

    5. Flash boot.img

      1. Flashing the boot.img removes root.
      2. 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
    6. Root/Reroot with Magisk and Pass SafetyNet.

      • Download files:

        1. Magisk App - Download to your phone
          1. The latest Magisk Beta/Stable App
          2. The latest Magisk Canary App
        2. Custom kernels: Google Pixel 4 XL ROMs, Kernels, Recoveries, & Other - Download to your phone - install with Kernel Manager
          • Important Note(s): Unless otherwise directed by Kernel Devloper, Flash the Kernel after Magisk.
        3. Kernel Manager - Download to your phone
      • Pass Safety Net with SafetyNet Fix

        1. Download File(s)
        2. Install Displax's safetyNet Fix
          • Open Magisk
          • Tap Modules icon
          • Tap Install from storage
          • Navigate to the Displax's SafetyNet Fix file you downloaded.
          • Tap the 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.
          • (Optional) 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
          • 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.
    7. 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!
    8. 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 trying to install or have installed a Custom ROM, read and follow the Installation Instructions in the OP of the Custom ROM thread or Try installing it with 📳🔥 PixelFlasher, a GUI tool for flashing / updating / rooting / managing Pixel phones..
        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.