java反编译工具jd-gui和插件jd-eclipse,还有插件Enhanced Class Decompiler 3.3.0
JD-GUI和JD-ECLIPSE 可以直接在下面的网址进行下载
http://java-decompiler.github.io/
(1)注意:JD-GUI.exe 单机版有很多版本,有些旧版本反编译出来的源码和高版本反编译出来的源码是区别的
1.低版本的反编译可能和实际源码有出入
2.1.6.6版本反编译的源码中有中文无法正常复制?
2023年6月6日15点52分 解决反编译中文问题
下载源码:
GitHub - java-decompiler/jd-gui: A standalone Java Decompiler GUI
或者
https://gitcode.net/mirrors/java-decompiler/jd-gui?utm_source=csdn_github_accelerator
1、修改 jd-gui\services\build.gradle 文件 目的:升级 rsyntaxtextarea 到最新版本
compile 'com.fifesoft:rsyntaxtextarea:3.0.4’改成compile 'com.fifesoft: rsyntaxtextarea:3.1.3'
2、修改 jd-gui\build.gradle 文件新增如下环境变量:
jvmOptions = ['-Dfile.encoding=utf-8']
具体位置如下
// Java executable wrapper for Windows //
launch4j {
createExe.dependsOn 'proguard'
jvmOptions = ['-Dfile.encoding=utf-8']
version = textVersion = project.version
在根路径上运行cmd命令编译 gradlew build
需要联网下载,等待2分钟左右,新的exe生成
在jd-gui-master\build\distributions 目录下,复制新生成的zip压缩包解压使用,即正常。
(2)在上面网址下载后插件jd-eclipse后,
打开eclipse,在help--Install New Software...在新窗口中,点击add 选中下载好的压缩包 或者 把下载好的zip压缩包拖进去,点击next,然后finish
安装过程中有提示窗,则点击 install anyway ,需要联网下载一些jar和依赖,需要等待。安装完成后点击restart重启eclipse。
此时打开class文件可以鼠标右键open with 选择刚安装好的jd-eclipse
设置默认用jd-eclipse打开class文件
windows--preferences--general--editors--File Associations
在右边框中,上面选择*.class 下面选择add - jd-eclipse 然后点击default
上面选择*.class without source 下面选择add - jd-eclipse 然后点击default
注意:有些版本的eclipse安装好后,依旧打不开class文件,可能是ceclipse版本的问题?
又或者是源码编译的jdk版本影响的?比如源码是用jdk1.6编译的,现在eclipse用的是jdk1.8环境,反编译有影响?
又或者是源码编译的jdk是32位的,反编译的环境是64位的?需要单独配置32位的jar包?
(3)打开eclipse,在help--Eclipse Marketplace,在搜索框中输入 Decompiler 然后回车搜索 ,稍等片刻
在搜索结果中 点击 Enhanced Class Decompiler 3.3.0 install安装 ,等待安装完成
设置默认用Decompiler打开class文件
windows--preferences--general--editors--File Associations
在右边框中,上面选择*.class 下面选择add - Class Decompiler Viwer 然后点击default
上面选择*.class without source 下面选择add - Class Decompiler Viwer 然后点击default
总结:①jd-gui.exe单机版,把class文件拖进来即可进行反编译,但是源码有中文不能正常复制出来?
②jd-eclipse反编译有些问题,可能是源码生成的class用的jdk版本和还有32位有关
③插件Enhanced Class Decompiler 3.3.0 可以正常反编译,默认使用。