Rooting Android Device

4 min readFeb 7, 2025

.

Unlock the Bootloader

Unlocking the bootloader is the first step to rooting your Google Pixel 7a. Note that this process will erase all data on your device, so make sure to back up any important files beforehand.

  1. Enable Developer Options:
  • Go to Settings > About Phone.
  • Tap on Build Number 7 times until you see a message confirming that Developer Options have been enabled.

2. Enable USB Debugging and OEM Unlocking:

  • Go to Settings > System > Advanced > Developer Options.
  • Turn on USB Debugging and OEM Unlocking(You need to connect to the internet, if this option is greyed out!).
enable unlocking
  • If prompted, enable file transfer mode on your device so your computer can recognize it.

3. Connect Your Device to Your Computer:

  • Use a USB cable to connect your Google Pixel 7a to your computer.

4. Install ADB and Fastboot Tools:

  • For Windows: Download and install the Android Platform Tools folder, which includes ADB and Fastboot drivers.

5. Open a Terminal or Command Prompt:

  • Navigate to the Platform Tools folder on your computer.
  • Open a terminal or command prompt within this folder.
  • Unlock the bootloader
adb devices
adb reboot bootloader
fastboot devices
fastboot flashing unlock

Note: if fastboot device is not showing, then drivers are required to be installed. Steps-

Download from here: https://developer.android.com/studio/run/win-usb

Browse My Computer for drivers
Click have disk and choose driver “android_winusb.inf”

Then just allow driver installation.

6. Run the Necessary Commands:

  • Type the following commands in order:
  • adb devices (Check if your device is recognized and accept USB debugging on your phone if prompted.)
  • adb reboot bootloader (This will reboot your device into bootloader mode.)
  • fastboot flashing unlock or fastboot oem unlock (This will unlock the bootloader.)

7. Confirm Unlock:

  • Your device will display a confirmation screen. Follow the on-screen instructions to complete the process.
  • Once unlocked, your device’s state will change to Unlocked.

Getting Root Access using Magisk:

1. Step 1 is to Extract init_boot files from the factory image which can be downloaded from Google’s developers website: https://developers.google.com/android/ota#lynx

Choose a pixel device model and download the matching image currently installed. Go To settings → “About Phone”

2. Extract boot_init image from payload.bin using -

payload-dumper-go.exe .\payload.bin

OR

.\adb.exe reboot bootloader
.\fastboot.exe devices
.\fastboot.exe flash init_boot patched_boot_init.img

After reboot, we will have root access.

--

--

n00🔑
n00🔑

Written by n00🔑

Computer Security Enthusiast. Usually plays HTB (ID-23862). https://www.youtube.com/@pswalia2u https://www.linkedin.com/in/pswalia2u/ Instagram @pswalia4u

No responses yet