I'm developing an application using java but I'm not going to release the code. The problem is, I tested one of these jar de-compilers and it was able to get the code from my jar file almost perfectly! My question is how can I distribute my jar file without my code being extracted from it?
As Java preserves most of the "metadata" during compilation (which allows dynamic loading and reflection), it is a straight forward to decompile (not only disassemble) the compiled class files. That's why the recovered code is very similar to the original.
While not perfect, your probably only option is to use an obfuscator, such as ProGuard.
You can't. At the minimum, the JVM is going to need to get the code out in order to run it. And if the JVM can get the code out, anyone can.
The best you can do is obfuscate the code, but I would recommend against it because it will make tracking down production bugs very difficult because the stack traces will be hard to follow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With