调试java混淆代码
我们将混淆我们的项目,但不想失去远程调试和热交换的能力。
是否可以?哪些工具可以处理这个问题?我对简单的混淆很满意 - 只需重命名类/方法/变量。
[已编辑] 我们正在使用 Intellij IDEA,但无法找到任何用于此任务的插件。
We are going to obfuscate our project but don't want to lose the ability of remote debugging and hotswapping.
Is it possible? Which tools can handle this? I'd be happy with simple obfuscation - just renaming classes/methods/variables.
[Edited] We're using Intellij IDEA but wasn't able to find any plugin for this task.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们有同样的需求(简单混淆,需要稍后调试)
我们使用 ProGuard。它是一个 Java 应用程序,可以集成到 Ant 任务中。
它可以做很多事情,但它也是完全可调的。所以你可以保持你的混淆简单。其中一种选项是生成一个“符号对应表”,它允许您从混淆代码中检索未混淆的代码。 (它跟踪 qksdnqd 类中的变量 xyz 实际上是 MeaningfulClassName 类中的 myCuteVarName)
编辑:混淆可能很棘手。一些示例:
编辑2:
您还可以查看:
We have the same kind of needs (simple obfuscation, need to debug later)
and we use ProGuard. It's a Java app, which can be integrated in an Ant task.
It can do a lot of things, but it's also fully tuneable. So you can keep your obfuscation simple. One of the options is to generate a "Symbol Correspondance Table", which allows you to retrive the non-obfucated code from the obfuscated one. (it keeps track that the variable xyz in the class qksdnqd is in fact myCuteVarName in the class MeaningfulClassName)
Edit: Obfuscation can be tricky. Some examples:
Edit2:
You can also see:
请参阅 SD Java 混淆器。它删除注释和空格,并重命名所有非公开的成员/方法/类名称。
它还为您提供了如何混淆代码的映射,例如,对于每个被混淆为 XYZ 的符号 FOO,映射 FOO->XYZ。这意味着如果您得到提及 XYZ 的回溯,您可以轻松确定原始符号 FOO。当然,由于只有您(进行混淆的人)拥有这张地图,因此只有您可以执行此操作。
See SD Java Obfuscator. It strips comments and whitespace, and renames all members/methods/class names that aren't public.
It also providew you with a map of how the code was obfuscated, e.g., for each symbol FOO obfuscated as XYZ, a map FOO->XYZ. This means if you get a backtrace mentioning XYZ, you can easily determine the original symbol FOO. Of course, since only you (the person doing the obfuscation) has this map, only you can do this.