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. shell之函数

    function 所有函数在使用前必须定义.这意味着必须将函数放在脚本开始部分,直至shell解释器首次发现它时,才可以使用.调用函数仅使用其函数名即可.可以将函数看作是脚本中的一段代码,但是有一个主 ...

  2. WCF Client is Open Source

    WCF Client is Open Source Wednesday, May 20, 2015 Announcement New Project WCF We’re excited to anno ...

  3. JS对日期时间的操作

    代码: //判断是否超期(有效期开始超过一年后算已超期) function IsEffect(effectDate) { var val = ""; var currentDate ...

  4. Innodb IO优化 — 数据库表设计 转

    数据库表设计这块学问比较多,我这里单从互联网角度出发同时结合Innodb的特性给出一些设计方法供大家参考.本文构建大概分两分部分:Innodb的特性及设计中如何利用这种特性. Innodb特性: In ...

  5. EditText的圆角与边框

    先看一下效果图: 先创建一个xml文件edittext_shape.xml: <?xml version="1.0" encoding="utf-8"?& ...

  6. MongoDB备份与导入

    导出mongodb的数据 mongodump -d nodes -o url 导入mongodb数据mongorestore --db nodes url 删除mongodb的数据库db.dropDa ...

  7. visual studio 编译时 出现 Files 的值 乱码

    参考了:http://blog.163.com/jiang_tao_2010/blog/static/121126890201031031337332/ 最近在做程序时,在生成解决方法过程中,电脑出现 ...

  8. SQLite介绍、学习笔记、性能测试

    SQLite介绍.学习笔记.性能测试 哪些人,哪些公司或软件在用SQLite: Nokia's Symbian,Mozilla,Abobe,Google,阿里旺旺,飞信,Chrome,FireFox可 ...

  9. (转)LitJson 遍历key

    本文转载自:http://blog.csdn.net/inlet511/article/details/47127579 用LitJson插件获取到的对象,如果想遍历对象中包含的子对象的key,可以用 ...

  10. Nginx负载均衡和反向代理设置

    Nginx负载均衡: 格式: upstream 别名 {    #别名一般要有意义,能看出是做什么的 server ip:端口;    #要实现负载的服务器的ip.端口号}  例: upstream ...