我在我的 Android 应用程序中使用了许多第 3 方库,例如 AndEngine、ButterKnife、Parse、Picasa 等。
这是否意味着我必须将它们全部包含到我的 APK 中? 例如,我只使用 Picasa 库中的一种静态方法来加载图像:
Picasa.load(image, this, null, null);
但是我仍然需要将整个 jar 文件添加为我的 Eclipse IDE 中受支持的库。
生成 APK 时,它是否以某种方式捕获/仅包含第 3 方库中的特定方法,还是包含整个库?
最佳答案
我认为 Proguard 就是您正在寻找的:
http://developer.android.com/tools/help/proguard.html
The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer.
请确保在开始使用它后进行彻底测试,因为它有时会过于激进。
关于android - 生成 apk 时包含第 3 方 android 库的哪一部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30267639/