If you are looking for my guide on a different Pixel, find it here:
Prerequisites:
Android Source - Setting up a device for development
Points of note:
Credits:
Thanks to @ipdev , @kdrag0n , @Didgeridoohan , and last but not least, @topjohnwu for all their hard work!
- Pixel 3
- Pixel 3a
- Pixel 3aXL
- Pixel 4
- Pixel 4XL
- Pixel 4a
- Pixel 4a (5G)
- Pixel 5
- Pixel 5a
- Pixel 6
- Pixel 6 Pro
Prerequisites:
- Latest SDK Platform Tools - if Platform Tools is out of date, you WILL run into problems!
- USB Debugging enabled
- Google USB Driver installed
- I recommend using Command Prompt for these instructions; some users have difficulty with PowerShell.
Make sure the Command Prompt is running from your Platform Tools directory!
Android Source - Setting up a device for development
- Follow these instructions to enable Developer Options and USB Debugging.
- Enable OEM Unlocking. If this option is grayed out, unlocking the bootloader is not possible.
- Connect your device to your PC, and open a command window in your Platform Tools folder.
- Ensure ADB sees your device:
Code:
adb devices
If you see "unauthorized", you need to authorize the connection on your device.
If you see the device without "unauthorized", you're good to go. - Reboot to bootloader:
Code:
adb reboot bootloader
- Unlock bootloader: THIS WILL WIPE YOUR DEVICE!
Code:
fastboot flashing unlock
- Install Magisk on your device.
- Download the factory zip for your build.
- Inside the factory zip is the update zip: "device-image-buildnumber.zip". Open this, and extract boot.img
- Copy boot.img to your device.
- Patch boot.img with Magisk: "Install" > "Select and Patch a File"
- Copy the patched image back to your PC. It will be named "magisk_patched-23xxx_xxxxx.img". Rename this to "master root.img" and retain it for future updates.
- Reboot your device to bootloader.
- Flash the patched image:
Code:
fastboot flash boot <drag and drop master root.img here>
- Reboot to Android. Open Magisk to confirm root - under Magisk at the top, you should see "Installed: <Magisk build number>
- Before you download the OTA, open Magisk, tap Uninstall, then Restore Images. If you have any Magisk modules that modify system, uninstall them now.
- Take the OTA update when prompted. To check for updates manually, go to Settings > System > System Update > Check for Update
- Allow the update to download and install. DO NOT REBOOT WHEN PROMPTED. Open Magisk, tap Install at the top, then Install to inactive slot. Magisk will then reboot your device.
- You should now be updated with root.
- Download the OTA.
- Reboot to recovery and sideload the OTA:
Code:
adb reboot sideload
Code:adb sideload ota.zip
- When the OTA completes, you will be in recovery mode. Select "Reboot to system now".
- Allow system to boot and wait for the update to complete. You must let the system do this before proceeding.
- Reboot to bootloader.
- Boot the master root image (See note 1):
Code:
fastboot boot <drag and drop master root.img here>
- Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
- Reboot your device. You should now be updated with root.
Please note that the factory update process expects an updated bootloader and radio. If these are not up to date, the update will fail.
The scripted commands should look like this:
Once this completes, you can reboot to bootloader and either boot your master patched image, or if you patched the new image, flash it at this time.
- Download the factory zip and extract the contents.
- Reboot to bootloader.
-
Compare bootloader versions between phone screen and bootloader.img build numberCode:
fastboot flash bootloader <drag and drop new bootloader.img here>
-
Compare baseband versions between phone screen and radio.img build numberCode:
fastboot flash radio <drag and drop radio.img here>
- Apply update:
Code:fastboot update --skip-reboot image-codename-buildnumber.zip
- Boot the master root image (See note 1):
Code:
fastboot boot <drag and drop master root.img here>
- Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
- Reboot your device. You should now be updated with root.
flash-all
script included in the factory zip. You will have to copy the script, bootloader image, radio image, and update zip into the Platform Tools folder; you will then have to edit the script to remove the -w
option so it doesn't wipe your device.The scripted commands should look like this:
Code:
fastboot flash bootloader <bootloader image name>
fastboot reboot bootloader
ping -n 5 127.0.0.1 > nul
fastboot flash radio <radio image name>
fastboot reboot bootloader
ping -n 5 127.0.0.1 > nul
fastboot update --skip-reboot --slot=all <image-device-buildnumber.zip>
- Follow the instructions on the Android Flash Tool to update your device. Make sure Lock Bootloader and Wipe Device are UNCHECKED.
- When the update completes, the device will be in fastbootd. Reboot to bootloader.
- Boot the master root image (See note 1):
Code:
fastboot boot <drag and drop master root.img here>
- Your device should boot with root. Open Magisk, tap Install, and select Direct Install.
- Reboot your device. You should now be updated with root.
This is my configuration that is passing Safety Net. I will not provide instructions on how to accomplish this. Attempt at your own risk.
Zygisk + DenyList enabled
All subcomponents of these apps hidden under DenyList:
I do not provide support for Magisk or modules. If you need help with Magisk, here is the Magisk General Support thread. For support specifically with Magisk v24+, see this thread.
Zygisk + DenyList enabled
All subcomponents of these apps hidden under DenyList:
- Google Play Store
- GPay
- Any banking/financial apps
- Any DRM media apps
- MagiskHide Props Config 6.1.2 (automatically installed) - MHPC GitHub and XDA Thread
- Universal SafetyNet Fix 2.2.1 - USNF GitHub and XDA Thread
I do not provide support for Magisk or modules. If you need help with Magisk, here is the Magisk General Support thread. For support specifically with Magisk v24+, see this thread.
Points of note:
- The boot image is NOT the bootloader image. Do not confuse the two - YOU are expected to know the difference. Flashing the wrong image to bootloader could brick your device.
- While the Magisk app is used for patching the boot image, the app and the patch are separate. This is what you should see in Magisk for functioning root:
- "Installed" shows the version of patch in the boot image. If this says N/A, you do not have root access - the boot image is not patched, or you have a problem with Magisk.
- "App" simply shows the version of the app itself.
- If you do not have a patched master boot image, you will need to download the factory zip if you haven't already, extract the system update inside it, then patch boot.img.
- If you prefer updating with the factory image, you can also extract and manually patch the boot image if desired.
- Some Magisk modules, especially those that modify read only partitions like /system, may cause a boot loop after updating. As a general rule, disable these modules before updating. You are responsible for knowing what you have installed, and what modules to disable.
Credits:
Thanks to @ipdev , @kdrag0n , @Didgeridoohan , and last but not least, @topjohnwu for all their hard work!
Last edited: