Apktool反编译apk资源文件

Android开发过程中,如何查看已经打包的APK内部xml呢,google下找到了apktool这个工具,

apktool项目现在已经迁移到了github:apktool 目前最新版本2.2.2,如何安装呢,官方有详细的操作说明

Install Instructions

Quick Check

  1. Is at least Java 1.7 installed?
  2. Does executing java -version on command line / command prompt return 1.7 or greater?
  3. If not, please install Java 7+ and make it the default.

Installation for Apktool

  • 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

第一步要先安装java1.7及以上版本

这里以windows系统为例

翻译过来:

1.下载bat脚本文件并保存为apktool.bat

2.下载apktool的jar包

3.重命名2中下载的jar名为apktool.jar

4.将这2个文件放到同一个目录下比如系统目录C://Windows

5.如果没有权限选择C盘 也可以放到其他目录 然后再设置环境变量

6.然后就可以在命令行里运行apktool来进行解包了

说明:实际验证一般只要放在统一非中文目录然后命令行切换到当前目录运行即可

指令格式:

apktool d xxx.apk    --这是反编译命令。xxx.apk就是在apktool目录下需要反编译的apk文件
apktool b xxx       --这是回编译命令。xxx就是反编译后的文件所在文件夹,这个文件夹一般是以之前反编译的文件名为名称

测试环境:WIN10 1607

原文地址:https://www.cnblogs.com/merray/p/6728221.html