Google Pixel Root Guide
Note: This guide will work on all Pixel devices up to the Pixel 6/6 Pro/6a, and a majority is the same for Pixel 7/7 Pro, the only difference being that instead of patching boot.img you patch init_boot.img and flash it to init_boot. Look out for that throughout the guide.
To root your device, you’ll need to unlock the bootloader which will WIPE YOUR DATA.
Before starting you must download and install the latest platform tools for your OS - example windows/Linux etc. Instructions and links for this can be found here
Unlock bootloader:
Open the settings app on your phone, select About Phone and scroll to the bottom, here you will see "build number" tap on that until the message appears "you are now a developer" ( usually 6 or 7 times )
Now go back to the main settings menu >> system >> developer options and toggle OEM unlocking and adb debugging.
Plug the phone into PC and open CMD or equivalent in platform tools by typing CMD in the path/title bar of the platform tools folder and hit enter
Once open type
adb devices
and check phone to allow , then type
adb reboot bootloader.
Once phone is in bootloader type
Fastboot flashing unlock
Check the phone and use volume buttons to highlight the unlock menu.
Note: This will WIPE YOUR DATA
The phone will wipe and reboot into Android
Root -
Go through the setup skipping everything along the way and repeat the steps to enable developer options and enable adb debugging.
Download Magisk app from here
Download the correct factory images for your model and version from the link below by tapping this link
( example: Pixel 6a - Android 13 - TQ1A.221205.011, Dec 2022 )
Once downloaded extract the main folder on your PC, and then the images folder, once the images folder is extracted copy the boot.img *( init_boot for Pixel 7/7 Pro )* to phone and install magisk from the link above and open magisk. With magisk open select install >> select and patch file and navigate to the boot.img you copied to phone and hit let's go. Once finished go to downloads and copy the patched image to PC, it will be named magisk_patched-randomstring.img
Now go to the CMD window and type
adb reboot bootloader
Your phone should boot to bootloader interface where you should see unlocked in red text along with other information. Once in bootloader type
Fastboot flash boot <drag and drop patched boot.img>
( Fastboot flash init_boot <drag and drop patched init_boot.img> for Pixel 7/7 Pro )
Once complete and no errors are returned type
fastboot reboot
That is it, your phone should boot into Android rooted. You will need to open the magisk app and complete setup which should be a prompt to reboot once more.
You can look at different modules that allows for endless possibilities with root using the Fox Module Manager app, you can download that here
For custom ROMs it will differ. If a custom recovery is used such as Lineage recovery you can sideload magisk by booting the phone to recovery with -
adb reboot recovery
Or
fastboot reboot recovery
And then going to apply update >> apply from adb and typing -
adb sideload magisk.apk
Let it complete and reboot system. Again you may be prompted to reboot once more to finish the root process.
Notes:
• You can drag and drop the magisk.apk after adb sideload
• Yes, you can sideload the magisk.apk, no need to rename it to magisk.zip
• Check the Fox Magisk Module Manager app to find some cool and useful modules. Link below.
https://github.com/Fox2Code/FoxMagiskModuleManager/releases