How to make a Java Program unextractable

痴心易碎 提交于 2019-12-01 19:12:07

You appear to be confusing the installation application with the executable. And I also think you are confusing a java jar application with a normal .exe.

Even then, these are all just bundles of code which can still be decompiled, it's just not as easy as unpacking a jar file, which are designed to be easy to extract.

Java is designed to run on the JVM, so packing it inside a .exe is poor form as that immediately locks it onto Windows, which defeats the point of Java in the first place. So I would advice against that.

As everyone has stated, it is rare that if your program works well and you users like it, that they would even think to decompile it. But if they want to they are just a single web search from a how to anyway (regardless of the language). With regards to commercial distribution, most cases the software is obfuscated and distributed in it's .jar, with with a architecture specific launcher of the form .exe, .app, .bin etc. Do not confuse those with the actual executable which is generally a .jar file somewhere.

You can always get the original code back from compiled class files. However, you can make the lives of those who wish to decompile such code very difficult by using an obfuscator, so the decompiled code is nearly impossible to read. Here is a list of open-source java obfuscators which you might wish to investigate.

If a computer can run it, a human can reverse engineer it.

The truth is that nobody wants your source code. It's pretty arrogant to think that it'd be worth the effort required to keep them out.

The best you can do is obfuscate.

  1. The term you are looking for is obfuscation. Ultimately
At best, obfuscation merely makes it time-consuming, but not impossible,

to reverse engineer a program.

  1. Another technique is SaaS. Though ultimately using black box techniques SaaS is also reverse-engineerable.
  2. Another technique is trust. Since you are distributing it to your friends, you could ask them to not extract the jar file or view the code. If they are really your friends, they will honor your request.

Jar files typically do not contain code. They usually only contain the .class (bytecode) files necessary to run the program.

You could execute part of your program on a server. Basically to execute some important, large and central function of your program, the clients contact your server to compute this function.

Then you can distribute the clients to everybody, and keep the server code for your self. Just keep the server running. Then the others can't get access to whole source, but can execute the software.

This is the only sure way to do this. Other ways can be circumvented in some ways with enough effort.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!