wiki:https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler

由于jd好多年没更新了,今天找到这个新的开源反汇编,很不错

分享一下。

之前一直用jd,结果很多时候要看smali

现在好多了

Java Decompiler

As a developer who splits his time between the .NET and Java platforms, I have been surprised and dismayed by the lackluster selection of decompilers in the Java ecosystem. Jad (no longer maintained) and JD-GUI are pretty decent choices, but the former does not support Java 5+ language features, and the latter tends to barf on code emitted by my LINQ/DLR tree compiler. Neither is open source.

To address the situation, I recently started developing a decompiler myself, inspired by (and borrowed heavily from) ILSpy and Mono.Cecil.

Status

While still incomplete, my own tests seem to indicate that the Procyon decompiler can generally hold its own against the other leading Java decompilers out there. There are, however, some known issues.

Known Issues

  1. Classes compiled with Eclipse (or anything other than javac) may produce less than optimal results, especially for constructs like String-based switch statements. Up until now, I have mostly tested classes compiled with Javac. I will work to improve support for other compilers as time goes on.

Why should I care?

The Procyon decompiler handles language enhancements from Java 5 and beyond that most other decompilers don't. It also excels in areas where others fall short. Procyon in particular does well with:

  1. Enum declarations
  2. Enum and String switch statements (only tested against javac 1.7 so far)
  3. Local classes (both anonymous and named)
  4. Annotations
  5. Java 8 Lambdas and method references (i.e., the :: operator).

Output Comparison

I've posted some simple input/output comparisons comparing original source, decompiled output, and JD-GUI output.

How to Use

Java 7 is required to run. Unfortunately, I do not yet have a slick GUI front-end like JD-GUI (but third-party front-ends do exist--see below!). I do, however, offer color-coded output for consoles supporting ANSI/xterm-256. I also offer three output modes:

  1. Java (default)
  2. Raw Bytecode (similar to javap, but prettier; run with -r)
  3. Bytecode AST (an intermediate representation; run with -b, add -u for unoptimized)

Note that color-coded output requires an ANSI-compatible console. Unfortunately, this rules out the Windows command prompt. To get color-coded output on Windows, I recommend using a terminal environment like MobaXterm. If ANSI detection fails for whatever reason (as it does with MobaXterm), you can force it on by running with -DAnsi=true.

The main class (entry point) is com.strobel.decompiler.DecompilerDriver. It's also the entry class for decompiler.jar (available under Downloads). You can pass in one or more types to be processed. At the moment, all output goes to System.out. I will probably add file-based output in the future. To call the public API externally, use the helper class com.strobel.decompiler.Decompiler.

The input types can be fully-qualified names in dotted or binary form (e.g., java.lang.String or java/lang/String) or relative/absolute file paths (path/to/MyClass.class or C:\src\path\to\MyClass.class) or even whole jar files. If you pass in a type name, it will attempt to load it out of the user or bootstrap classpath. If you have trouble getting it to locate classes from jars or directories in your CLASSPATH environment variable, try running the main class directly instead of running with -jar.

I still have a remarkably flimsy grasp of how all this classpath business works in Java, so if someone would like to educate me (or submit a pull request), be my guest :).

Usage Examples

Assuming that you have renamed the download file from procyon-decompiler-x.x.xx.jar to decompiler.jar, the following are some common options.

Show help/usage information and exit.

$ java -jar decompiler.jar
$ java -jar decompiler.jar -?

Decompile a single class to the console.

$ java -jar decompiler.jar java.lang.String
$ java -DAnsi=true -jar decompiler.jar java.util.Collections

Decompile a whole jar to a directory.

$ java -jar decompiler.jar -jar myJar.jar -o out

GUI Front Ends

Don't want to use the command line? Try one of these GUI front-ends for Procyon:

新的开源java反汇编程序Procyon的更多相关文章

  1. 手把手教你提交Jar包到Maven公共仓库 | 萌新写开源02

    在上一篇文章中,我介绍了自己的SpringBoot Starter项目,可以让我们使用注解的方式轻松地获取操作日志,并推送到指定数据源. 之前,我的项目开源在Github上,大家想要用我的项目,还得把 ...

  2. *关于httl开源Java模板的使用心得

    1.简介 HTTL (Hyper-Text Template Language) 是一个高性能的开源JAVA模板引擎, 适用于动态HTML页面输出, 可替代JSP页面, 指令和Velocity相似. ...

  3. Google 开发新的开源系统 Fuchsia

    google 最新os 下载 https://github.com/fuchsia-mirror/magenta 本文转自:http://www.oschina.net/news/76094/goog ...

  4. [置顶] 提高生产力:开源Java工具包Jodd(Java的”瑞士军刀”)

    官方网站:http://jodd.org/ 下载地址:http://jodd.org/download/index.html Jodd=tools + ioc + mvc + db + aop + t ...

  5. WEKA,一个开源java的数据挖掘工具

    开始研究WEKA,一个开源java的数据挖掘工具. HS沉寂这么多天,谁知道偏偏在我申请离职的时候给我安排了个任务,哎,无语. 于是,今天看了一天的Weka. 主要是看了HS提供的三个文章(E文,在g ...

  6. Nutch 是一个开源Java 实现的搜索引擎

    Nutch 是一个开源Java 实现的搜索引擎.它提供了我们运行自己的搜索引擎所需的全部工具.包括全文搜索和Web爬虫. Nutch的创始人是Doug Cutting,他同时也是Lucene.Hado ...

  7. httl开源JAVA模板引擎,动态HTML页面输出

    HTTL(Hyper-Text Template Language)是一个适用于HTML输出的开源JAVA模板引擎,适用于动态HTML页面输出,可用于替代JSP页面,它的指令类似于Velocity. ...

  8. 新 Netflix 开源门户

    Netflix 开源改革计划:新 Netflix 开源门户 http://www.oschina.net/news/67555/evolution-of-open-source-at-netflix ...

  9. 新服务器上装java PHP环境有什么一键安装的方便的方法?一般都是怎么安装环境的?

     新服务器上装java PHP环境有什么一键安装的方便的方法?一般都是怎么安装环境的?  linode digitalocean都有很好的教程,下面是ubuntu和centos的两个教程连接. How ...

随机推荐

  1. ubuntu16.04 python3.5 opencv的安装与卸载(转载)

    转载https://blog.csdn.net/qq_37541097/article/details/79045595 Ubuntu16.04 自带python2.7和python3.5两个版本,默 ...

  2. 2017 ACM/ICPC Asia Regional Shenyang Online array array array

    2017-09-15 21:05:41 writer:pprp 给出一个序列问能否去掉k的数之后使得整个序列不是递增也不是递减的 先求出LIS,然后倒序求出最长递减子序列长度,然后判断去k的数后长度是 ...

  3. 【异常记录(五)】C# 无法发送具有此谓词类型的内容正文错误

    今天请求接口直接调了以前写好的方法,结果报了(405)不支持方法的错误,一看是GET写成POST了,改成GET之后,又报了无法发送具有此谓词类型的内容正文错误的错误 原来之前的方法里面有GetRequ ...

  4. 秒懂算法1——冒泡排序,及一种小改进(C#实现)

    算法思路: 重复走访每两个相邻元素,比较大小交换位置,直至排序完成. 有兴趣电话可以看一下这个[冒泡排序踢踏舞]的视频,很形象的演示了排序过程,额呵呵~~ 性质: 冒泡排序是一种原地排序(只有常数个元 ...

  5. arm-linux-gcc安装使用教程

    arm-linux-gcc如何下载安装2(转) [转]ubuntu下交叉编译环境构建(arm-linux-gcc-3.4.1.tar.bz2 ) 2009-03-03 10:05 1.下载arm-li ...

  6. 解决httpclient因为保持永久长连接造成连接吊死的问题

    httpclient使用了连接池,如果没有设置keep-alive策略,PoolingHttpClientConnectionManager会默认使用永久连接. 最近在调用京东api时,发现一个请求开 ...

  7. 在Web API 2 中实现带JSON的Patch请求

    译文:http://www.cnblogs.com/kexxxfeng/p/the-patch-verb-in-web-api-2-with-json.html 原文:https://carly.io ...

  8. python UI自动化测试

    为了减小维护成本: 1.UI自动化测试需要有较为稳定的环境 2.代码设计合理,那么我们就需要面向对象的设计一个框架,将重复的代码模块化 一.首先总结一下 UI自动化大概要哪些模块 1.config(配 ...

  9. day29 主机管理-堡垒机2-原生ssh会话记录

    day29课堂代码:https://github.com/liyongsan/git_class/tree/master/day29 课堂笔记: 通过原生Ssh 记录会话1. 在我们自己的堡垒机交互脚 ...

  10. 【Python】测算代码运行时间

    整理自这里和这里 timeit模块 timeit模块定义了接受两个参数的 Timer 类.两个参数都是字符串. 第一个参数是你要计时的语句或者函数. 传递给 Timer 的第二个参数是为第一个参数语句 ...