java - 如何让 proguard 将 zip 文件视为资源?

标签 java proguard

我将所有类文件和资源的目录传递给 proguard,并预先合并。其中一些资源是 zip 文件。

不幸的是,proguard 专门处理 zip 文件,将它们扩展到最终的 jar 中。 This is documented :

Each input entry can be:

  • A class file or resource file,
  • ...
  • A zip file, containing any of the above,
  • A directory (structure), containing any of the above.

我现在使用的解决方案是预压缩所有内容,强制 proguard 不递归到 zip 文件中。

有更好的方法吗?

最佳答案

打包策略无法更改。您可以更改 zip 文件的扩展名,以便将其视为资源文件,或者您确实可以将 zip 文件预先打包到另一个 zip 文件或 jar 文件中。

关于java - 如何让 proguard 将 zip 文件视为资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38407854/

相关文章:

android - Proguard 在 java.lang.StringBuilder 中找不到方法

java - 使用 BigInteger 检查回文

java - jni 使用 NewDirectByteBuffer 在 java 中看到随机的东西

java - 使用 Proguard 跳过特定警告/注释?

android - 使用 proguard 时 GooglePlaces 不起作用

android - 什么是最安全,最简单,最通用的proguard配置?

android - OkHttp3类未找到异常,但存在于apk的dex文件中

Java:我应该如何从另一个类引用公共(public)对象?

java - 如何读取损坏的符号链接(symbolic link)指向的路径?

java - 找不到 com.google.firebase.auth 的本地模块描述符类