Android_boot_image_editor icon indicating copy to clipboard operation
Android_boot_image_editor copied to clipboard

compatibility check: verify as many ROMs and devices as possible

Open cfig opened this issue 7 years ago • 22 comments

We want to know how many device ROMs can be edited with this tool, which helps new comers. If you use this tool for your debugging work or hacking, please kindly drop a comment.

cfig avatar May 21 '18 14:05 cfig

Confirmed working with Oppo K3(CPH1955) recovery.img (with some tricks - to get recovery.img out from boot.img using a bsdiff patch under system because didn't work with boot.img)

Surendrajat avatar Sep 21 '19 14:09 Surendrajat

@Surendrajat Thanks for the kindness! This helps others.

cfig avatar Sep 22 '19 03:09 cfig

Hi @Surendrajat , could you provide more info such as its Android version details?

Device Model Manufacturer Compatible Android Version Note
Pixel 3 (blueline) Google Y Q preview (qpp2.190228.023, <Br>2019)
Nexus 9 (volantis/flounder) HTC Y(with some tricks) 7.1.1 (N9F27M, Oct 2017) [tricks]
K3 (CPH1955) OPPO Y (recovery.img) ??? [tricks]

cfig avatar Sep 22 '19 03:09 cfig

Absolutely. Pie it is. I will open a PR for tricks about how to get recovery.img.

Surendrajat avatar Sep 22 '19 03:09 Surendrajat

@cfig Done #32

Surendrajat avatar Sep 22 '19 03:09 Surendrajat

Xiaomi Redmi K30 4g(phoenix[n]) (LOS-like ROM android10 )boot.img with vbmeta.img modification works.

eebssk1 avatar Apr 10 '21 16:04 eebssk1

Xiaomi Redmi K30 4g(phoenix[n]) (LOS-like ROM)boot.img with vbmeta.img modification works.

Thank you! It would be better if you can provide more info like Android Version, download links of stock images(or 3rd party images).

cfig avatar Apr 11 '21 15:04 cfig

Worked with Topway TS10 firmware (Android10) China car Android headunit

Does not work after image patched with magisk but I think this is out of scope here

mariodantas avatar May 27 '21 20:05 mariodantas

Worked with Topway TS10 firmware (Android10) China car Android headunit

Does not work after image patched with magisk but I think this is out of scope here

Magisk directly patch the kernel to force load the ramdisk. It's not very recommended to modify magisk patched image with these tool. Modify the original image and then install magisk if possible.

eebssk1 avatar May 28 '21 07:05 eebssk1

Worked with Topway TS10 firmware (Android10) China car Android headunit Does not work after image patched with magisk but I think this is out of scope here

Magisk directly patch the kernel to force load the ramdisk. It's not very recommended to modify magisk patched image with these tool. Modify the original image and then install magisk if possible.

Thanks for the tip

mariodantas avatar May 28 '21 09:05 mariodantas

In fact I wasn't trying to modify the patched image, I was trying to understand why I had an error (like the one in the attached PNG below) with the magisk patched image, it seems like Magisk is not doing the job supposed to be done correctly:

The test was done because my unit don't boot with magisk patched image

screenshot-2021-05-28 131120

mariodantas avatar May 28 '21 11:05 mariodantas

In fact I wasn't trying to modify the patched image, I was trying to understand why I had an error (like the one in the attached PNG below) with the magisk patched image, it seems like Magisk is not doing the job supposed to be done correctly:

The test was done because my unit don't boot with magisk patched image

screenshot-2021-05-28 131120

Because magisk modifies the content so the signature will no longer match.However this should'nt happen as magisk resign the image with its own key..

Maybe signature in vbmeta is not changed when resigning,whch causes the error.Maybe you can open a issue at magisk repo for this..

eebssk1 avatar May 28 '21 12:05 eebssk1

In fact I wasn't trying to modify the patched image, I was trying to understand why I had an error (like the one in the attached PNG below) with the magisk patched image, it seems like Magisk is not doing the job supposed to be done correctly: The test was done because my unit don't boot with magisk patched image screenshot-2021-05-28 131120

Because magisk modifies the content so the signature will no longer match.However this should'nt happen as magisk resign the image with its own key..

Maybe signature in vbmeta is not changed when resigning,whch causes the error.Maybe you can open a issue at magisk repo for this..

I did, he closed the issue !

mariodantas avatar May 28 '21 16:05 mariodantas

I know that this is not the right place to post this but, I'd like to get this boot rooted as the unit works very bad with GPS (need to replace some configs in gps.conf / gps_debug.conf) and also need root privileges to user Alpha Backup Pro, and save y 2Gb of music data from deezer app

boot.zip.gz

mariodantas avatar May 28 '21 17:05 mariodantas

In fact I wasn't trying to modify the patched image, I was trying to understand why I had an error (like the one in the attached PNG below) with the magisk patched image, it seems like Magisk is not doing the job supposed to be done correctly: The test was done because my unit don't boot with magisk patched image screenshot-2021-05-28 131120

Because magisk modifies the content so the signature will no longer match.However this should'nt happen as magisk resign the image with its own key.. Maybe signature in vbmeta is not changed when resigning,whch causes the error.Maybe you can open a issue at magisk repo for this..

I did, he closed the issue !

you can disable the integrity check by

diff --git a/bbootimg/src/main/kotlin/avb/Avb.kt b/bbootimg/src/main/kotlin/avb/Avb.kt
index 6488c96..5884050 100644
--- a/bbootimg/src/main/kotlin/avb/Avb.kt
+++ b/bbootimg/src/main/kotlin/avb/Avb.kt
@@ -471,7 +471,7 @@ class Avb {
             try {
                 DefaultExecutor().execute(CommandLine.parse(cmdline))
             } catch (e: Exception) {
-                throw IllegalArgumentException("$fileName failed integrity check by \"$cmdline\"")
+                log.error("$fileName failed integrity check by \"$cmdline\"")
             }
         }

magisk patched boot.img can not pass AVB integrity check , but it doesn't matter if bootloader is unlocked, as the bootloader should always load the image for unlocked devices.

cfig avatar May 31 '21 08:05 cfig

Oh thanks fellow for that, all I want to do is "understand" whhat's wrong after magisk patch, cause my headunit does not boot with magisk patched boot image

mariodantas avatar May 31 '21 09:05 mariodantas

I tried to unpack the vendor boot image from Galaxy S22+ and 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.OutOfMemoryError: Java heap space at java.base/java.lang.StringCoding.decodeUTF8_0(StringCoding.java:768) at java.base/java.lang.StringCoding.decodeUTF8(StringCoding.java:725) at java.base/java.lang.StringCoding.decode(StringCoding.java:257) at java.base/java.lang.String.(String.java:507) at java.base/java.lang.String.(String.java:561) at cfig.bootimg.cpio.AndroidCpio$Companion.decompressCPIO(AndroidCpio.kt:280) at cfig.bootimg.Common$Companion.unpackRamdisk(Common.kt:355) at cfig.bootimg.Common$Companion.dumpRamdisk(Common.kt:167) at cfig.bootimg.v3.VendorBoot.extractImages(VendorBoot.kt:348) at cfig.packable.VendorBootParser.unpack(VendorBootParser.kt:34) ... 8 more :unpack (Thread[Execution worker for ':' Thread 6,5,main]) completed. Took 1.217 secs.

FAILURE: Build failed with an exception.

Can I provide any other useful info?

kereng77 avatar Apr 19 '22 08:04 kereng77

Hi, can you attach your image here? if it's not confidential .

cfig avatar Apr 19 '22 12:04 cfig

Sure - vendor_boot.tar.gz

kereng77 avatar Apr 19 '22 12:04 kereng77

Sure - vendor_boot.tar.gz

That's a bug. Just created an issue here: https://github.com/cfig/Android_boot_image_editor/issues/86

cfig avatar Apr 19 '22 16:04 cfig

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:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) 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:110) Caused by: java.lang.UnknownError: Do not know why hash verification fails, maybe a bug at cfig.helper.Helper$Companion.assertFileEquals(Helper.kt:336) at cfig.bootimg.v3.VendorBoot.pack(VendorBoot.kt:306) at cfig.packable.VendorBootParser.pack(VendorBootParser.kt:44) ... 8 more

repack failed vendor_boot.zip

arvanasoft avatar Jul 13 '23 04:07 arvanasoft

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:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) 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:110) Caused by: java.lang.UnknownError: Do not know why hash verification fails, maybe a bug at cfig.helper.Helper$Companion.assertFileEquals(Helper.kt:336) at cfig.bootimg.v3.VendorBoot.pack(VendorBoot.kt:306) at cfig.packable.VendorBootParser.pack(VendorBootParser.kt:44) ... 8 more

repack failed vendor_boot.zip

Recorded as: https://github.com/cfig/Android_boot_image_editor/issues/125

cfig avatar Jul 13 '23 14:07 cfig