Created
November 12, 2015 14:21
-
-
Save svagionitis/bfe5123e97e066aef384 to your computer and use it in GitHub Desktop.
Script for decompiling a jar file using JAD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Decompile a jar file and create a compressed | |
# file with the sources. | |
# The [JAD decompiler](http://varaneckas.com/jad/) | |
# is used. | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 [jar]" | |
exit 1 | |
fi | |
JAR=$1 | |
unzip -d $JAR.jad_src $JAR | |
cd $JAR.jad_src | |
for f in `find . -name '*.class'`; do | |
jad -d $(dirname $f) -s java -lnc $f | |
done | |
cd - | |
# Tar and compress it to a file | |
tar cvf $JAR.jad_src.tar $JAR.jad_src | |
bzip2 -9 $JAR.jad_src.tar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment