Open guzhonL opened 2 years ago
I also encountered this problem
me too
me too
I also encountered this problem. Its issue with only Android 12, works fine in linux PC.
Any solution? @pspencil
Any solution? @pspencil
Sorry I don't work on this anymore. I have some vague memories of Android 12 changing the underlying zip library. Perhaps you can try explicitly linking in your own zip lib. (Not sure how to do that though)
My solution 1: ApkDiffPatch; MIT license; C++; linking own zlib; only for own apk; (can't be used by Android app store, because it requires re-signing apks before diff);
My solution 2: sfpatcher; Business license; C++; linking own zlib; is designed for Android app store; patch speed up by a factor of xx than archive-patcher & run with O(1) memory & not need temp files & support large game apk & support android4.1--android13.
How to integrate sfpatcher; in android app? are there jar/aar files available?
Do you think the problem could be solved by changing the Zlib version in server side for generating diff?@pspencil If the answer is no, have you any idea about how link own Zlib (1.2.12) in my project? the archive-patcher is using deflater and changing the deflater is not possible, it is loading the zlib in static block. @pspencil
I finally fixed this problem; in the near future, I will make a PR
I finally fixed this problem; in the near future, I will make a PR
Can you share how to fix it?more PR details?
finally I copy the zlib jni code(below android 12) solved
finally I copy the zlib jni code(below android 12) solved
Can you submit changes and share PR details?
finally I copy the zlib jni code(below android 12) solved
Can you submit changes and share PR details?
copy the zlib c code and use custom Deflater bind the custom zlib with jni。 https://cs.android.com/android/platform/superproject/+/android-10.0.0_r47:external/zlib/src/deflate.c https://cs.android.com/android/platform/superproject/+/master:libcore/ojluni/src/main/native/Deflater.c
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.
On Android 12 devices(Almost all of android 12 devices), I found in certain cases the file generated with the patch was different from the origin file;
env: android os version:android12,archive-patcher version:v1.1
my test files as flows: old file:19onlyjar.zip patch file:patch-onlyjar.zip origin file:20onlyjar-ori.zip
how to reproduce: 1、unzip patch file first; 2、apply the patch with the following code: ` public static void applyPatch(File oldFile, File patchFile, File newFile, File tempDir) throws IOException {
3、compare the md5 between the origin file and the generated file in step2
19onlyjar.zip patch-onlyjar.zip 20onlyjar-ori.zip