This tool focuses on editing Android boot.img(also recovery.img, and vbmeta.img).
A tool for reverse engineering Android ROM images. (working on  and )
## 1. Prerequisite
#### 1.1 Host OS requirement:
## Getting Started
 or  development env. To get the most of the toolkit, following packages are also needed: python, jdk 8+, zlib1g-dev, cpio, device-tree-compiler.
#### Installation
* install required packages
#### 1.2 Target Android requirement:
(1) Target boot.img MUST follows AOSP verified boot flow, either [Boot image signature](https://source.android.com/security/verifiedboot/verified-boot#signature_format) in VBoot 1.0 or [AVB HASH footer](https://android.googlesource.com/platform/external/avb/+/master/README.md#The-VBMeta-struct) (a.k.a. AVB) in VBoot 2.0.
Put your boot.img to current directory, then start gradle 'unpack' task:
cp <original_boot_image> boot.img
./gradlew unpack
```bash
cp <original_boot_image> boot.img
./gradlew unpack
```
Your get the flattened kernel and /root filesystem under **./build/unzip\_boot**:
@ -64,28 +54,28 @@ You get the repacked boot.img at $(CURDIR):
boot.img.signed
Well done you did it! The last step is to add the star to this repo :smile
Well done you did it! The last step is to star this repo :smile
#### If you are working with recovery.img
If you are working with recovery.img, the steps are similar:
cp <original_recovery_image> recovery.img
./gradlew unpack
./gradlew pack
And you get recovery.img.signed
### live demo
<!--  -->
<palign="center">
<imgsrc=doc/op.gifwidth="615"height="492">
</p>
## Supported ROM image types
### usage demo

## 3. example & test
An example boot.img has been placed at **src/test/resources/boot.img**, which is extracted from Nexus 5x(code: bullhead) factory images from [Google](https://dl.google.com/dl/android/aosp/bullhead-mda89e-factory-29247942.tgz), you can take it as a quick start.
| vbmeta images | vbmeta.img, vbmeta_system.img etc. | |
| sparse images | system.img, vendor.img etc. | |
| dtbo images | dtbo.img | |
## 4. boot.img layout
Read [layout](doc/layout.md) of Android boot.img and vendor\_boot.img.
Please note that the boot.img MUST follows AOSP verified boot flow, either [Boot image signature](https://source.android.com/security/verifiedboot/verified-boot#signature_format) in VBoot 1.0 or [AVB HASH footer](https://android.googlesource.com/platform/external/avb/+/master/README.md#The-VBMeta-struct) (a.k.a. AVB) in VBoot 2.0.
## 5. compatible devices
## compatible devices
| Device Model | Manufacturer | Compatible | Android Version | Note |