Skip to content

Instantly share code, notes, and snippets.

@emeryao
Last active November 14, 2024 06:08
Show Gist options
  • Save emeryao/c18fe301b05f315383bc2c8fd1d3b3d0 to your computer and use it in GitHub Desktop.
Save emeryao/c18fe301b05f315383bc2c8fd1d3b3d0 to your computer and use it in GitHub Desktop.
Pixel 9 Pro

Preparation

  1. Android SDK Platform Tools
  2. Factory Images

Steps

  1. Open Developer Mode
    1. Settings -> About -> Build No Keep Tapping on BuildNo
  2. OEM unlock
    1. Settings -> System -> Developer Options -> OEM Unlock & USB Debug
    2. USB Cable to Phone and PC
    3. $ adb devices
    4. $ adb reboot bootloader
    5. $ fastboot devices
    6. $ fastboot flashing unlock
      1. Use Volume key to select Unlock the bootloader and Power key to confirm
    7. $ <factory_image_folder>/flash-all.bat to flash new factory image with ALL DATA WIPED
  3. Rooting
    1. Extract init_boot.img from factory image
    2. Push to Phone $ adadb push .\init_boot.img /sdcard/Download/
    3. Patch init_boot.img with Magisk App
    4. Pull patched image back to PC $ adb pull /sdcard/Download/magisk_patched.img ./
    5. $ adb reboot bootloader
    6. $ fastboot flash init_boot .\magisk_patched.img

      additionally $ fastboot flash init_boot_a .\magisk_patched.img && fastboot flash init_boot_b .\magisk_patched.img

    7. $ fastboot reboot
    8. Check in Magisk App
  4. Update MID
    1. Find model ids here and here
    2. $ adb shell
      $ su
      # dd if=/dev/block/by-name/devinfo of=/sdcard/devinfo.img
      # exit
      $ adb pull /sdcard/devinfo.img ./
    3. Hex edit devinfo start from 0xAD and save
    4. $ adb push .\devinfo-mod.img /sdcard
    5. $ adb shell
      $ su
      # dd if=/sdcard/devinfo-GEC77.img of=/dev/block/by-name/devinfo
      # reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment