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

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

2014-3-4 21:48
12409
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 (864K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4N6%4N6#2)9J5k6h3q4H3j5h3y4Z5k6g2)9J5k6h3!0J5k6#2)9J5c8X3I4A6j5$3g2F1M7$3g2K6i4K6u0r3e0p5W2o6c8f1&6e0c8g2)9J5k6o6u0Q4x3X3f1H3)

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: baeK9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8X3y4G2k6r3g2Q4x3X3g2Y4L8$3!0Y4L8r3g2Q4x3X3g2U0L8$3#2Q4x3V1k6H3i4K6u0r3j5h3&6V1M7X3!0A6k6q4)9J5k6r3q4H3K9%4c8G2L8$3I4Q4x3V1j5`.

Apktool工具下载链接:30fK9s2c8@1M7s2y4Q4x3@1q4Q4x3V1k6Q4x3V1k6U0L8$3c8W2i4K6u0W2k6$3!0G2k6$3I4W2i4K6u0W2j5$3!0E0i4K6u0r3M7q4)9J5c8X3q4F1k6s2u0G2K9h3c8Q4x3X3c8S2M7r3E0@1L8$3!0D9i4K6u0r3

相关的工具有:

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

smali 工具  6c0K9s2c8@1M7s2y4Q4x3@1q4Q4x3V1k6Q4x3V1k6U0L8$3c8W2i4K6u0W2k6$3!0G2k6$3I4W2i4K6u0W2j5$3!0E0i4K6u0r3M7q4)9J5c8Y4y4E0j5h3I4A6i4K6u0r3k6r3!0%4L8X3I4G2j5h3c8K6i4K6u0r3L8r3W2K6N6l9`.`.

dexopt-wrapper 源码 c1bK9s2c8@1M7s2y4Q4x3@1q4Q4x3V1k6Q4x3V1k6S2L8X3c8J5L8$3W2V1i4K6u0W2k6$3!0G2k6$3I4W2M7$3!0#2M7X3y4W2i4K6u0W2j5$3!0E0i4K6u0r3M7r3I4S2N6r3k6G2M7X3#2Q4x3V1k6T1N6h3W2D9k6q4)9J5c8W2)9J5b7W2)9J5c8X3c8G2L8Y4g2@1i4K6u0V1M7X3g2D9k6h3q4K6k6g2)9J5c8Y4c8G2L8$3I4K6i4K6u0r3k6r3g2^5M7s2u0W2L8%4m8@1i4K6u0r3k6r3g2^5L8%4m8@1i4K6u0V1N6%4u0S2M7s2m8W2M7W2)9J5c8R3`.`.

[培训]科锐逆向工程师培训第53期2025年7月8日开班!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 11
活跃值: (90)
能力值: ( 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
游客
登录 | 注册 方可回帖
返回