您当前的位置: 首页 >  android

顺其自然~

暂无认证

  • 2浏览

    0关注

    1317博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

android逆向工程之apktool工具集

顺其自然~ 发布时间:2019-07-20 16:21:03 ,浏览量:2

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

apk反编译软件有个组合套餐,apktool、dex2jar和jd-gui。

apktool——可以反编译软件的布局文件、图片等资源,方便大家学习一些很好的布局;

dex2jar——将apk反编译成java源码(classes.dex转化成jar文件);

jd-gui——查看APK中classes.dex转化成出的jar文件,即源码文件。

1、apktool文件的下载 apktool是反编译Android apk文件的工具,apktool的主页是https://ibotpeaches.github.io/Apktool/。我们可以从这里找到最新版本的apktool.jar文件https://bitbucket.org/iBotPeaches/apktool/downloads/,以及apktool的安装说明。

2、apktool的安装 前面我们已经下载了最新的apktool.jar文件,最新版本是2.4.0,请按照以下步骤操作,参考https://ibotpeaches.github.io/Apktool/install/:

新建文本文件,将下面的脚本复制到文本并保存,然后重命名为apktool.bat; @echo off set PATH=%CD%;%PATH%; java -jar "%~dp0\apktool.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9 从上面脚本中也可以看到是用apktool.jar文件去处理; 将下载的apktool_2.4.0.jar文件重命名为apktool.jar;3、apktool的使用 将上述两个文件apktool.bat和apktool.jar文件放到同一文件夹下(任意路径),打开命令窗口(win+R-->cmd-->enter); 定位到apktool所在的文件夹; 输入以下命令: apktool d  ***.apk  -o objectFolderPath   其中,objectFolderPath为可选项,如果此项不存在,软件将会在apktool文件夹下新建一个apk文件名的文件夹,否则存储到目标文件夹;

4、功能描述

D:\My Documents\Desktop\apktool-install-windows-r04-brut1>apktool 
Apktool v1.4.3 - a tool for reengineering Android apk files  
Copyright 2010 Ryszard Wi?niewski   
Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)  
Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]  
COMMANDs are:  
    d[ecode] [OPTS]  []  //解压APK
        Decode  to .  
        OPTS:  
        -s, --no-src  
            Do not decode sources.  
        -r, --no-res  
            Do not decode resources.  
        -d, --debug  
            Decode in debug mode. Check project page for more info.  
        -f, --force  
            Force delete destination directory.  
        -t , --frame-tag   
            Try to use framework files tagged by .  
        --keep-broken-res  
            Use if there was an error and some resources were dropped, e.g.:  
            "Invalid config flags detected. Dropping resources", but you  
            want to decode them anyway, even with errors. You will have to  
            fix them manually before building.  
    b[uild] [OPTS] [] []  //构建APK
        Build an apk from already decoded application located in .  
  
        It will automatically detect, whether files was changed and perform  
        needed steps only.  
  
        If you omit  then current directory will be used.  
        If you omit  then /dist/  
        will be used.  
  
        OPTS:  
  
        -f, --force-all  
            Skip changes detection and build all files.  
        -d, --debug  
            Build in debug mode. Check project page for more info.  
  
    if|install-framework  []  
        Install framework file to your system.  
  
For additional info, see: http://code.google.com/p/android-apktool/  

5、常见问题

apktools 工具反编译抛出异常 :Exception in thread “main” brut.androlib.AndrolibException: Could not decode

使用apktools反编译apk时,输入命令:apktool.bat  d test.apk 

  此时,可能会报bug:

     Exception in thread “main” brut.androlib.AndrolibException: Could not decode 

  这个问题,就是apktool.jar比较老旧的问题。

  apktools.jar下载官网:

https://ibotpeaches.github.io/Apktool/install/

  对应平台下载,更新即可。

关注
打赏
1662339380
查看更多评论
立即登录/注册

微信扫码登录

0.0409s