I developed a desktop application in Java. I converted my code in the form of Executable jar (.jar) format. Here my problem is, this jar files easily extracted by winrar/winzip. My Java class files are visible to others and also i do De-compilation process using JAD my source code are visible to everyone. is any way to protect my source code from De-compileation process.
Asked
Active
Viewed 5,312 times
5
-
You can obfuscate method names and the code, but you can't really prevent decompilation. – thejh Nov 01 '11 at 09:42
-
1possible duplicate of [How to encrypt a .jar file](http://stackoverflow.com/questions/7187883/how-to-encrypt-a-jar-file) – A.H. Nov 01 '11 at 09:43
-
Duplicate?.. please refer this also http://stackoverflow.com/questions/49379/how-to-lock-compiled-java-classes-to-prevent-decompilation – Kris Nov 01 '11 at 09:49
3 Answers
1
As Jigar Joshi said you can obfuscate your jar file. Proguard is a good one. Here's the link to it. http://java-source.net/open-source/obfuscators. Alternately you can convert jar to exe using jar to exe converter. You can download it here. But you have to purchase it. http://www.regexlab.com/en/jar2exe/.

Raghunandan
- 132,755
- 26
- 225
- 256
0
Put a password or licence check at start of application. With proper authentication, only user must be able to run the application further.
For password check, you should generate private-public key concepts. For licence, some installed software or attached hardware can be use to provide access.

Aman
- 735
- 1
- 6
- 19