cfig/Android_boot_image_editor

Header version error

iusearch opened this issue · 5 comments

[main] WARN cfig.packable.PackableLauncher - Active image target: boot.img
[main] INFO Packer - Loading config from build/unzip_boot/bootimg.json
[main] INFO Packer - Deleting build/unzip_boot/ramdisk.img.gz ...
[main] INFO Packer - Packing rootfs build/unzip_boot/root ...
[main] INFO Packer - ./aosp/mkbootfs/build/exe/mkbootfs/mkbootfs build/unzip_boot/root
[main] INFO Helper - compress(gz) done: build/unzip_boot/ramdisk.img.gz
[main] INFO Packer - build/unzip_boot/ramdisk.img.gz is ready
Exception in thread "main" java.lang.IllegalArgumentException: headerVersion 23169024 illegal
        at cfig.bootimg.BootImgHeader.refresh(BootImgHeader.kt:237)
        at cfig.bootimg.BootImgHeader.encode(BootImgHeader.kt:244)
        at cfig.Packer.pack(Packer.kt:149)
        at cfig.packable.BootImgParser.pack(BootImgParser.kt:71)
        at cfig.packable.PackableLauncherKt.main(PackableLauncher.kt:67)

> Task :pack FAILED
:pack (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 4.087 secs.
cfig commented

Hi, Can you attach your image here?

Thanks

Yea, I will send it tomorrow since the file is not on my PC, I will grab one and send it to you.

cfig commented
00000000: 414e 4452 4f49 4421 2af4 9800 0080 0080  ANDROID!*.......
00000010: ab09 7400 0000 0082 0000 0000 0000 f080  ..t.............
00000020: 0001 0080 0008 0000 0088 6101 0000 0000  ..........a.....
00000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000040: 636f 6e73 6f6c 653d 7474 7948 534c 302c  console=ttyHSL0,

See above hex dump of the header:
Value of the "header version filed" is "00 88 61 01", it's illegal. Valid values should be one of [0, 1, 2].
If this image is the official one, it should have private data fields which differ from AOSP definition.

Of course you can manually change the header version to "0" or "1" in "build/unzip_boot/bootimg.json" and re-pack it, but I'm not sure whether the repacked image can actually boot up or not.

Also I see "product.version=PD1602_A_3.12.8", is it for Vivo X7 ?
If confirmed, i can add this product into 'incompatability list'.

Thanks

Yeah, it is vivo X7, tried magisk but not booting. I may try modifying the header version and flash. I guess they have verification in their bootloader.