chenxiaolong / avbroot

Sign (and root) Android A/B OTAs with custom keys while preserving Android Verified Boot
GNU General Public License v3.0
436 stars 41 forks source link

Old otacerts.zip not found in image #308

Closed olbb closed 1 week ago

olbb commented 1 week ago

Hello, I got the error "old otacerts.zip not found in image" when trying to use avbroot version 3.2.3. I noticed you added "patching otacerts.zip" in version 3.0.0, so I tried using version 2.3.3 and it worked fine. How should I handle this, or skip "patching otacerts.zip"? Here is the link to the ota.zip used, and the log output of otaroot. link: direct

page

logs:


avbroot.exe ota patch --input .\ota.zip --key-avb .\avb.key --key-ota .\ota.key --cert-ota .\ota.crt --magisk .\Magisk-v27.0.apk --magisk-preinit-device metadata
0.006s  INFO Replacing zip entry: META-INF/com/android/otacert
0.006s  INFO Patching zip entry: payload.bin--magisk .\Magisk-v27.0.apk --magisk-preinit-device metadata
0.009s  INFO Extracting from original payload: boot
0.412s  INFO Extracting from original payload: vbmeta_system
0.413s  INFO Extracting from original payload: system
4.255s  INFO Extracting from original payload: recovery
4.840s  INFO Extracting from original payload: vbmeta
4.841s  INFO Patching boot images: boot, recovery
7.767s  INFO Patching system image: system
7.990s ERROR Failed to patch OTA zip

Caused by: 0: Failed to patch payload: payload.bin 1: Failed to patch system image: system 2: Old otacerts.zip not found in image

chenxiaolong commented 1 week ago

Thanks for reporting this. It's a known incompatibility. OnePlus stock ROMs put otacerts.zip in the my_engineering partition instead of the system partition and they set up AVB for that partition in an unusual way that makes it very complicated to patch.

If it helps at all, I can add a new option like --skip-otacerts-patch. I hadn't done that yet because there are so few OnePlus devices that properly support custom AVB keys nowadays. I assumed that nobody really used avbroot on OnePlus devices anymore.

olbb commented 1 week ago

I tried to modify the code to skip this, but after flash the avb_custom_key, recovery still can't start normally, which is exactly as same as #195. Thank you. I will downgrade the system version to see if it works when I'm free.