Skip to content

Instantly share code, notes, and snippets.

@auriza
Last active January 13, 2026 10:06
Show Gist options
  • Select an option

  • Save auriza/15208929ab7bca9734415141bae4c47f to your computer and use it in GitHub Desktop.

Select an option

Save auriza/15208929ab7bca9734415141bae4c47f to your computer and use it in GitHub Desktop.

Flash Factory Image (Pixel 8 "Shiba")

https://developers.google.com/android/images#instructions

  1. Download the appropriate system image for your device from the table, then extract it to a safe directory.

    https://dl.google.com/dl/android/aosp/shiba-bp4a.251205.006.e1-factory-cda5c1cb.zip

  2. Connect your device to your computer over USB.

  3. In Settings, tap System, then tap Developer options and enable OEM unlocking and USB debugging.

  4. Start the device in fastboot mode. With the device powered on, execute:

    adb reboot bootloader

  5. If necessary, unlock the device's bootloader using this command:

    fastboot flashing unlock

  6. Open a terminal and navigate to the unzipped system image directory.

  7. Execute the flash-all script. This script installs the necessary bootloader, baseband firmware(s), and operating system.

Magisk Patch to Get Root

https://topjohnwu.github.io/Magisk/install.html

Extract init_boot.img from the system image above image-shiba-bp4a.251205.006.e1.zip.

adb push Magisk-v30.6.apk /sdcard
# magisk: install

adb push init_boot.img /sdcard
# magisk: patch
adb pull /sdcard/Download/magisk_patched*.img

adb reboot bootloader
fastboot flash init_boot magisk_patched*.img
# start
# magisk: check

Building Pixel 8 Kernel

https://source.android.com/docs/setup/build/building-pixel-kernels

  1. Install software dependencies

    sudo apt install git gnupg flex bison build-essential zip curl zlib1g-dev x11proto-core-dev libx11-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig repo

  2. Sync the kernel repository

    mkdir android16 && cd android16
    .repo/repo/repo init -u https://android.googlesource.com/kernel/manifest -b android-gs-shusky-6.1-android16
    .repo/repo/repo sync -c --no-tags
  3. Compile the kernel

    rm -rf out
    ./build_shusky.sh --config=use_source_tree_aosp --config=no_download_gki_fips140
  4. Flash the kernel images

    adb reboot bootloader
    sleep 10
    fastboot oem disable-verification
    #fastboot -w
    fastboot flash boot out/shusky/dist/boot.img
    fastboot flash dtbo out/shusky/dist/dtbo.img
    fastboot flash vendor_kernel_boot out/shusky/dist/vendor_kernel_boot.img
    fastboot reboot fastboot
    sleep 10
    fastboot flash vendor_dlkm out/shusky/dist/vendor_dlkm.img
    fastboot flash system_dlkm out/shusky/dist/system_dlkm.img
    fastboot reboot

ADB Shell

adb devices
adb shell su -c cat /proc/kmsg
adb logcat -b kernel

# application
adb shell am start -W -n com.google.android.calculator/com.android.calculator2.Calculator
adb shell dumpsys window | grep 'mCurrentFocus'
adb shell am force-stop com.twitter.android

# user input (1080x2400)
adb shell input tap 540 2200
adb shell input touchscreen swipe 540 2000 540 1000 300
adb shell input touchscreen swipe 540    0 540 1000 300
adb shell input text "hello"

adb push file /sdcard
adb pull /sdcard/file

adb reboot

Modify the source code

# aosp/mm/page_alloc.c 'heart'

	if (order >= 4) {
		printk("my_info start --------------------------");
		dump_stack();
		printk("my_info end   --------------------------");
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment