安装
官方下载bak2smali.jar https://bitbucket.org/JesusFreke/smali/downloads/
检查java1.8运行环境
(1)下载d2j_dex2jar https://github.com/DexPatcher/dexpatcher-gradle-tools/tree/master/tools/dex2jar
(2)解压到本地磁盘某个目录
(3)设置路径到环境变量
使用
将dex文件decode成smali文件,步骤如下:
(1)将apk重命名为zip;
(2)用zip解压classes.dex;
(3)执行 d2j-baksmali classes.dex;
baksmali classes.dex -> classes-out //将dex文件decode成smali文件
可选参数如下:
usage: d2j-baksmali [options] <dex>
options:
-b,--no-debug-info [not impl] don't write out debug info (.local, .p aram, .line, etc.) //跳过debug
-f,--force force overwrite //强制覆盖目标文件
-h,--help Print this help message//帮助
-l,--use-locals output the .locals directive with the number of non-parameter registers, rather than the .register//?
-o,--output <out> output dir of .smali files, default is $current_dir/[jar-name]-out/ //指定输出文件夹
-p,--no-parameter-registers use the v<n> syntax instead of the p<n> syntax for registers mapped to method parameters//??