本文主要是介绍Ubuntu下使用dex2jar,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
- 解压dex2jar-version.zip文件到一个目录. 比方说 /home/panxiaobo/, C:\
unzip -x dex2jar-version.zip -d /home/panxiaobo- 使用 dex2jar 来生成 .jar 文件. dex2jar会在工作目录下生成一个someApk-dex2jar.jar文件.
linux sh /home/panxiaobo/dex2jar-version/d2j-dex2jar.sh /home/panxiaobo/someApk.apkwindows C:\dex2jar-version\d2j-dex2jar.bat someApk.apk- 使用反编译工具获取查看源代码
- jd-gui
- JAD
就这么简单
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
使用 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文件。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$
这篇关于Ubuntu下使用dex2jar的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!