使用 ProGuard 值得这么麻烦吗?
根据我所看到和读到的,如果有人真的想对你的软件进行逆向工程或反编译,ProGuard 不会阻止他们。但这至少是一种适度的威慑吗?我不确定稍后翻译我的堆栈跟踪是否值得。
From what I've seen and read, if someone really wants to reverse-engineer your software or decompile it, ProGuard is not going to stop them. But is it at least a modest deterrent? I'm not sure if it's worth the hassle of translating my stack traces later on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会推荐 ProGuard。即使没有混淆(这可以显着缩短常量池中使用的名称),它也可以删除使用的库等的“死代码”(未使用的方法)(它也可以用于方便地将所有内容合并在一起)。
需要一点点摆弄才能“正确”,尤其是。如果有动态加载的类——但非常推荐。然而,节省空间的实际好处“取决于”可以消除什么,并且通常会随着更多的外部库而增加。
现在,对于混淆——它的作用与任何混淆器一样:使代码“反编译”成具有有意义的名称的东西是不可能的。
不过,混淆不会保存您的超级秘密算法或隐藏您的私钥:如果 JVM(或转换后的 Dalvik)必须理解它,那么反编译器和任何真正想要理解它的人也可以获得访问权限即可。您的代码甚至可以以字节码形式提取并简单地使用。反射(想象一下一个零文档的可怕 API):任何真正想要访问的人都可以。但也许混淆会使这项任务在成本/支出方面变得不可行:“这取决于”。
不想翻译堆栈跟踪?简单:不要将其用于调试(对于从用户获取跟踪没有那么有用)或不要启用混淆(其他好处仍然适用);-)
快乐编码。
I would recommend ProGuard. Even without obfuscation (which can significantly shorten the names used in the constant pool) it can remove "dead code" (unused methods) of used libraries, etc. (It can also be used to conveniently merge everything together).
It takes a little bit of fiddling to "get correct", esp. if there is dynamically loaded classes -- but very recommended. The actual benefit from space-saving, however, "depends" on what can be eliminated and generally goes up with more external libraries.
Now, for obfuscation -- it does as much as any obfuscator: Makes "decompiling" code into things with meaningful names impossible.
Obfuscation won't save your super-secret-algorithm or hide your private keys, though: if the JVM (or Dalvik after a transformation) must understand it, then so can a decompiler and anyone who really wants to get access can. Your code could even be lifted in bytecode-form and used simply via. reflection (just imagine a terrible API with zero documentation): anyone who really wants to get access can. But perhaps obfuscation will make this task unfeasible for the cost/payout: "It depends".
Don't want to translate stack-traces? Simple: don't use it for debugging (not as useful for getting traces from users) or don't enable obfuscation (other benefits still apply) ;-)
Happy coding.
Pro Guard 至少使您能够使应用程序的文件大小尽可能小!
这是一个真正的优点。
如果您将
proguard.config=proguard.cfg
添加到项目的 default.properties 文件中,则在使用 eclipse 进行开发和编译时会自动使用它。这也是一个真正的优点。
Pro guard is at least enabling you to have the app become as small as possible regarding the filesize!
That's a real plus.
It's automatically used when developing and compiling with eclipse, provided if you have
proguard.config=proguard.cfg
to the project's default.properties file.That's also a real plus.