防止收缩和优化而不会混淆 [英] Proguard shrinking and optimizing without obfuscation

查看:99
本文介绍了防止收缩和优化而不会混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我具有很多未使用的方法字段和类的库项目依赖项.由于这是第三方库,因此我不想自己删除所有未使用的类和方法,因为它是将来的更新.我正在尝试为此使用proguard,但是

In my app I have library project dependency with lots of unused methods fields and classes. Since this is a third-party library I don't want to remove all unused classes and methods by myself due it's future updates. I'm trying to use proguard for this but

-dontobfuscate

仅将整个项目排除在任何缩小和模糊的优化中.是否可以跳过混淆步骤?

will only exclude whole project from any optimisations shrinking and obfuscation. Is it possible to skip obfuscation step?

推荐答案

通常应将ProGuard应用于您的应用及其库的组合.就缩小,优化和混淆而言,这提供了最佳结果.这些库将被混淆,但是如果您获得新版本,则无论如何都需要重建整个应用程序.

You should generally apply ProGuard to the combination of your app and its libraries. This provides the best results in terms of shrinking, optimization, and obfuscation. The libraries will be obfuscated, but if you get a new version, you need to rebuild the entire app anyway.

如果要缩小,优化和混淆单个库,可以查看ProGuard手册>示例> 一个典型的库.

If you want to shrink, optimize, and obfuscate a single library, you can have a look at the ProGuard manual > Examples > A typical library.

这篇关于防止收缩和优化而不会混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆