jdecomp
provides an interface to various Java decompilers. The current supported decompilers are:
Install via MELPA.
For general information on installing Emacs packages, see the Emacs Wiki.
In your init file, add the following to activate jdecomp-mode
:
(jdecomp-mode 1)
Set customizable variable jdecomp-decompiler-type
to a known decompiler type:
cfr
(default)fernflower
procyon
E.g.
(customize-set-variable 'jdecomp-decompiler-type 'fernflower)
Set customizable variable jdecomp-decompiler-paths
to decompiler paths. E.g.
(customize-set-variable 'jdecomp-decompiler-paths
'((cfr . "~/Downloads/cfr_0_118.jar")
(fernflower . "~/idea-IC-162.1628.40/plugins/java-decompiler/lib/java-decompiler.jar")
(procyon . "~/procyon-decompiler-0.5.30.jar")))
Use M-x jdecomp-mode
to turn the minor mode off, or call
(jdecomp-mode -1)
When jdecomp-mode
is active, opening a Java classfile (including those in JARs) automatically decompiles the file and displays the result in a preview buffer.
Set customizable variable jdecomp-decompiler-options
to options for decompilers. E.g.
(customize-set-variable 'jdecomp-decompiler-options
'((cfr "--comments false" "--removeboilerplate false")
(fernflower "-hes=0" "-hdc=0")))
Support more decompilers:
Maybe others?
This package is inspired by autodisass-java-bytecode.