Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Help using ProGuard to Obfuscate JAR with Applet classes.

843811Dec 8 2006
Hi! I've trying a lot to obfuscate my classes in a JAR file that is downloaded by the client since is an applet. I run the ProGuard obfuscation tool and everything appears to work perfect, but when I un-jar the ProGuard generated JAR file and try to decompile the classes using "DJ Java Decompiler", it can decompile everything, meaning that no obfuscation was performed.

This is how my ProGuard parameters file looks like:
-injars  vdisk.jar
-outjars vdiskobf.jar

-libraryjars "C:\plugins\sun.jar"
-libraryjars C:\j2sdk1.4.2_12\jre\lib\rt.jar


# Preserve all public applets.

-keep public class *

# Print out a list of what we're preserving.

-printseeds
The input jar, consist of two files, the first:
public class WebDavLink extends JApplet {

	public void init() {
		WebDavLinkManager wdlm = new WebDavLinkManager(this);
		wdlm.opera();
	}
}
And the second one:
package com.syc.web.applet.webdavlink;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import javax.swing.JApplet;
import netscape.javascript.JSObject;

class WebDavLinkManager{
	
	private JApplet jap = null;
	
	WebDavLinkManager(JApplet jap){
		this.jap = jap;
	}
	
	protected void opera(){
		//... some code
		
	}

	private void downloadFile(String sourceURL, File targetFile) throws IOException {

		//... some code
	}
}
The problem is, as I stated before, that a decompiler can decompile both classes in the JAR that was suppoused to have them obfuscated.

Any help will be great!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2007
Added on Dec 8 2006
0 comments
282 views