File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Protection of .class file from decompilation. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Protection of .class file from decompilation." Watch "Protection of .class file from decompilation." New topic
Author

Protection of .class file from decompilation.

Serghei Jelauc
Ranch Hand

Joined: Jul 24, 2002
Posts: 128
Hi javers.
I need to protect my .class file from decompilation. Could you say me how I can do it?
Thanks in advance.


SCJP 1.4 <br />SCBCD 1.3<br />SCWCD 1.4
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Try using Google to search for "java obfuscation".
You should be able to find something to help you.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Dermot Curley
Ranch Hand

Joined: Jul 03, 2002
Posts: 43
Another option is to encrypt the class file and then decrypt it "on the fly" by modifying classLoader. This tutorial got me up to speed on classloader pretty quick. (You will have to register for the pleasure).
It is worth saying that this will not work the same for an applet, security restrictions will prevent you from messing with classLoader, but it should work fine for an application.
[ February 24, 2003: Message edited by: Dermot Curley ]
[ February 24, 2003: Message edited by: Dermot Curley ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Raj Bansilal Champaneriya,
Your post was moved to a new topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Protection of .class file from decompilation.
 
Similar Threads
.class file problem
one q on class
Java decompilation
java .class file dcompilation
Java Decompilation