EIDU / archive-patcher

Apache License 2.0
0 stars 0 forks source link

Android 12+ giving incorrect results #1

Open viktor76525 opened 4 months ago

viktor76525 commented 4 months ago

I have 2 APKs and a delta APK to get from the first to the second, not much has really changed (compressed delta is 65k) and both are signed.

On a computer the file rebuilds fine. On a devices running Android 8, 11 the file rebuilds fine. The same application on Android 12, 13 and 14 cannot rebuild the APK. It gives the wrong checksum, the bytes are different in the result APK after position 0x007fa3e0 of a 25 MB APK and trying to open the result with ARK on the computer gives the error:

Loading the archive ‘rebuild.apk’ failed with the following error:
Failed to open archive: Zip archive inconsistent: central directory overlaps EOCD, or there is space between them

The file size has changed from 25,233,092 bytes to 25,232,728 in the broken rebuild (364 fewer bytes in the rebuild). Android 12+ all have the same incorrect result checksum.

P.S. I also had to add the parameter ::DefaultDeflater to FileByFileV1DeltaApplier(::DefaultDeflater) in the sample command in README.md for it to work.

viktor76525 commented 4 months ago

I'll have a look at some of these workarounds: https://github.com/google/archive-patcher/issues/183

viktor76525 commented 4 months ago

There's another repo suffixed with -android so I guess the only issue here is the README.md file is out of date.