cfig / Android_boot_image_editor

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

boot.img flag support what? #100

Closed qianmo-xw closed 1 year ago

qianmo-xw commented 1 year ago

When I unpack boot.img,I get boot.avb.json just like vbmeta.avb.json.I Know vbmeta.avb.json flag such as 0 1 2 3 mean what,But I don't Know boot.avb.json flag. When I change boot.sig.avb.json flag it report error...

qianmo-xw commented 1 year ago

this is when I change bootsig.avb.json It report error

19:51:45.857 [main] INFO Helper - boot.img.clear hash 0f9d106ccf45a4218030e312ab29ba443393617c, boot.img.google hash 84fc3c96ac580fa8cc67348802e0636f70ec2a33 19:51:45.857 [main] ERROR Helper - Hash verification failed 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:108) Caused by: java.lang.UnknownError: Do not know why hash verification fails, maybe a bug at cfig.helper.Helper$Companion.assertFileEquals(Helper.kt:319) at cfig.bootimg.v3.BootV3.pack(BootV3.kt:191) at cfig.packable.BootImgParser.pack(BootImgParser.kt:92) ... 8 more

Task :pack FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4s 13 actionable tasks: 3 executed, 10 up-to-date

cfig commented 1 year ago

It has the same meaning as vbmeta.avb.json. But obviously, changing flag bits in "boot.avb.json" is not well supported :) Do you have real world requirement to change the flags? For debugging?

qianmo-xw commented 1 year ago

It has the same meaning as vbmeta.avb.json. But obviously, changing flag bits in "boot.avb.json" is not well supported :) Do you have real world requirement to change the flags? For debugging?

I even don't know boot.avb.json flag mean what.also has the same meaning as vbmeta.avb.json? when I use magisk 24.3 Patch boot can normal boot ,but use magisk 25.2 device into 900E, So I think flag will help me...

cfig commented 1 year ago

怀疑flag的话,可以直接把vbmeta.img的flag设置成2,就禁用所有verification, 后面所有image的flag不需要设。

How to disable AVB verification
The idea is to set flag=2 in main vbmeta.

rm *.img
cp <your_vbmeta_image> vbmeta.img
./gradlew unpack
vim -u NONE -N build/unzip_boot/vbmeta.avb.json  -c ":19s/0/2/g" -c ":wq"
./gradlew pack
Then flash vbmeta.img.signed to your device.
qianmo-xw commented 1 year ago

怀疑flag的话,可以直接把vbmeta.img的flag设置成2,就禁用所有verification, 后面所有image的flag不需要设。

How to disable AVB verification
The idea is to set flag=2 in main vbmeta.

rm *.img
cp <your_vbmeta_image> vbmeta.img
./gradlew unpack
vim -u NONE -N build/unzip_boot/vbmeta.avb.json  -c ":19s/0/2/g" -c ":wq"
./gradlew pack
Then flash vbmeta.img.signed to your device.

你是中国人吗哈哈哈哈

cfig commented 1 year ago

哈哈哈哈~magisk未必能把所有boot image 改好。可以自己去改,改完刷上去试。

cfig commented 1 year ago

Close it for now. You can reopen it if you still have any questions.