From 4f598e07cf9fa1e7857889b5dce7c13efa026b57 Mon Sep 17 00:00:00 2001 From: cfig Date: Tue, 11 Sep 2018 21:13:03 +0800 Subject: [PATCH] Update README.md --- README.md | 39 ++++++++++++++++++++++++++++----------- bbootimg/build.gradle | 2 +- doc/additional_tricks.md | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 doc/additional_tricks.md diff --git a/README.md b/README.md index 137a062..ce5037a 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,32 @@ # Android_boot_image_editor [![Build Status](https://travis-ci.org/cfig/Android_boot_image_editor.svg?branch=master)](https://travis-ci.org/cfig/Android_boot_image_editor) [![License](http://img.shields.io/:license-apache-blue.svg?style=flat-square)](http://www.apache.org/licenses/LICENSE-2.0.html) +[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/Android_boot_image_editor/lobby) This tool focuses on editing Android boot.img(also recovery.img, recovery-two-step.img and vbmeta.img). -## Prerequisite -#### Host OS requirement: +## 1. Prerequisite +#### 1.1 Host OS requirement: Linux or Mac. Also need python 2.x(required by avbtool) and java 8. -#### Target Android requirement: +#### 1.2 Target Android requirement: -(1) Target boot.img(or recovery.img / recovery-two-step.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) in VBoot 2.0. +(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) in VBoot 2.0. -(2) These utilities are known to work for Nexus/Pixel boot.img(or recovery.img/recovery-two-step.img/vbmeta.img) for the following Android releases: +Supported images: + - boot.img + - recovery.img + - recovery-two-step.img + - vbmeta.img + +(2) These utilities are known to work for Nexus/Pixel boot.img for the following Android releases: - AOSP master - Lollipop (5.0) - Pi (9) -You can get a full [Android version list](https://source.android.com/source/build-numbers.html) here. - -## Usage +## 2. Usage Get tools via git: git clone https://github.com/cfig/Android_boot_image_editor.git @@ -60,14 +65,23 @@ If you are working with recovery.img, the steps are similar: And you get recovery.img.signed -## example & test +## 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. -## boot.img layout +## 4. boot.img layout Read [layout](README.expert.md) of Android boot.img. We now support both VB 1.0 and AVB 2.0 layouts. -## References +## 5. compatible devices + +| Device Model | Manufacturer | Compatible | Android Version | Note | +|--------------------------------|--------------|----------------------|--------------------------|------| +| Pixel XL (marlin) | HTC | Y | 9.0.0 (PPR2.180905.006,
Sep 2018)| [more ...](doc/additional_tricks.md#pixel-xl-marlin) | +| Nexus 9 (volantis/flounder) | HTC | Y(with some tricks) | 7.1.1 (N9F27M, Oct 2017) | [tricks](doc/additional_tricks.md#tricks-for-nexus-9volantis)| +| Nexus 5x (bullhead) | LG | Y | 6.0.0_r12 (MDA89E) | | +| Moto X (2013) T-Mobile | Motorola | N | | | + +## 6. References boot\_signer https://android.googlesource.com/platform/system/extras @@ -80,3 +94,6 @@ https://android.googlesource.com/platform/system/core AVB https://android.googlesource.com/platform/external/avb/ + +Android version list +https://source.android.com/source/build-numbers.html diff --git a/bbootimg/build.gradle b/bbootimg/build.gradle index 77c5da7..25e91fa 100644 --- a/bbootimg/build.gradle +++ b/bbootimg/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - kotlinVersion = '1.2.41' + kotlinVersion = '1.2.61' } repositories { mavenCentral() diff --git a/doc/additional_tricks.md b/doc/additional_tricks.md new file mode 100644 index 0000000..9fc48db --- /dev/null +++ b/doc/additional_tricks.md @@ -0,0 +1,39 @@ +## tricks for Nexus 9(volantis) + +**volantis** has a dummy header of size 256 bytes, which looks like this: + + 0000000: 78 56 34 12 00 00 00 00 00 ba 86 00 00 01 00 00 xV4............. + 0000010: 00 01 00 00 00 b8 86 00 00 b9 86 00 00 01 00 00 ................ + 0000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 0000100: 41 4e 44 52 4f 49 44 21 72 64 6d 00 00 80 00 10 ANDROID!rdm..... + 0000110: d0 41 19 00 00 00 00 11 00 00 00 00 00 00 f0 10 .A.............. + +We have to trim the header before it can be recognized by our toy. + + $ dd if=boot.img of=raw_boot bs=256 skip=1 + +Now we can work with 'raw\_boot' + + $ cp raw_boot boot.img + $ gradle unpack + $ gradle pack + +## Pixel XL (marlin) + +**marlin** is a profile that adopts A/B system schema while still using Verified Boot 1.0 style boot image. + +Due to the configuration "BOARD_BUILD_SYSTEM_ROOT_IMAGE := true", the embeded ramdisk in boot.img is actually used in recovery mode. +