google / archive-patcher

Automatically exported from code.google.com/p/archive-patcher
Apache License 2.0
534 stars 74 forks source link

Android 11 (R) [API 30] : Zlib not compatible on this system #175

Open aravindakv opened 3 years ago

aravindakv commented 3 years ago

isCompatible is giving false in Android R version. Is there any reason?

if (!DefaultDeflateCompatibilityWindow().isCompatible) { Logger.W("Zlib not compatible on this system") return false }

Also can we bundle zlib with apkpatcher as a library and make not to use system zlib to avoid these kind of issues during upgrade?

hamid97m commented 2 years ago

Any solution?

hamid97m commented 1 year ago

I change the Zlib version. You can see in my PR

berlix commented 1 year ago

Is there any reason?

The reason is that Deflater on Android R and up is in fact incompatible and yields bad results upon patch application.

Inspired by @hamid97m's solution, we addressed this issue by bundling zlib 1.2.13 binaries (the currently latest version) and creating a version of Deflater that uses those.

Sources: https://github.com/EIDU/archive-patcher-android

The library is on Maven Central. See the repo's README.md for usage instructions.