Java 混淆 - ProGuard/yGuard/其他?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/150653/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java obfuscation - ProGuard/yGuard/other?
提问by roryf
This is along similar lines as these recent questions:
这与这些最近的问题类似:
Best Java Obfuscation Application For Size ReductionCreating non-reverse-engineerable Java programs
用于减少大小的最佳 Java 混淆应用程序创建不可逆向工程的 Java 程序
However, one ends up recommending yGuard and the other ProGuard but neither mention both. I wonder if we could get a comparison of each one and hear peoples experiences from both sides of the fence. Looking at this comparison charton the ProGuard website its clearly angled towards ProGuard. But what about real-world experience of each - which one produces smaller output? which one is harder to decompile from? what Java versions are supported by each?
然而,一个人最终推荐了 yGuard 和另一个 ProGuard,但两者都没有提及。我想知道我们是否可以对每个人进行比较,并从围栏两边听听人们的经历。在ProGuard 网站上查看此比较图表,它显然与 ProGuard 成角度。但是每个人的真实世界经验如何——哪一个产生较小的输出?哪个更难反编译?每个版本都支持哪些 Java 版本?
Personally I'm particularly interested from a J2ME point of view but please don't limit the discussion to that.
我个人对 J2ME 的观点特别感兴趣,但请不要将讨论局限于此。
采纳答案by edsumner
Proguard is a better product; especially if you take the time to go through the settings for J2ME.
Proguard 是一个更好的产品;特别是如果您花时间浏览 J2ME 的设置。
Specifically for J2ME there is a far better (commercial) product called mBooster
专门针对 J2ME 有一个更好的(商业)产品,称为mBooster
I've been getting around 25% improvement in size on my application afterits been through Proguard. This is mainly to do with the better Zip compression on the Jar file and comprehensive support for class merging and preverification.
在通过 Proguard之后,我的应用程序的大小已经得到了大约 25% 的改进。这主要是与 Jar 文件上更好的 Zip 压缩以及对类合并和预验证的全面支持有关。
回答by Pool
Results for my project.
我的项目的结果。
- Obfuscation- both fine.
- Optimisation- ProGuard produced 20% faster code (for the measured app bottleneck).
- Compactness- ProGuard about 5% smaller.
- Configuration / Ant- YGuard is much easier to configure.
- 混淆- 都很好。
- 优化- ProGuard 生成的代码速度提高了 20%(针对测量的应用程序瓶颈)。
- 紧凑性- ProGuard 小 5%。
- 配置 / Ant- YGuard 更容易配置。
So, I'd advise ProGuard - but configuration and ant integration could definitely be improved.
所以,我建议 ProGuard - 但配置和 ant 集成肯定可以改进。
回答by Vugluskr
My opinion is - ProGuard is better. Output is smaller a bit. Optimizing is better and much faster.
我的意见是 - ProGuard 更好。输出小一点。优化更好更快。
Decompiling is simple in both cases. Well, i mean, if u know Java well and really knowbusiness-logic of what you're decompiling, there is no problem to get it back to sources from obfuscated classes.
在这两种情况下,反编译都很简单。好吧,我的意思是,如果您非常了解 Java 并且真正了解您正在反编译的业务逻辑,那么从混淆类中将其恢复到源代码是没有问题的。
So, my opinion is ProGuard is better.
所以,我的观点是 ProGuard 更好。

