如何保护或保护 Java 代码不被反编译

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18827935/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 11:25:59  来源:igfitidea点击:

How to protect or secure java code from decompiling

java

提问by Rakesh

I got a small doubt here. While we are generating any new application we used to deliver them as jar files. Now my question is are we able to decompile these jar files...? if yes how can I avoid that...? Please let me know, thanks in advance.

我在这里有一个小疑问。当我们生成任何新应用程序时,我们曾经将它们作为 jar 文件交付。现在我的问题是我们是否能够反编译这些 jar 文件......?如果是,我该如何避免...?请让我知道,提前谢谢。

回答by Danny.

You can decompile jar files (have a look at jd-decompiler). You can't avoid it! You just make it harder to read it with an obfuscator. (have a look at SandMark)

你可以反编译 jar 文件(看看 jd-decompiler)。你无法避免!你只是用混淆器让它更难阅读。(看看沙马克)

or create a programm which loads a crypted version of yours at runtime into memory.

或创建一个程序,在运行时将您的加密版本加载到内存中。

回答by user1401472

Decompilation cannot be avoided. You can easily make the code hard to read. There are free libraries available to obfuscate the code. proguard.sourceforge.net

无法避免反编译。您可以轻松地使代码难以阅读。有免费的库可用于混淆代码。proguard.sourceforge.net