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/

Quick Check

  • Apktool 2.x (Versions after 1.5.2)
    1. Is Java 1.7 installed?
    2. Does executing java -version on command line / command prompt return 1.7?
    3. If not, please install Java 7 and make it the default.

Installation for Apktool 2.x

  • Windows:
    1. Download Windows wrapper script (Right click, Save Link As apktool.bat)
    2. Download apktool-2 (find newest here)
    3. Rename downloaded jar to apktool.jar
    4. Move both files (apktool.jar & apktool.bat) to your Windows directory (Usually C://Windows)
    5. If you do not have access to C://Windows, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
    6. Try running apktool via command prompt
  • Linux:
    1. Download Linux wrapper script (Right click, Save Link As apktool)
    2. Download apktool-2 (find newest here)
    3. Make sure you have the 32bit libraries (ia32-libs) downloaded and installed by your linux package manager, if you are on a 64bit unix system.
    4. (This helps provide support for the 32bit native binary aapt, which is required by apktool)
    5. Rename downloaded jar to apktool.jar
    6. Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
    7. Make sure both files are executable (chmod +x)
    8. Try running apktool via cli
  • Mac OS X:
    1. Download Mac wrapper script (Right click, Save Link As apktool)
    2. Download apktool-2 (find newest here)
    3. Rename downloaded jar to apktool.jar
    4. Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
    5. Make sure both files are executable (chmod +x)
    6. Try running apktool via cli

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

APKTool 提取APK文件的资源的更多相关文章

  1. apk去广告工具(利用apktool去除apk文件里的广告)

    基本知识 apk安装包的文件结构 以知名桌面软件“LauncherPro”为例,apk安装包文件目录: 文件目录如下: - META-INF - res - anim - color - drawab ...

  2. 关于ipa和apk文件的解压

    移动互联网中,主要的两个平台是Android和ios,android上文件的安装包是后缀名为apk的文件,ios上文件的安装包是后缀名为ipa的文件,在本文分析一下这两种文件的特点,以及如何用程序去解 ...

  3. apktool反编译apk文件

    1.首先下载apktool文件,可以从我的网盘下载:http://pan.baidu.com/s/1nvPdbVb 2.将你的apk文件和apktool文件放到一个文件夹下,这里就放到D:\study ...

  4. apktool 在mac下的使用 -反编译安卓apk文件

    1.下载apktool 点击这里下载 ,里面有两个文件,一个是.jar,一个是自己写的脚本.sh 注:最新的apktool.jar 文件可以点击这里下载 .sh脚本是自写脚本可不用更新最新,下载的ja ...

  5. 『原』在Linux下反编译Android .apk文件 使用apktool dex2jar JD-eclipse

    一.使用apktool 将 apk反编译生成程序的源代码和图片.XML配置.语言资源等文件 具体步骤: (1)下载反编译工具包:apktool 官方的打不开 http://apktool.shouji ...

  6. mac下破解apk文件以及apktool的相关使用

    Android apktool是一个用来处理APK文件的工具,可以对APK进行反编译生成程序的源代码和图片.XML配置.语言资源等文件,也可以添加新的功能到APK文件中.用该工具来汉化Android软 ...

  7. C# .exe和.dll文件图标资源提取工具

    Windows 可执行文件(.exe)和动态库文件(.dll)图标资源提取工具 GitHub 功能 图标资源预览 图标资源导出(仅支持导出 PNG 格式) 代码 获取图标资源使用了 Win32 API ...

  8. Xamarin android如何反编译apk文件

    Xamarin android 如何反编译 apk文件 这里推荐一款XamarinAndroid开发的小游戏,撸棍英雄,游戏很简单,的确的是有点大.等一下我们来翻翻译这个Xamarin Android ...

  9. [翔哥高手无敌之路]0-002.如何提取apk中的信息?

    面对一款apk软件,我们如何去获取它的信息,如何获取它的版本号,包名,或者ID,用户权限,这些信息都隐藏在apk包中的AndroidManifest.xml文件中,解开它我们就能获取任何想要的信息.但 ...

随机推荐

  1. C++流格式控制符的使用【来自网络】

    注意添加<iomanip>头文件. 使用控制符控制输出格式 控制符 作用 dec 设置整数的基数为10 hex 设置整数的基数为16 oct 设置整数的基数为8 setbase(n) 设置 ...

  2. javascript 停止事件冒泡以及阻止默认事件冒泡

    停止事件冒泡 function stopBubble(e) { // 如果提供了事件对象,则这是一个非IE浏览器 if ( e && e.stopPropagation ) { // ...

  3. 【转】关于PHP的header("P3P: CP=CURa……")

    对于IE来说(默认安全级别下),iframe.img.link等标签都是只发送session cookie(又叫 第一方cookie),拦截本地cookie发送(又叫第三方cookie).当这些标签跨 ...

  4. python中保留两位小数

    今天写程序的时候碰到了一个问题关于如何控制浮点数只显示小数点后两位,正常的想法是用round函数,例如 round(a, 2),但是在面对下面的问题时候round就不太好用了 >>> ...

  5. jquery操作html data-* 属性的坑

  6. officetohtml

    http://blog.csdn.net/mcpang/article/details/6817643

  7. CentOS 6.6 yum 方式安装sunversion 服务器

    检查已安装版本 #检查是否安装了低版本的SVN[root@localhost /]# rpm -qa subversion #如果存储旧版本,卸载旧版本SVN[root@localhost modul ...

  8. ORACLE 常用数值函数

    1 ABS(n)返回数值弄参数的绝对值.它接受一个数值型值作为输入参数,或者任何可以隐式地转换为数值型值的值.并且返回数值型值的绝对值. Select abs(-1) from dual ABS(-1 ...

  9. VBA 按照文件类型名称打开一个文件

    Application.GetOpenFilename(fileFilter, fileIndex, fileSelectTitle, button, False) fileFilter: 指定能够被 ...

  10. SVN 获取源码一直没绿色打勾的标识原因。

    左天晚上,找了一晚的原因,各种尝试,SVN 获取源码一直没绿色打勾的标识原因. 后来在百度知道发现了这个原因,是因为我没有使用的是EXPORT,这样只是导出没有代码关联, 只要 使用checkout就 ...