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

lineageos official recovery img cant unpack #62

Closed 99degree closed 3 years ago

99degree commented 3 years ago

The img like is at bottom.

log:

Task :unpack FAILED 23:32:01:945 WARN PackableLauncher - [boot.img] will be handled by [BootImgParser] 23:32:02:041 WARN PackableLauncher - 'unpack' sequence initialized 23:32:02:045 INFO BootImgParser - header version 1 23:32:02:057 WARN BootHeaderV2 - BootImgHeader constructor 23:32:02:061 INFO Avb - python aosp/avb/avbtool.v1.2.py verify_image --image boot.img sha256 digest of recovery.img does not match digest in descriptor aosp/avb/avbtool.v1.2.py: Error verifying descriptor. Verifying image boot.img using embedded public key vbmeta: Successfully verified footer and NONE vbmeta struct in boot.img Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:113) at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:108) at cfig.packable.PackableLauncherKt.main(PackableLauncher.kt:106) Caused by: java.lang.IllegalArgumentException: boot.img failed integrity check by "python aosp/avb/avbtool.v1.2.py verify_image --image boot.img" at cfig.Avb$Companion.verifyAVBIntegrity(Avb.kt:474) at cfig.bootimg.v2.BootV2$Companion.parse(BootV2.kt:98) at cfig.packable.BootImgParser.unpack(BootImgParser.kt:45) ... 8 more

FAILURE: Build failed with an exception.

BUILD FAILED in 2s 20 actionable tasks: 1 executed, 19 up-to-date root@LAPTOP-VDEV89N4:~/source/Android_boot_image_editor# cp /mnt/c/d_drive/aosp/lineage-17.1-20210526-recovery-davinci.img boot.img root@LAPTOP-VDEV89N4:~/source/Android_boot_image_editor# ./gradlew unpack

Task :unpack FAILED 23:32:27:693 WARN PackableLauncher - [boot.img] will be handled by [BootImgParser] 23:32:27:786 WARN PackableLauncher - 'unpack' sequence initialized 23:32:27:793 INFO BootImgParser - header version 1 23:32:27:805 WARN BootHeaderV2 - BootImgHeader constructor 23:32:27:810 INFO Avb - python aosp/avb/avbtool.v1.2.py verify_image --image boot.img sha256 digest of recovery.img does not match digest in descriptor aosp/avb/avbtool.v1.2.py: Error verifying descriptor. Verifying image boot.img using embedded public key vbmeta: Successfully verified footer and NONE vbmeta struct in boot.img Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:113) at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:108) at cfig.packable.PackableLauncherKt.main(PackableLauncher.kt:106) Caused by: java.lang.IllegalArgumentException: boot.img failed integrity check by "python aosp/avb/avbtool.v1.2.py verify_image --image boot.img" at cfig.Avb$Companion.verifyAVBIntegrity(Avb.kt:474) at cfig.bootimg.v2.BootV2$Companion.parse(BootV2.kt:98) at cfig.packable.BootImgParser.unpack(BootImgParser.kt:45) ... 8 more

FAILURE: Build failed with an exception.

BUILD FAILED in 2s

https://mirrorbits.lineageos.org/recovery/davinci/20210526/lineage-17.1-20210526-recovery-davinci.img

cfig commented 3 years ago

change cp /mnt/c/d_drive/aosp/lineage-17.1-20210526-recovery-davinci.img boot.img to -> cp /mnt/c/d_drive/aosp/lineage-17.1-20210526-recovery-davinci.img recovery.img should fix the error.

Can you have a try?

99degree commented 3 years ago

yes it does ok. thx for reply. so any possibly merge boot and recovery procedure altogether maybe?

cfig commented 3 years ago

Latest code in "master" branch will ignore avb verify errors. :)