首页
社区
课程
招聘
[原创]android apk 逆向中常用工具一览
发表于: 2014-3-4 21:48 12289

[原创]android apk 逆向中常用工具一览

2014-3-4 21:48
12289
android apk 逆向中常用工具一览
关于apk 逆向中的一些工具的使用,看了不少文章,也使用过有很长一段时间了,今天对此做一总结,高手可以飘过,新人可以瞄两眼~~:

几种文件之间的转换命令:

1. odex -> smali

  java -jar  baksmali.jar  -a <api_level>  -x <odex_file>  -d <framework_dir>

2.smali ->dex

  java -Xmax512M -jar samli-2.0.jar  <smali_dir>   -o classes.dex

3.dex ->odex

  在android平台下使用命令dexopt-wrapper实现:

  dexopt-wrapper 123.apk 123.odex

4.  对odex的签名,用于对修改后的odex文件,使用源文件的一部分文件头:

    busybox dd if=android.policy.odex.bak of=android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc

5. 对apk的签名 使用专门的签名工具:

  java -jar signapk.jar platform.x509.pem platform.pk8 input.apk output.apk

6. Apktools的使用

Apktool 是apk的逆向分析工具,可用于对apk的打包 解包。

APKtool 软件包有 2 个程序组成:apktool.jar 和 aapt  运行 apktools.jar 需要 java 环境(1.6.0 版本以上)。

apktool.jar 用于解包,apktool.jar 和 aapt.exe 联合用于打包。

frank@ubuntu-troxy:~$ java   -jar  /data/dtgy.package/bin/apktool.jar

Apktool v1.4.3 - a tool for reengineering Android apk files

Copyright 2010 Ryszard Wi?niewski <brut.alll@gmail.com>

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] <file.apk> [<dir>]

        Decode <file.apk> to <dir>.

        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 <tag>, --frame-tag <tag>

            Try to use framework files tagged by <tag>.

        --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] [<app_path>] [<out_file>]

        Build an apk from already decoded application located in <app_path>.

        It will automatically detect, whether files was changed and perform

        needed steps only.

        If you omit <app_path> then current directory will be used.

        If you omit <out_file> then <app_path>/dist/<name_of_original.apk>

        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 <framework.apk> [<tag>]

        Install framework file to your system.

For additional info, see: http://code.google.com/p/android-apktool/

Apktool工具下载链接:https://code.google.com/p/android-apktool/

相关的工具有:

java -jar AXMLPrinter2.jar AndroidManifest.xml 解开在apk 中的 AndroidManifest.xml

smali 工具  https://code.google.com/p/smali/downloads/list

dexopt-wrapper 源码 https://android.googlesource.com/platform/build/+/donut-release/tools/dexpreopt/dexopt-wrapper/

[峰会]看雪.第八届安全开发者峰会10月23日上海龙之梦大酒店举办!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 11
活跃值: (80)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
支持一下啦!
2014-3-5 09:15
0
雪    币: 184
活跃值: (14)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
谢谢分享
2014-12-7 14:19
0
雪    币: 156
活跃值: (15)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
很好的总结
2014-12-10 23:22
0
雪    币: 207
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
支持LZ!!!!!!!
2014-12-15 15:11
0
游客
登录 | 注册 方可回帖
返回
//