shwenzhang / AndResGuard

proguard resource for Android by wechat team
Apache License 2.0
8.54k stars 1.54k forks source link

可以7zip压缩lib/armeabi/*.so文件吗 #405

Closed xufeng-zhao closed 4 years ago

xufeng-zhao commented 4 years ago

如题

simpleton commented 4 years ago

理论上可以 但需要APP自行解压。

On Tue, Mar 17, 2020 at 11:52 PM 449025693 notifications@github.com wrote:

如题

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shwenzhang/AndResGuard/issues/405, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADO6YVC2F4Z6HPO75GU6X3RIBVTZANCNFSM4LOINVUA .

xufeng-zhao commented 4 years ago

不需要自行解压吧。我看到分析一个so安装代码的文章。so库安装的时候要解压。 static install_status_t copyFileIfChanged(JNIEnv env, void arg, ZipFileRO zipFile, ZipEntryRO zipEntry, const char fileName) { ... // 解压缩so文件 if (!zipFile->uncompressEntry(zipEntry, fd)) { ALOGI("Failed uncompressing %s to %s\n", fileName, localTmpFileName); close(fd); unlink(localTmpFileName); return INSTALL_FAILED_CONTAINER_ERROR; } ... }

https://www.jianshu.com/p/c9fc6743a383

simpleton commented 4 years ago

我理解错了,我以为你想要二次压缩。不过压缩so并不是google推荐的,这样其实会有更多的copy。

image