简体   繁体   中英

How to prevent jar decompilation

I have created a plugin project in Eclipse, distributed as a jar. The user can take this jar and decompile it using JAD. Is there any way so that i can stop the decompilation of a jar file? Or, at least, to hide my source code from the user?

The best way to stop your jar from being decompiled is to give users no reason to want to. Obfuscation is just a bandaid. In fact, some people will probably reverse it just for the challenge if it's famous enough.

If you don't insert your source code in the jar, your sourcecode isn't what is decompiled by a decompiler, but something similar.

However, you may use an obfuscator to make code decompilation produce very ugly code like Proguard .

ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.

Search for other products with the term obfuscator .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM