cfig / Android_boot_image_editor

Parsing and re-packing Android boot.img/vbmeta.img/payload.bin, supporting Android 15
Apache License 2.0
1.04k stars 232 forks source link

fail to unpack twrp img #52

Closed 99degree closed 3 years ago

99degree commented 3 years ago

./gradlew unpack

Task :unpack [main] WARN cfig.packable.PackableLauncher - [boot.img] will be handled by [BootImgParser] [main] WARN cfig.packable.PackableLauncher - 'unpack' sequence initialized [main] INFO cfig.packable.BootImgParser - header version 2 [main] WARN cfig.bootimg.v2.BootHeaderV2 - BootImgHeader constructor [main] INFO cfig.Avb - python aosp/avb/avbtool.v1.2.py verify_image --image boot.img Verifying image boot.img using embedded public key vbmeta: Successfully verified footer and NONE vbmeta struct in boot.img boot: Successfully verified sha256 hash of boot.img for image of 37031936 bytes [main] INFO KernelExtractor - [python, aosp/build/tools/extract_kernel.py, --input, build/unzip_boot/kernel, --output-configs, build/unzip_boot/kernel_configs.txt, --output-version, build/unzip_boot/kernel_version.txt] [main] INFO KernelExtractor - kernel version: [4.14.191] [main] INFO KernelExtractor - kernel config dumped to : build/unzip_boot/kernel_configs.txt [main] INFO Helper - CMD: [lz4, -t, build/unzip_boot/ramdisk.img], workDir: null Error 44 : Unrecognized header : file cannot be decoded [main] ERROR Helper - org.apache.commons.exec.ExecuteException: Process exited with an error: 44 (Exit value: 44): can not exec command [main] ERROR cfig.packable.BootImgParser - ramdisk is in unknown format [main] ERROR cfig.packable.BootImgParser - Parser can not continue [main] WARN cfig.packable.PackableLauncher - 'unpack' sequence completed

git latest commit 50273a9085ecb56d7c22ccfc3ebafab5ebd01d8c (HEAD -> master, tag: android-11, origin/master, origin/HEAD) Author: cfig yuyezhong@gmail.com Date: Sun Feb 21 23:32:42 2021 +0800

use mavenCentral in light of JCenter shutdown

img file: https://eu.dl.twrp.me/coral/twrp-3.5.0_10-1-coral.img

cfig commented 3 years ago

Latest master branch can support lzma ramdisk. The attached twrp image declared its header version is 2, but it didn't have DTB, so "pack" task will fail. To fix this, you need to modify "build/unzip_boot/boot.json" , like this:

-   "headerVersion" : 2,
+   "headerVersion" : 1,
99degree commented 3 years ago

Thx for your quick follow up!