博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【class2src】Decompiler
阅读量:4557 次
发布时间:2019-06-08

本文共 699 字,大约阅读时间需要 2 分钟。

方法源自:

 

功能:给定一个.class文件,得到反编译的源码。

 

下载后导入工具包: ()

 

Demo:

package util;import java.io.StringWriter;public class Decompile {	public void main(String[] args) {		String classPath = “*.class”; //input path of .class file		String src = class2src(classPath);		System.out.println(src);	}	public String class2src(String classPath) {		final StringWriter writer = new StringWriter();		String src = "";		try {			com.strobel.decompiler.Decompiler.decompile(classPath, new com.strobel.decompiler.PlainTextOutput(writer));		} catch (IllegalArgumentException e) {			System.out.println("classpath : " + classPath);		} finally {			src = writer.toString();		}		return src;	}}

转载于:https://www.cnblogs.com/XBWer/p/7295081.html

你可能感兴趣的文章
迅雷API:实现文件下载
查看>>
Socket编程实践(2) Socket API 与 简单例程
查看>>
print 与标准输出
查看>>
pytest单元测试框架(day01)
查看>>
利用Azure Automation实现云端自动化运维(2)
查看>>
Linux学习说明
查看>>
【网络流24题】负载平衡问题(费用流)
查看>>
bzoj 3507 DP+哈希
查看>>
递归问题==优化 还有数据库sqlreader
查看>>
IOS第四天(2:字典转模型plist)
查看>>
什么是数据集
查看>>
Android开发数据库三层应用-DataSnap
查看>>
关于setTimeout运行机制
查看>>
2019 Multi-University Training Contest 4
查看>>
学号 《信息安全系统设计基础》第7周学习总结(一)
查看>>
POJ1741Tree [点分治]【学习笔记】
查看>>
BZOJ 3238: [Ahoi2013]差异 [后缀自动机]
查看>>
UVA 12633 Super Rooks on Chessboard [fft 生成函数]
查看>>
memcache 启动 failed to start
查看>>
欧拉函数与欧拉定理
查看>>