How to make a Java program non-extractable

Sorry, I'm not very sure how to formulate the title of the question. My problem is that I developed a Java program, and I want to distribute it among my friends. Therefore, I export it to a Jar file, but I do not want them to extract the jar file to view the code. In any case, to make the program so that no one can get the source code, just run the program.

+4
source share
7 answers

It looks like you are confusing the setup application with the executable. And I also think that you are confusing the java jar application with the usual .exe.

Even then, all this is just bundles of code that can still be decompiled, but it's not as simple as unpacking the jar file, which are designed to be easily extracted.

Java is designed to run on the JVM, so packing it inside .exe is a bad form, as it immediately blocks it on Windows, which primarily hits the Java point. Therefore, I would consult with this.

As everyone has stated, it rarely happens that if your program works well and you like it, they will even think to decompile it. But if they want them to be just one web search, one way or another (regardless of language). As for commercial distribution, in most cases the software gets confused and distributed in it .jar, with the architecture-specific launch form .exe, .app, .bin, etc. Do not confuse users with the actual executable, which is usually a .jar somewhere.

0
source

You can always return the source code from compiled class files. However, you can make the life of those who want to decompile such code very difficult using an obfuscator, so decompiled code is almost impossible to read. Here is an open source list of java obfuscators that you might want to explore.

+11
source

If a computer can start it, a person can rebuild it.

+6
source

In truth, no one wants your source code. It is rather presumptuous to think that it will be worth the effort necessary to prevent them.

The best you can do is obfuscation.

+4
source
  • The term you are looking for is obfuscation . In the end
At best, obfuscation merely makes it time-consuming, but not impossible, 

to reverse engineer the program.

  1. Another method is SaaS . Although ultimately the use of SaaS black box methods also requires reverse processing.
  2. Another method is trust. Since you are distributing it to friends , you can ask them not to extract the jar file or view the code. If they are truly your friends, they will honor your request.
+3
source

Jar files usually do not contain code. Usually they contain only the .class files (bytecode) needed to run the program.

+2
source

You can run part of your program on the server. Basically, in order to fulfill the important, large and central function of your program, clients will contact your server to calculate this function.

Then you can distribute clients to everyone and save the server code for yourself. Just start the server. Then others cannot access the entire source, but they can run the software.

This is the only sure way to do this. Other methods can be circumvented to some extent with sufficient effort.

0
source

All Articles