How can I decompile many jars at once?

痞子三分冷 提交于 2019-12-04 23:53:56

问题


Well, I guess subject says it all :)

The ideal solution would find all jars within a certain folder (they might be in sub-folders), and write all the sources found into a single "src" directory, of course maintaing the package folders.

Concrete use case: decompile all Eclipse plugin jars


回答1:


Download JAD Decompiler.

  • Unjar all your jar files (using the command jar xvf) to some directory. Let's call this ${unjar.dir}.

  • Create a directory for JAD to write out the decompiled sources. Let's call this ${target.dir}.

  • Execute the following command:

    jad -o -r -sjava -d${target.dir} ${unjar.dir}/**/*.class

options are:

-o       - overwrite output files without confirmation
-r       - restore package directory structure
-s <ext> - output file extension (default: .jad)



回答2:


http://java.decompiler.free.fr/




回答3:


Decompile eclipse plugins??

Apart from the existence of a technical solution - (1) you can get all source files for the (official) eclipse plugins as bundles and (2) don't expect that the decompiler results will compile or can be used to debug the code.

So if you want to study the source of eclipse and it's plugins, decompiling is .. say .. not the best idea.




回答4:


I wrote a tool names code-collection using shell script and cfr to find and decompile all jar, war files at once.

After decompiling jar, war files, you could use my tool to find and copy all specific files (.js, .html for example) to a new directory.

Visit my project at: code-collection




回答5:


The Windows equivalent command for this would be:

jad -o -r -sjava -d "target.dir" "unjar.dir/**/*.class"


来源:https://stackoverflow.com/questions/4793469/how-can-i-decompile-many-jars-at-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!