Search code examples
javajardecompiling

How to create jar which can't be decompile


Hi I have to create a jar which will be send to our client.But issue is client can decompile the jar and do changes according to his requirement. I want to create the jar such that client can't read the code and can't do any changes in it. Can any body tell me the best solution for this


Solution

  • You can't really deny the client any access to the code, otherwise he won't be able to execute it. Java bytecode can be decompiled.

    The best you can do is to obfuscate it (rename all variables, classes and methods to a, b, c etc.) so it will be harder to understand what your code does and reuse it in other projects. I had rather positive experience with ProGuard which does this automatically on compiled classes.