I just had an idea, is that possible to protect my java sources (packed into a jar file) which are loaded with a custom class loader, using a JNI code or something?
As the JNI code cannot be decompiled, it could be great to be able to protect the java code too.
Is that possible?
Thanks.
I've searched for something like this a lot and here's my take on it.
Write your own custom boot strap class loader at the JVM level, which would have to be coded in C. This class loader would use a cryptographic key to decrypt the already encryped java class files on the fly into byte arrays for class definition.
Now you're left with where to store your cryptographic key and how to secure it.
In the end, you may be better off just purchasing Excelsior-Jet, I've used it before and it's a really great app. Well worth the $3,000 or so you would spend on it.