Reputation: 111
How do I create a .jar file that does not allow others to decompile it and get my source code? Is this even possible without having to encrypt it then decrypt it when it loads in the JVM? To the point, I don't want others to steal my program.
Upvotes: 0
Views: 759
Reputation: 76
Better than obfuscation is the encryption of the classfiles, so the classfiles are no more readable for a decompiler.
JarProtector: http://bfa-it.com/?lang=en&id=products/jarprotector
ClassGuard: https://www.zenofx.com/classguard
Java Antidecompiler: https://marketplace.eclipse.org/content/java-antidecompiler
Upvotes: 0
Reputation: 75
Obfuscation is what you're looking for.
For free obfuscators, there's ProGuard. http://proguard.sourceforge.net/
It gets the job done, but it's still pretty easy to read the source unless you mess with the settings a bit. For example, you could have it obfuscate the classes and methods to be incredibly long names, but that can always just be obfuscated over with ProGuard again with default settings to make the class names short again.
If you're willing to spend some money, Allatori and ZKM are great (but very expensive!).
http://www.allatori.com/price.html
http://www.zelix.com/klassmaster/order.html
Allatori is probably my favorite, but I think ProGuard would work fine if you spend some time to mess with the settings.
Upvotes: 1
Reputation: 4404
You could obfuscate your code with ProGuard (http://proguard.sourceforge.net) or similar tools. It won't give you great protection tho, but makes it harder to understand the code if someone decompiles it.
Upvotes: 3