I want to protect my class files from decompiling. After searching the internet the most two common names I found are Mocha and Crema. Can anyone guide me to configure them on Windows?
-
3Could you show us how you have tried to use them and tell us what specifically has failed to work? – David Hoelzer May 03 '15 at 10:49
-
I want to do it in the eclipse as well as from DOS. But couldn't do it.Can you please help me? – Abhinab Kanrar May 03 '15 at 11:28
1 Answers
In short, don't. Obfuscation isn't an absolute protection, it only slows people down, and usually results in a lower quality application.
That being said, if you are intent on using some kind of obfuscation, you'll want to use Proguard. Mocha and Crema are really old and probably won't work. Proguard is the go-to tool for free Java obfuscation, though it's more of an optimizer than an obfuscator. Basically, it removes unused methods and renames everything to shorter names (a, b, etc.) which has the incidental effect of making the code harder to read.
If you want more heavy duty obfuscation, you'll have to turn to commercial tools like Zelix Klassmaster or Allatori or Stringer. Again, note that this isn't an absolute protection. I've decompiled all of those before. It will slow people down a but but it's not worth the cost IMO.

- 37,781
- 10
- 100
- 107
-
So is there really any way to protect my code from decompiling? – Abhinab Kanrar May 04 '15 at 06:13
-
2@Abhinabyte - Make such a horrible or obscure app that noone will bother trying to decompile it. Or in other words, no. – Antimony May 04 '15 at 15:18