+ 7
How to protect our java program from decompilation so that no one could see the source code?
Just like if I make a program in java which asks user to enter a certain password to show some particular stuff. But if someone decompile the .class file, he could easily get the password from the java code and that's not good.
4 Answers
+ 1
You can obfuscate the code. but this is not a solution. the obfuscation only scrambles the code. it will be more dificult, but it still acessible. Your password must be encrypted or be out of the code (better solution).
+ 14
The correct term is 'obfuscation'. There are many tools available to obfuscate source code. Just search for them on the internet ;)
+ 7
wait, when you take user input and store the input inside variable, it's stored in RAM your original source code will not change.
But
you should obfuscate the code if you are hard coding the password
+ 3
Yea I guess it's better to write the password block out of the code like in a binary file.