常用java反编译器
网上有很多安卓相关的java反编译器,大致整理如下:
- 比较老旧的
- Jad
- 不再维护了,源码仓库已关闭
- 不支持Java 5+
- Java DeObfuscator
- https://sourceforge.net/projects/jdo/
- JDO is a Java DeObfuscator that works on class files directly. JDO contains a simple and easy to use GUI that makes automatic deobfuscation of Java projects a one-click operation!
- JODE
- http://jode.sourceforge.net/
- a java package containing a decompiler and an optimizer for Java. This package is freely available under the GNU GPL. It hasn’t been updated for quite some time.
- AndroChef
- Candle
- https://github.com/bradsdavis/candle-decompiler
- by Brad Davis, developer of JBoss Cake, is an early but promising work in progress= is far away from being feature complete
- Jad
- 相对新的工具
- JD-GUI
- 官网地址:
- is an Decompiler, which comes with its own GUI. All is licensed under GPLv3. Like CFR the source for the decompiler itself, is not published, but you have the right to decompile the bionaries. And the binaries are under an OpenSource-License (CFR is under the MIT-license and JD Core is under the GPLv3 license)
- 转换效果:经常会报错
- 更准确的说是:对于LINQ/DLR的树编译器产生的代码,会不支持,会报错
- -》解析后的代码中,包含/ Error / // Byte code 这种代码
- 更准确的说是:对于LINQ/DLR的树编译器产生的代码,会不支持,会报错
- CFR
- 官网
- CFR - yet another java decompiler.
- http://www.benf.org/other/cfr/
- 特点
- 支持java 9/10/12等
- by Lee Benfield is well on its way to becoming the premier Java Decompiler. Lee and I actually work for the same company and share regression tests. We're engaged in a friendly competition to see who can deliver a better decompiler. Based on his progress thus far, there's a very good chance he will win--at least on decompiling obfuscated code
- 官网
- Krakatau
- https://github.com/Storyyeller/Krakatau
- by Robert Grosse, written in Python, includes a robust verifier. It focuses on translating arbitrary bytecode into valid Java code, as opposed to reconstructing the original code.
- Fernflower
- Cavaj
- Procyon
- mstrobel / Procyon — Bitbucket
- https://bitbucket.org/mstrobel/procyon
- 官网使用文档
- mstrobel / Procyon / wiki / Java Decompiler — Bitbucket
- https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler
- 官网使用文档
- 重点关注Java 5之后的特性支持
- 这些是其他很多反编译工具不支持的,会报错的
- 更详细的解释
- 枚举声明
- 枚举和字符串的switch表达式
- 目前只测试支持javac 1.7
- 局部类Local classes
- 匿名和带名字的都支持
- 注解/标注Annotations
- Java 8的Lambdas和方法引用(比如 :: 操作符)
- -》对很多人了来说,比较关注:支持java8
- Procyon本身是命令行工具
- 基于Procyon的带GUI图形界面的工具
- SecureTeam Java Decompiler
- http://www.secureteam.net/Java-Decompiler.aspx
- A JavaFX-based decompiler front-end with fast and convenient code navigation. Download it, or launch it directly from your browser.
- Luyten
- https://github.com/deathmarine/Luyten
- An open source front-end by deathmarine
- Bytecode Viewer
- https://github.com/Konloch/bytecode-viewer
- -》
- https://bytecodeviewer.com
- an open source Java decompilation, disassembly, and debugging suite by @Konloch. It can produce decompiled sources from several modern Java decompilers, including Procyon, CFR, and FernFlower.
- Helios
- https://github.com/samczsun/Helios
- similar to Bytecode Viewer. But is a completely new and independent project, which uses SWT instead of Swing.
- Enigma
- http://www.cuchazinteractive.com/enigma/
- Originally used to deobfuscate Minecraft versions. Uses Procyon internally.
- 作者已不再维护
- SecureTeam Java Decompiler
- Jadx
- 也支持从jar查看java代码
- 和导出全部代码
- 导出方式还有2种
- 保存全部代码
- 和以Gradle的方式导出源码
- 如果打开的是apk文件
- 则导出了dex对应的java源码外,还有assets等资源和其他文件
- -》更加利于你得到更接近apk的原始代码的项目结构
- 导出方式还有2种
- 同时还支持直接打开apk
- 查看apk中的各种文件
- 包括java源代码
- 查看apk中的各种文件
- 和导出全部代码
- 也支持从jar查看java代码
- JD-GUI