Tuesday, April 13, 2010

Decompiling Jar Files


just some notes for later on how to decompile a jar file

first unzip the .jar

cg$ unzip javatest3.jar
Archive: javatest3.jar
creating: META-INF/
inflating: META-INF/MANIFEST.MF
inflating: SiteError.class
inflating: evil.class
...

from there use jad to decompile

cg$ ./jad -r -ff -s java javatest/SiteError.class Parsing javatest/SiteError.class... Generating SiteError.java

thats it, now you can read the code.
CG

2 comments:

Zach said...

(Scratch prev comment)

Since jad doesn't support directory recursion (yet?):

find javatest -name "*.class" -exec ./jad -r -ff -s java {} \;

Trace said...

You can use jd-gui Decompiling full Jar package.