(Working on an all in one combined script. Soon repo will be pushed and made public)
A collection of powerful tools designed to kickstart your Android ROM development and customization.
As a beginner in Android ROM development and customization, I've gathered tools along my journey to make them easily accessible for beginners.
Get the Files from Releases:
๐ Android Dev Tools Release
As a beginner in Android ROM development and customization, I have collected some tools to that are required to extract the required blobs to build device tree from an ota update package.
Strictly use Linux โ It's essential for ROM development.
Avoid WSL โ Too many limitations for this process.
Bare-metal Linux is best โ If you can't install Linux natively, use a Linux VM.
Oracle VirtualBox is a better alternative to WSL, but expect slower builds (several hours to days).
Check out minimum system requirements:
๐ Android Build Requirements
Each tool contains a README.md inside its respective folder with detailed usage instructions.
Below is a quick overview for advanced users who prefer a fast reference.
If you have an OTA update containing payload.bin, use payload-dumper-go inside payload.bin-unpackor:
- Set execution permissions:
chmod +x payload-dumper-go 2๏ธ) Add the tool to your PATH:
export PATH=$PATH:/path/to/payload-dumper-go3๏ธ) Extract payload.bin:
payload-dumper-go /path/to/payload.binYou now have unpacked images (boot, dtbo, system, vendor, etc.).
If you don't have payload.bin but instead have sparse chunks, follow these steps:
Inside super.img-extractor, run:
./simg2img system.img_sparsechunk.* super.img./lpunpack super.img /super_unpackedYou will get system, vendor, system_a, system_b, vendor_a, vendor_b images.
If an error occurs (vendor_b.img not found), create an empty file to bypass:
mkdir super_unpacked; cd super_unpacked; touch vendor_b.imgNow you have all images extracted from the firmware.
When extracting device tree blobs (DTB), kernel files, and embedded partitions, different methods apply based on the image format. Hereโs a step-by-step guide covering all approaches, including the manual dd method for stubborn files.
Note: If you got the expected files from the firmware just skip the steps.
Before extracting, install essential tools:
sudo apt update && sudo apt install -y binwalk simg2img lz4 squashfs-tools mountAdditional Dependencies:
pip install protobufSome extraction tools may require Python dependencies like protobuf.
First, check the format of .img files:
file *.imgIf Erofs, SquashFS, Ext4, or another format, use the relevant method below.
For EROFS-formatted partitions, use:
./erofsUnpackRust_x64linux system_a.imgFiles will be unpacked.
Alternatively, mount EROFS manually on Linux:
mkdir mount_point
sudo mount -t erofs system_a.img mount_point/Now browse the extracted files inside mount_point/.
If the image contains embedded files (such as kernel or DTB blobs), use Binwalk for deep extraction:
binwalk -Me name.imgExtracted data is stored inside auto-generated folders.
If you only need a content list, without extracting:
binwalk -Me -r name.imgAdditional Extraction with Binwalk:
If Binwalk does not properly extract the data, use dd to manually carve out sections based on offsets as mentioned in Step 8.
Some devices store kernel and DTB files inside boot.img, vendor_boot.img, or dtbo.img.
Install the tool:
git clone https://github.com/xblax/bootimg-tools.gitcd bootimg-tools
chmod +x split_bootimg.pl
Extract boot image components:
```bash
./split_bootimg.pl boot.img
Generates extracted files such as:
-
kernel -
ramdisk -
dtbIf DTB is missing, extract manually using
dd:
dd if=boot.img of=dtb.img bs=1 skip=<offset>(Replace <offset> with actual DTB location found using Binwalk.)
For extracting boot partitions (boot.img, vendor_boot.img, etc.), use Android Boot Image Editor:
Clone and install:
git clone https://github.com/cfig/Android_boot_image_editor.git
cd Android_boot_image_editor
chmod +x gradlew Unpack boot image:
./gradlew unpackExtracted files appear in image-unpack-repack/build/.
After extracting each .img, clear the build folder to avoid conflicts.
For extracting vendor binary blobs:
./extract-proprietary-files.shThis copies vendor blobs into the correct AOSP directory. (This wont for every source)
Manually extracting vendor.img:
simg2img vendor.img vendor.raw.img
mkdir vendor_mount
sudo mount -o loop vendor.raw.img vendor_mount/You can now browse vendor files inside vendor_mount/.
When other methods fail, manually extract files using dd.
1๏ธ) Find offsets using Binwalk:
binwalk -E name.imgThis displays embedded file locations.
2๏ธ) Extract data manually:
dd if=name.img of=extracted_file bs=1 skip=<offset> count=<size>-
skip=<offset>= Starting byte (found using Binwalk). -
count=<size>= Size of the file (estimate based on previous extractions).This method works when automated extractors fail!
Always check the image format first.
Use the appropriate extraction tool (Binwalk, simg2img, dd, etc.).
If extraction fails, try a combination of multiple methods.
Clear build folders after unpacking to keep things organized.
This project is a collection of open-source tools.
Each tool contains its own respective license file.
Thanks to the amazing developers who created these essential tools!
| Tool | Developer | Repository |
|---|---|---|
| Binwalk | @ReFirmLabs | ๐ GitHub Repo |
| DTC (Device Tree Compiler) | @dgibson | ๐ GitHub Repo |
| Payload Dumper Go | @ssut | ๐ GitHub Repo |
| Android Boot Image Editor | @cfig | ๐ GitHub Repo |
| bootimg-tool | @xblax | ๐ GitHub Repo |
๐ A huge shoutout to these developers for building such powerful tools that make ROM development easier for everyone!