Howto decompile a complete jar-file


Download JAD and jadAlign. Unpack the zips and copy the two executables in a path-directory. Put this little shell-script in your path.

decompile_jar.sh

OLD_PWD=$PWD
mkdir src 2>/dev/null
cp $1 src/$1.zip
cd src/
unzip $1.zip
rm -f $1.zip
find . -name "*.class" -exec jad -r -s "jad" -lnc {} \;
find . -name "*.class" -exec rm -f {} \;
find . -name "*.jad"   -exec jadAlign {} `basename {} .jad`.java \;
find . -name "*.jad"   -exec rm -f {} \;
cd $OLD_PWD

Open a shell (under windows you can use cygwin), change to the directory where the jar-file can be found and call

decompile_jar.sh jar2decompile.jar

At the end you should have a new directory src with the decompiled and re-aligned java-sources.

Try it🙂