标签:
APK文件本身是一个压缩包,直接用解压工具即可打开,但里面的文件都已被编码为二进制文件格式,不能直接看,比如程序描述文件AndroidManifest.xml。
使用apktool工具可以将这些文件解码还原出来。apktool(http://code.google.com/p/android-apktool/ 现在地址是: http://ibotpeaches.github.io/Apktool/ )是一个非常著名的开源工具包,功能很强大,可以解包APK文件并重新打包,常用来汉化Android应用。
安装方法,参看 http://ibotpeaches.github.io/Apktool/install/ :
1.5.2
) apktool.bat
) apktool.jar
apktool.jar
& apktool.bat
) to your Windows directory (Usually C://Windows
) C://Windows
, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable. apktool
) ia32-libs
) downloaded and installed by your linux package manager, if you are on a 64bit unix system. apktool.jar
apktool.jar
& apktool
) to /usr/local/bin
(root needed) chmod +x
) apktool
) apktool.jar
apktool.jar
& apktool
) to /usr/local/bin
(root needed) chmod +x
) Note - Wrapper scripts are not needed, but helpful so you don’t have to type java -jar apktool.jar over and over.
我这里没法把他们放在 bin 目录下, 而是放在了 /software/android/tools 目录下。
这样,我解压缩下载目录下的一个apk文件,就是下面命令:
/software/android/tools/apktool d ~/Downloads/com.supercell.clashofclans_v8.116.2-722_Android-4.0.3.apk
解压缩后的目录是: /software/android/tools/ 下面目录。
参数说明:
apktool d [demo.apk] // 参数是 d 而不是 -d。
./apktool
Apktool v2.0.3 - a tool for reengineering Android apk files
with smali v2.1.0 and baksmali v2.1.0
Copyright 2014 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.out
-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://ibotpeaches.github.io/Apktool/
For smali/baksmali info, see: https://github.com/JesusFreke/smali
标签:
原文地址:http://www.cnblogs.com/ghj1976/p/5275395.html