Ubuntu下使用dex2jar

用户指南  : 下载dex2jar最新版 http://code.google.com/p/dex2jar/downloads/list

  1. 解压dex2jar-version.zip文件到一个目录. 比方说 /home/panxiaobo/, C:\
    unzip -x dex2jar-version.zip -/home/panxiaobo
  2. 使用 dex2jar 来生成 .jar 文件. dex2jar会在工作目录下生成一个someApk-dex2jar.jar文件.
       linux sh /home/panxiaobo/dex2jar-version/d2j-dex2jar.sh /home/panxiaobo/someApk.apk
       windows C:\dex2jar-version\d2j-dex2jar.bat someApk.apk
  3. 使用反编译工具获取查看源代码

           就这么简单

命令行提示:

htt@htt-Lenovo-V470c:~/bootmenu/orignal$ cd /home/htt/dex2jar htt@htt-Lenovo-V470c:~/dex2jar$ sh d2j-dex2jar.sh convert dex to jar usage: d2j-dex2jar [options] <file0> [file1 ... fileN] options: -d,--debug-info translate debug info -e,--exception-file <file> detail exception file, default is $current_dir/[file-name]-error.zip -f,--force force overwrite -h,--help Print this help message -n,--not-handle-exception not handle any exception throwed by dex2jar -o,--output <out-jar-file> output .jar file, default is $current_dir/[file-name]-dex2jar.jar -os,--optmize-synchronized optmize-synchronized -p,--print-ir print ir to Syste.out -r,--reuse-reg reuse regiter while generate java .class file -s same with --topological-sort/-ts -ts,--topological-sort sort block by topological, that will generate more readable code version: reader-1.13, translator-0.0.9.12, ir-1.10

反编译classes.dex过程如下:

htt@htt-Lenovo-V470c:~/dex2jar$ d2j-dex2jar /home/htt/bootmenu/orignal/classes.dex d2j-dex2jar: command not found htt@htt-Lenovo-V470c:~/dex2jar$ sh d2j-dex2jar.sh /home/htt/bootmenu/orignal/classes.dex dex2jar /home/htt/bootmenu/orignal/classes.dex -> classes-dex2jar.jar htt@htt-Lenovo-V470c:~/dex2jar$

使用 d2j-dex2jar /home/htt/bootmenu/orignal/classes.dex未果,可能要把相关的shell脚本文件和jar文件加入到path中才行,于是使用 sh d2j-dex2jar.sh /home/htt/bootmenu/orignal/classes.dex命令,在dex2jar文件夹下生成了classes-dex2jar.jar文件。
接着全用 JD-GUI工具查看jar文件的java原代码。
Ubuntu下使用dex2jar(查看dex文件原代码) - 改变自己 - 改变自己的博客

源地址:http://bujingyun23.blog.163.com/blog/static/181310243201311105012398/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值