How to root the Google Pixel 7 or Pixel 7 Pro with Magisk

How to root the Google Pixel 7 or Pixel 7 Pro with Magisk

Some people cannot imagine using Android without root access. While the Google Pixel smartphones are among the easiest devices to unlock the bootloader, root and install aftermarket software, it may come as a surprise that the typical boot image patching technique is no longer applied to the latest Pixel 7 series is applicable.

If you have bought Pixel 7 or Pixel 7 Pro and want to learn how to root it, in this tutorial we will show you how to do it. You must have your PC handy and be familiar with ADB.

Google Pixel 7 XDA Forums || Google Pixel 7 Pro XDA Forums

  • You need an unlocked bootloader to root the Google Pixel 7 or 7 Pro.
  • Unlocking the bootloader will wipe your Pixel 7/7 Pro.
  • Instead of the boot image, you need to patch the init_boot image with Magisk for root access.

Navigate this article:

Google Pixel 7 Pro in hand

How to root the Google Pixel 7 and 7 Pro

Before we get into how to root the Pixel 7, remember to back up off-device. This is due to the rooting process requires erasing all data on your phone, including files on internal storage.

Step 1 – Get the default init_boot image for Pixel 7/7 Pro

For devices booting to Android 13 like the Pixel 7 series, the generic ramdisk is removed from the boot image and placed in a separate location called “init_boot”. The boot.img only contains the Generic Kernel Image (GKI).

Therefore, patching boot.img for root access will not work for these devices. Rather, we need to get our hands on the image that corresponds to the init_boot partition that corresponds to the current software build the phone is running on.

Fortunately, we don’t need any special tool to rip the init_boot image from the target device. It can be easily extracted from the Pixel 7/7 Pro factory image published by Google.

To ensure you are downloading the correct factory image, you need to check what software version your phone is currently running. To check this go to settings > Via phone. Look for the below build number Section. Find the appropriate build number on the factory image download page and download this file.

Download Android 13 for Google Pixel phones

Next, unzip the factory image zip file. look for the picture-[device codename]-[version].zip file (yes, there is a zip file within a zip file) and extract the init_boot.img file from it. This is the file you need to transfer to your phone’s internal storage for patching.

Google Pixel 7 Pro factory stock image init_boot image

Step 2 – Patch the default init_boot image with Magisk

Now that we have the init_boot image in hand, we can simply patch it with Magisk. In fact, you can patch it on an Android device other than the Pixel 7, but you’ll need to install the Magisk app on the secondary device as well.

While the current stable release of Magisk can patch the Pixel 7’s init_boot image, you should opt for Magisk’s late-breaking canary build for additional fixes.

Load Magisk: Stable || down canary

After installing the Magisk APK, open the app and find the To install button on the top card. Choose Select a file and patch it under methodand select the default init_boot image. This will open the Android file chooser. Go ahead and locate and select the init_boot.img that you transferred from your PC. The Magisk app patches the image to the Downloads folder on the phone. You need to transfer this patched file (should say “magisk_patched_[random_strings].img”) back onto your PC, because next we’ll unlock the bootloader, which will erase all data, as we warned before.

In particular, if you search the XDA forums for Pixel 7 or 7 Pro, you might be lucky enough to find a pre-patched init_boot image. For this reason, we always recommend getting the official firmware and patching the stock boot image yourself to avoid unforeseen glitches due to image version conflicts.

Step 3 – Enable OEM Unlock and Unlock Bootloader

In order to flash third-party software on the Pixel 7, we need to unlock the bootloader. Go to settings > Via phone > build number and tap this entry 7 times to activate it developer options. After enabling it, go back to the main settings page and tap systemthen go to developer options. Switch there OEM unlock Possibility. Remember that you need to enter your password/pattern/PIN to validate some of the actions.

It is important to note that some US carriers such as Verizon do not allow bootloader unlocking at all, making it impossible to root your phone. However, sometimes people find unofficial workarounds, and we’ll let you know when any are found.

After enabling OEM unlocking, turn off your phone. Press and hold both the volume up and power buttons to turn your phone back on and boot into the bootloader menu. Provided you already have the latest ADB and Fastboot binaries installed, you can also use the following command to boot into bootloader mode directly from Android.

adb reboot bootloader

Make sure your phone is connected to your PC/Mac/Chromebook. Next, in a terminal window, type:

fastboot flashing unlock

You will see a screen telling you that you are about to initiate the bootloader unlocking process. Use the volume button to navigate and the power button to accept. Again, all data on your phone will be erased. So make sure you have backed up your data before proceeding.

Step 4 – Flash Magisk patched init_boot image

With your Pixel 7 (or 7 Pro) bootloader unlocked and the init_boot image patched, you’re just one step away from root.

Once the bootloader unlocking process is complete, the phone will boot back up after a few minutes. Skip the setup wizard at this point and turn off the phone. You now want to boot back into the bootloader by holding down the volume down and power buttons again. Once there, connect the phone to your PC/Mac/Chromebook and run the following command:

fastboot flash init_boot path/to/magisk_patched.img

Once you hit enter, the patched init_boot image will be flashed to your phone. Next, reboot with fastboot reboot and the Magisk app should appear on your home screen and/or app drawer. If it doesn’t (e.g. you can only see a stub icon), just install the Magisk APK manually. You are now rooted!

Rooted Google Pixel 7 Pro

Screenshot courtesy of XDA member edcsxz

Remember that you need to repeat steps 1, 2 and 4 every time you update your phone as the init_boot image changes with each update. To learn more, check out our tutorial on how to install OTA updates and stay root on your Google Pixel phone.

What’s next?

Once your Pixel 7 is rooted, open up the device to some interesting mods like Magisk Modules and Xposed Modules. Of course, there are already a lot of things you can do on Google devices without root, but root access is still an added benefit, especially when considering the best rooting apps.

    Google Pixel 7

    The vanilla Google Pixel 7 is very similar to the high-end Pro model, but it’s $300 cheaper and offers better value for money.

    Google Pixel 7 Pro

    The higher-end Pixel 7 Pro has a better display, higher resolution and refresh rate, a bigger battery, and an extra telephoto lens on the back.

#root #Google #Pixel #Pixel #Pro #Magisk

Leave a Comment

Your email address will not be published. Required fields are marked *