All Projects → cfig → Android_boot_image_editor

cfig / Android_boot_image_editor

Licence: apache-2.0
Parsing and re-packing Android boot.img/vbmeta.img, supporting Android 11

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Android boot image editor

awesome-oneplus-3t
一加 3T ROM、内核(Kernel)、固件(Firmware)、Recovery、框架(Framework)、软件(APP)
Stars: ✭ 45 (-82.56%)
Mutual labels:  recovery, rom
H81M-DS2-Hackintosh
Thís repository contain files needed for GA-H81M-DS2 Hackintosh. Only OpenCore supported
Stars: ✭ 12 (-95.35%)
Mutual labels:  boot
first nes
Create your own games for the Nintendo Entertainment System! This "starter" game is easily extensible for your own projects. Includes references.
Stars: ✭ 94 (-63.57%)
Mutual labels:  rom
pi-encrypted-boot-ssh
🔑 Raspberry Pi Encrypted Boot with Remote SSH
Stars: ✭ 96 (-62.79%)
Mutual labels:  boot
tsioc
AOP, Ioc container, Boot framework, unit testing framework , activities workflow framework.
Stars: ✭ 15 (-94.19%)
Mutual labels:  boot
RecoverPy
🙈 Interactively find and recover deleted or 👉 overwritten 👈 files from your terminal
Stars: ✭ 189 (-26.74%)
Mutual labels:  recovery
squashible
Cross-Platform Linux Live Image Builder
Stars: ✭ 22 (-91.47%)
Mutual labels:  boot
systemboot
SystemBoot is a LinuxBoot distribution that works as a system firmware + bootloader, based on u-root
Stars: ✭ 103 (-60.08%)
Mutual labels:  boot
mkosxinstallusb
Linux shell script that creates USB flash drive booting OS X installer
Stars: ✭ 34 (-86.82%)
Mutual labels:  boot
android bootable recovery
The heart ❤️ of PBRP
Stars: ✭ 53 (-79.46%)
Mutual labels:  recovery
spring-boot-mongodb-security-angular8
Spring Boot, Security, MongoDB, Angular 8: Build Authentication
Stars: ✭ 17 (-93.41%)
Mutual labels:  boot
clr-boot-manager
Kernel & Boot Loader Management
Stars: ✭ 101 (-60.85%)
Mutual labels:  boot
op-test
Testing Firmware for OpenPOWER systems
Stars: ✭ 30 (-88.37%)
Mutual labels:  boot
Level-Headed
Random Level Generator for Super Mario Bros. 1 on the NES
Stars: ✭ 100 (-61.24%)
Mutual labels:  rom
X99-Deluxe-II
Files for Asus X99 Deluxe II hackintosh.
Stars: ✭ 17 (-93.41%)
Mutual labels:  boot
ainur narsil
Sauron audiomod developed with many experimental tweaks to squeeze more from your device in terms of sound
Stars: ✭ 61 (-76.36%)
Mutual labels:  recovery
dracut-crypt-sshd
dracut initramfs module to start sshd on early boot to enter encryption passphrase from across the internets
Stars: ✭ 25 (-90.31%)
Mutual labels:  boot
grub-iso-multiboot
grab a .iso, put in a folder, boot it up.
Stars: ✭ 53 (-79.46%)
Mutual labels:  boot
zfs-installer
Shell script program that prepares ZFS on a system, and installs Linux
Stars: ✭ 137 (-46.9%)
Mutual labels:  boot
extract otp secret keys
Extract two-factor authentication (2FA, TFA) secret keys from export QR codes of "Google Authenticator" app
Stars: ✭ 217 (-15.89%)
Mutual labels:  recovery

Android_boot_image_editor

CI License

A tool for reverse engineering Android ROM images.

Getting Started

install required packages

Mac: brew install lz4 xz dtc

Linux: sudo apt install git device-tree-compiler lz4 xz-utils zlib1g-dev openjdk-11-jdk gcc g++ python3

Windows: Make sure you have python3, JDK9+ and openssl properly installed. An easy way is to install Anaconda and Oracle JDK 11, then run the program under anaconda PowerShell.

Parsing and packing

Put your boot.img to current directory, then start gradle 'unpack' task:

cp <original_boot_image> boot.img
./gradlew unpack

Your get the flattened kernel and /root filesystem under ./build/unzip_boot:

build/unzip_boot/
├── boot.json     (boot image info)
├── boot.avb.json (AVB only)
├── kernel
├── second        (2nd bootloader, if exists)
├── dtb           (dtb, if exists)
├── dtbo          (dtbo, if exists)
└── root          (extracted initramfs)

Then you can edit the actual file contents, like rootfs or kernel. Now, pack the boot.img again

./gradlew pack

You get the repacked boot.img at $(CURDIR):

boot.img.signed

Well done you did it! The last step is to star this repo :smile

live demo

Supported ROM image types

Image Type file names
boot images boot.img, vendor_boot.img
recovery images recovery.img, recovery-two-step.img
vbmeta images vbmeta.img, vbmeta_system.img etc.
dtbo images dtbo.img

Please note that the boot.img MUST follows AOSP verified boot flow, either Boot image signature in VBoot 1.0 or AVB HASH footer (a.k.a. AVB) in VBoot 2.0.

compatible devices

Device Model Manufacturer Compatible Android Version Note
Pixel 3 (blueline) Google Y 11 (RP1A.200720.009,
2020)
more ...
Pixel 3 (blueline) Google Y Q preview (qpp2.190228.023,
2019)
more ...
Pixel XL (marlin) HTC Y 9.0.0 (PPR2.180905.006,
Sep 2018)
more ...
K3 (CPH1955) OPPO Y for recovery.img
N for boot.img
Pie more
Z18 (NX606J) ZTE Y 8.1.0 more...
Nexus 9 (volantis/flounder) HTC Y(with some tricks) 7.1.1 (N9F27M, Oct 2017) tricks
Nexus 5x (bullhead) LG Y 6.0.0_r12 (MDA89E)
Moto X (2013) T-Mobile Motorola N
X7 (PD1602_A_3.12.8) VIVO N ? Issue 35

more examples

  • recovery.img

If you are working with recovery.img, the steps are similar:

cp <your_recovery_image> recovery.img
./gradlew unpack
./gradlew pack
  • vbmeta.img
cp <your_vbmeta_image> vbmeta.img
./gradlew unpack
./gradlew pack
  • boot.img and vbmeta.img
cp <your_boot_image> boot.img
cp <your_vbmeta_image> vbmeta.img
./gradlew unpack
./gradlew pack

Your boot.img.signed and vbmeta.img.signd will be updated together.

boot.img layout

Read layout of Android boot.img and vendor_boot.img.

References

more ...

Android version list https://source.android.com/source/build-numbers.html
Android build-numbers https://source.android.com/setup/start/build-numbers

cpio & fs_config
https://android.googlesource.com/platform/system/core
https://www.kernel.org/doc/Documentation/early-userspace/buffer-format.txt
AVB
https://android.googlesource.com/platform/external/avb/
boot_signer
https://android.googlesource.com/platform/system/extras
mkbootimg
https://android.googlesource.com/platform/system/tools/mkbootimg/+/refs/heads/master/
kernel info extractor
https://android.googlesource.com/platform/build/+/refs/heads/master/tools/extract_kernel.py
mkdtboimg
https://android.googlesource.com/platform/system/libufdt/
libsparse
https://android.googlesource.com/platform/system/core/+/refs/heads/master/libsparse/
Android Nexus/Pixle factory images
https://developers.google.cn/android/images

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].