主要利用的jar包: apktool.jar
public static void main(String[] args) {
baksmaliOptions options = new baksmaliOptions();
options.jobs = 100;
//设置classes.dex文件转化为smali文件的目录
options.outputDirectory = "D:\\report\\test\\smali";
DexFile dexFile = null;
try {
dexFile = DexFileFactory.loadDexFile(
new File("D:\\report\\test\\classes.dex"),
options.apiLevel);
baksmali.disassembleDexFile(dexFile, options);
} catch (IOException e) {
e.printStackTrace();
}
}