Batch decompiling of Java files with JD-GUI

前端 未结 4 2026
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 06:46

I\'m looking for a program to batch decompile Java classes. I found JAD, but it didn\'t support some new features of Java, and the benefit of this program is that it can exe

相关标签:
4条回答
  • 2020-12-13 06:56

    It looks like you can launch the GUI with a whole bunch of libs at once using the command line and then CTRL+ALT+s/CTRL+w each tab to quickly save/close. It's not automated but tolerable when decompiling a pile of dependencies. (Note that the "^" is just a trick for doing multi-line commands in Windows.)

    "c:\jd-gui-0.3.6.windows\jd-gui.exe" ^
     c:\my-libs\lib-a.jar ^
     c:\my-libs\lib-b.jar ^
     c:\my-libs\lib-c.jar ^
     c:\my-libs\lib-d.jar ^
     c:\my-libs\lib-e.jar
    
    0 讨论(0)
  • 2020-12-13 06:56

    File > Save all sources will save all files in the home directory.

    0 讨论(0)
  • 2020-12-13 07:03

    Command line decompilation for JD-GUI is a highly requested feature but it's not implemented yet. Perhaps you can use the following workaround in the meantime:

    1. jar (or zip) all the classes you want decompiled together.
    2. Launch JD-GUI and open your jar (zip) archive.
    3. Use "File" - "Save JAR Sources" menu option. It will decompile all classes from your archive and save their sources into another zip file.

    I haven't seen any good open source JD-GUI alternatives with command-line support, unfortunately, so I think the above is as good as it gets for now.

    0 讨论(0)
  • 2020-12-13 07:20

    I could recommend using Jad in conjuction with JadRetro - of course, it can't make Jad produce java generics but the decompiled source (including for Java 1.5+ classes) is functionally equivalent to the original (and back compilable in most cases).
    Its use is simple:

    jadretro *.class
    jad .class

    Notes:
    1. JadRetro could be used in batch mode like this: jadretro ...
    2. If you are using jad v1.5.8e (instead of the latest v1.5.8g) then "-c" option should be passed to jadretro (otherwise jad will refuse to decompile Java 1.5+ classes).

    0 讨论(0)
提交回复
热议问题