801258 wrote:You don't need to do that.
protect my code
can I make a solution when other people cant look my code or don't extracted the .jarNot in any practical sense, no. For the contents of the jar file itself, it must exist unencrypted for the JVM to run it. If it's running on my computer, I can examine it. Period. You cannot change that. You can use an obfuscator on the source code so that it will be harder to decompile, but that won't stop someone who's really determined.
EJP wrote:Plus you can't encrypt the classloader class that does the decryption. Its a futile effort to even write such a weak protection scheme.
At the point when the code is executed, it must be unencrypted. It is not in principle impossible to intercept the code at that point.