Wednesday, August 31, 2011

Recursive decompilation of your JARs

get your jad.exe here:
http://www.varaneckas.com/jad


follow the instructions here:
http://www.adarshr.com/papers/recursive


in a nutshell:


create a directory c:\myjars\
copy jad.exe to c:\myjars
copy your jars to c:\myjars\ (for /r %x in (*.jar) do copy /Y "%x" c:\myjars)
cd c:\myjars\
for %x in (*.jar) do jar xvf %x
#(del *.jar - if you want)
jad.exe -r -o -sjava -d . ./**/*.class
#(-r means recursive, -o means overwite, -sjava means create .java files instead of .jad files)
#(del /S /Q *.class - if you want)



as simple as that

This is also a quick and dirty way to dump the content of all jars into a txt file:

del alljars.txt
for /r %x in (*.jar) do myecho %x >> alljars.txt

where myecho.bat contains:

@echo OFF
echo %1
jar tf %1
echo ______________________________________________________________

the option -lnc adds the line number in the generated code!

2015-10-23: using jd http://jd.benow.ca/ you can open a jar and File/Save Sources...



No comments: