用apktool工具进行apk的编译和反编译
1.apktool下载安装
给一个2.0版的csdn地址:http://download.csdn.net/download/txj8612/7408775
下载后无需安装,直接解压缩,得到三个文件:aapt.exe、apktool.bat、apktool.jar。在这三个文件所在的目录打开cmd,可以开始编译和反编译了。
2.输入apktool命令,查看帮助
Apktool v2.0.0-Beta9 - a tool for reengineering Android apk files
with smali v2.0.3 and baksmali v2.0.3
Copyright 2010 Ryszard Wi?niewski <brut.alll@gmail.com>
Updated by Connor Tumbleson <connor.tumbleson@gmail.com>
usage: apktool
-advance,--advanced prints advance information.
-version,--version prints the version then exits
usage: apktool if|install-framework [options] <framework.apk>
-p,--frame-path <dir> Stores framework files into <dir>.
-t,--tag <tag> Tag frameworks using <tag>.
usage: apktool d[ecode] [options] <file_apk>
-f,--force Force delete destination directory.
-o,--output <dir> The name of folder that gets written. Default is apk.ou
t
-p,--frame-path <dir> Uses framework files located in <dir>.
-r,--no-res Do not decode resources.
-s,--no-src Do not decode sources.
-t,--frame-tag <tag> Uses framework files tagged by <tag>.
usage: apktool b[uild] [options] <app_path>
-f,--force-all Skip changes detection and build all files.
-o,--output <dir> The name of apk that gets written. Default is dist/name
.apk
-p,--frame-path <dir> Uses framework files located in <dir>.
For additional info, see: http://code.google.com/p/android-apktool/
For smali/baksmali info, see: http://code.google.com/p/smali/
3.反编译命令d[ecode]
$apktool d abc.apk -o abc
将abc.apk反编译并输出到文件夹abc。其中abc.apk和abc文件夹都在apktool目录下
4.编译命令b[uild]
$apktool b abc