5

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.

Aerrow
  • 11,932
  • 10
  • 54
  • 90
  • You can obfuscate method names and the code, but you can't really prevent decompilation. – thejh Nov 01 '11 at 09:42
  • 1
    possible 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 Answers3

3

You can't 100% stop decompilation but you can obfuscate your code that will be hard to read once after decompilation

jmj
  • 232,312
  • 42
  • 391
  • 431
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
  • 131,557
  • 25
  • 223
  • 252
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
  • 685
  • 1
  • 6
  • 18