cfig / Android_boot_image_editor

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

Error when unpack oneplus9 payload.bin #130

Closed 5n0wfish closed 1 year ago

5n0wfish commented 1 year ago
15:50:39.581 [main] WARN  cfig.packable.PackableLauncher - [payload.bin] will be handled by [PayloadBinParser]
15:50:39.662 [main] WARN  cfig.packable.PackableLauncher - 'unpack' sequence initialized
15:50:39.664 [main] INFO  cfig.packable.IPackable - deleting build/unzip_boot/ ...
15:50:39.670 [main] INFO  Helper - deleting uiderrors
15:50:39.731 [main] INFO  cc.cfig.droid.ota.Payload - payload.bin size info check PASS
15:50:39.760 [main] INFO  cc.cfig.droid.ota.Payload - calc meta hash: 546c5bf1fbb0ca1524822f584471470bf9b2fd30c464bf5c970e0d1772369af3
15:50:57.311 [main] INFO  cc.cfig.droid.ota.Payload - calc payload hash: 538aa48d0d3118f09361e364bfc97f47e2e3d4fd8fd32597acdddf9323e61813
15:50:57.314 [main] INFO  cc.cfig.droid.ota.Payload - Found sig count: 1
15:50:57.315 [main] INFO  cc.cfig.droid.ota.Payload - <ByteString@2fea7088 size=256 contents="GN6\326G\266\a\r\240\365gCW\246\335\2051\274\325/\337/h1\030\313\027\255\351\343\227\211H\332\275\326\006@<\223}\276@\220c\205C...">
15:50:57.315 [main] INFO  cc.cfig.droid.ota.Payload - sig_data size = 256
15:50:57.315 [main] INFO  cc.cfig.droid.ota.Payload - 474e36d647b6070da0f5674357a6dd8531bcd52fdf2f683118cb17ade9e3978948dabdd606403c937dbe40906385435280cada055005e96b53aff1d9cda7ba76a53cb0228d165e4bfd7168f2a3f9519725aaf7948c695a8ad8163163b53a5021a8640d4159ac86512eeedd6a72702f75ecd6f090fff874f0009fcf5629940954f243035b6d70274fefafd6209461f9d7097bbb4d6ef01e04799154caf1eb43704704a93c89d9588a73dd7d500e464d838bc7ee765cb154b07465256f073b8e99758c01b33a931bd0a4206b9649b8d233100513f70f609df00f685c188dba27423558490dae7a741724c6edd9fb59783d668859e97d057d5955cbf62bd6b9faac
15:50:57.317 [main] INFO  cc.cfig.droid.ota.Payload - Removing build/payload/
15:50:57.434 [main] INFO  cc.cfig.droid.ota.Payload - Creating build/payload/
15:50:57.585 [main] INFO  cc.cfig.droid.ota.Payload -   header  info dumped to build/payload/header.json
15:50:57.601 [main] INFO  cc.cfig.droid.ota.Payload -  manifest info dumped to build/payload/manifest.json
15:50:57.606 [main] INFO  cc.cfig.droid.ota.Payload - signature info dumped to build/payload/signatures.txt
15:50:57.609 [main] INFO  cc.cfig.droid.ota.Payload - There are 43 partitions [system, system_ext, product, vbmeta_system, engineering_cdt, cpucp, featenabler, hyp, multiimgoem, oplus_sec, oplusstanvbk, qweslicstore, splash, uefisecapp, vm-bootsys, shrm, boot, vendor_boot, vendor, odm, dtbo, vbmeta, vbmeta_vendor, xbl, xbl_config, aop, tz, modem, bluetooth, abl, dsp, keymaster, devcfg, qupfw, imagefv, my_product, my_engineering, my_stock, my_carrier, my_region, my_bigball, my_heytap, my_manifest]
15:50:57.609 [main] INFO  cc.cfig.droid.ota.Payload - dumping images to build/payload/
15:50:57.610 [main] INFO  cc.cfig.droid.ota.Payload - [ 1/43] extracting        system.img (307 ops)
15:51:50.328 [main] INFO  cc.cfig.droid.ota.Payload - [ 2/43] extracting    system_ext.img (445 ops)
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:108)
Caused by: java.lang.IllegalArgumentException: ZERO
        at cc.cfig.droid.ota.Payload.decompress(Payload.kt:184)
        at cc.cfig.droid.ota.Payload.unpackInternal(Payload.kt:205)
        at cc.cfig.droid.ota.Payload.unpack(Payload.kt:229)
        at cfig.packable.PayloadBinParser.unpack(PayloadBinParser.kt:32)
        ... 8 more

By the above, the process could not to decompress.

Besides, can boot_editor unpack the specified partition from payload.bin, its so big.

cfig commented 1 year ago

Hi, can you share the link to the payload.bin? I checked Pixel 7 and Pixel 8 factory OTA images, they don't have "ZERO" ops. It would be help if you can share some testing images.

5n0wfish commented 1 year ago

oneplus 9 ROM Download Url

On the other way, observing the print described below, I want boot_editor could unpack the specified partition from payload.bin, because its so big to unpack all.

[main] INFO  cc.cfig.droid.ota.Payload - There are 43 partitions [system, system_ext, product, vbmeta_system, engineering_cdt, cpucp, featenabler, hyp, multiimgoem, oplus_sec, oplusstanvbk, qweslicstore, splash, uefisecapp, vm-bootsys, shrm, boot, vendor_boot, vendor, odm, dtbo, vbmeta, vbmeta_vendor, xbl, xbl_config, aop, tz, modem, bluetooth, abl, dsp, keymaster, devcfg, qupfw, imagefv, my_product, my_engineering, my_stock, my_carrier, my_region, my_bigball, my_heytap, my_manifest]
[main] INFO  cc.cfig.droid.ota.Payload - dumping images to build/payload/
cfig commented 1 year ago
  1. The download link always reports error, and today the access token has expired. back luck ~ I searched the ROM in oneplus site: https://service.oneplus.com/global/search/search-detail?id=2096329&articleIndex=1 And tried Oneplus9, Oneplus9 pro, neither of them has ZERO ops. So maybe I have to check the AOSP code directly.

  2. About "unpack the specified partition": No problem.

5n0wfish commented 1 year ago

The oneplus rom is downloaded from:

https://yun.daxiaamu.com/OnePlus_Roms_2/%E4%B8%80%E5%8A%A09/ColorOS%2013.0.0%20F.12/