Closed 99degree closed 1 year ago
Some checking fails when trying to parse AVB info from image:
17:33:50.693 [main] INFO cfig.Avb - python aosp/avb/avbtool.v1.2.py verify_image --image boot.img
aosp/avb/avbtool.v1.2.py: Given image does not look like a vbmeta image.
You can quickly bypass the error by simply comment out the following line:
diff --git a/bbootimg/src/main/kotlin/bootimg/v2/BootV2.kt b/bbootimg/src/main/kotlin/bootimg/v2/BootV2.kt
index ca49556..46a0ddb 100644
--- a/bbootimg/src/main/kotlin/bootimg/v2/BootV2.kt
+++ b/bbootimg/src/main/kotlin/bootimg/v2/BootV2.kt
@@ -228,7 +228,7 @@ data class BootV2(
fun extractVBMeta(): BootV2 {
if (this.info.verify.startsWith("VB2.0")) {
- AVBInfo.parseFrom(Dumpling(info.output)).dumpDefault(info.output)
+ //AVBInfo.parseFrom(Dumpling(info.output)).dumpDefault(info.output)
if (File("vbmeta.img").exists()) {
log.warn("Found vbmeta.img, parsing ...")
VBMetaParser().unpack("vbmeta.img")
I will check the details a little later
nice let me try this out.
just some background info. the boot.img is directly adb pull /dev/block/by-name/boot the resulting boot.img is not original los but highly possibly concat by modified los boot.img (by this editor) w/ some sparse remaining from previous(? many times before) flashed data such that it might get mis-interpeted.
hope this might help understood this situation better. so there might be a chance to chop the boot.img from the big bin.img itself before process.
It seems the "vbmeta metadata" part of the "boot.img" is broken. If I did some tricks in the the ending area of the image, by erasing the last 1024bytes, which has "AVB footer", the tool can parse the boot.img, without any "vbmeta metada".
mv boot.img boot.img.orig
dd if=boot.img.orig of=boot.img bs=1024 count=131071
./gradlew unpack
So it would help if you have the original correct boot.img to do parsing.
nice. let me close this issue.
remote: Enumerating objects: 82, done. remote: Counting objects: 100% (75/75), done. remote: Compressing objects: 100% (8/8), done. remote: Total 22 (delta 10), reused 22 (delta 10), pack-reused 0 Unpacking objects: 100% (22/22), 3.34 KiB | 59.00 KiB/s, done. From https://github.com/cfig/Android_boot_image_editor 95ee9b6..d0dfebd master -> origin/master Updating 95ee9b6..d0dfebd Fast-forward .github/workflows/main.yml | 2 +- README.md | 17 ++--------------- bbootimg/build.gradle.kts | 2 +- bbootimg/src/main/kotlin/utils/SparseImgParser.kt | 10 ++-------- build.gradle.kts | 30 ------------------------------ helper/src/main/kotlin/cfig/helper/ZipHelper.kt | 3 +++ settings.gradle.kts | 8 -------- 7 files changed, 9 insertions(+), 63 deletions(-) root@LAPTOP:~/source/Android_boot_image_editor# adb pull /dev/block/by-name/boot /dev/block/by-name/boot: 1 file pulled, 0 skipped. 34.6 MB/s (134217728 bytes in 3.697s) root@LAPTOP:~/source/Android_boot_image_editor# mv boot boot.img root@LAPTOP boot.zip :~/source/Android_boot_image_editor# ./gradlew unpack Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':unpack'.
Try:
Get more help at https://help.gradle.org
BUILD FAILED in 3m 34s 10 actionable tasks: 8 executed, 2 up-to-date