我将所有类文件和资源的目录传递给 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/