一、Eclipse Class Decompiler
Eclipse Class Decompiler是一款Eclipse插件,整合了多种反编译器,和Eclipse Class Viewer无缝集成,能够很方便的使用插件查看类库源码,进行Debug断点调试。同时还提供了在线自动查找源代码,查看Class二进制字节码的功能。
Eclipse Class Decompiler对JDK的最低要求为JDK1.6, 能反编译和debug各版本的Class文件,支持JDK8的Lambda语法,同时支持中文等非Ascii码字符集的解析,支持Eclipse 3.6及以上所有版本的Eclipse。
插件支持Windows,Linux,Macosx 32位及64位操作系统。
1、安装:
1.1)离线安装:
Github项目地址为:https://github.com/cnfree/Eclipse-Class-Decompiler
1)离线包下载地址:
2)安装:
1)Launch Eclipse,Click on "Help > Install New Software...",
2)Click on button "Add...",and drag zip into dialog,then click on button "OK",
3)Check "Eclipse Class Decompiler",
4)Next, next, next... and restart.
1.2)在线安装:
请通过以下地址选择一个可用的源在线安装:
http://cnfree.github.io/Eclipse-Class-Decompiler/update
http://raw.githubusercontent.com/cnfree/eclipse/master/decompiler/update/
http://www.cpupk.com/decompiler/update/
方法一:
1)Launch Eclipse,Click on "Help > Install New Software...",
2)Click on button "Add..." to add an new repository,Enter name as "Eclipse Class Decompiler Update Site" and enter location as "http://raw.githubusercontent.com/cnfree/eclipse/master/decompiler/update/", then click on button "OK",
3)Check "Eclipse Class Decompiler",
4)Next, next, next... and restart.
方法二:通过eclipse marketplace(目前貌似已经无法搜索到了)
1)输入 Decompiler或者反编译 搜索并安装此插件
注:最新版本的Decompiler改成了Enhanced Class Decompiler,如下:
2)这里有几种不同的反编译插件工具的选择,可以先都选上
3)之后重启eclipse后即安装完毕。
2、配置使用:
设置class文件的打开方式,如下:
3、卸载:
1)Click on "Help > About Eclipse > Installation Details > Installation Software",Select "Eclipse Class Decompiler"
2)Click on "Uninstall...".
二、jd-eclipse
github地址:https://github.com/java-decompiler/jd-eclipse
1、安装:
1)获取zip包:
> git clone https://github.com/java-decompiler/jd-eclipse.git
> cd jd-eclipse
> ./gradlew build
2)安装:
1)Build or download "jd-eclipse-x.y.z.zip",
2)Launch Eclipse,Click on "Help > Install New Software...",Drag and drop "jd-eclipse-x.y.z.zip" on dialog windows,
3)Check "Java Decompiler Eclipse Plug-in",Click on "Next" and "Finish" buttons.
4)A warning dialog windows appear because "org.jd.ide.eclipse.plugin_x.y.z.jar" is not signed. Click on "Install anyway" button.
2、配置使用
1)关联class文件:
Click on "Window > Preferences > General > Editors > File Associations"
"*.class" : Eclipse "Class File Viewer" is selected by default.
"*.class without source" : "JD Class File Viewer" is selected by default.
2)配置:
Click on "Window > Preferences > Java > Decompiler"
3、卸载
Click on "Help > About Eclipse > Installation Details",
Select "JD-Eclipse Plug-in",
Click on "Uninstall...".