Android快速分析apk工具aapt的使用教程
2016-05-21 10:48
357 查看
aapt简介
aapt即Android Asset Packaging Tool,我们可以在SDK的platform-tools目录下找到该工具。aapt可以查看、 创建、 更新ZIP格式的文档附件(zip, jar, apk)。 也可将资源文件编译成二进制文件,尽管你可能没有直接使用过aapt工具,但是build scripts和IDE插件会使用这个工具打包apk文件构成一个Android 应用程序。
主要用法
下面的这个参数列表基本向我们展示了如何使用aapt以及aapt的基本功能了。
复制代码代码如下:
aapt l[ist]:列出资源压缩包里的内容。
aapt d[ump]:查看APK包内指定的内容。
aapt p[ackage]:打包生成资源压缩包。
aapt r[emove]:从压缩包中删除指定文件。
aapt a[dd]:向压缩包中添加指定文件。
aapt v[ersion]:打印aapt的版本。
使用aapt
这里我就用一个应用来做测试sample,应用为:应用汇应用市场。
列举出apk中的所有文件
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt l yingyonghui.apk
当然这个apk的内容太多,一张纸显示不了所有的内容,你可以将其重定向到一个专门的文件中去,这样查看也方便。
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt l yingyonghui.apk > yingyonghui.txt
查看apk的基本信息
aapt最实用的功能,通过d(ump)参数可以查看该apk的基本信息以及权限等,但该参数还有一个value,可以选用的value值如下:
d参数的语法如下:
复制代码代码如下:
aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]
values:
badging Print the label and icon for the app declared in APK.
permissions Print the permissions from the APK.
resources Print the resource table from the APK.
configurations Print the configurations in the APK.
xmltree Print the compiled xmls in the given assets.
xmlstrings Print the strings of the given compiled xml assets.
查看基本信息
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt d badging yingyonghui.apk
查看应用权限
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt d permissions yingyonghui.apk
结语
怎么样,aapt这个小工具本领还真不小吧,当我们在判断一个apk是否有恶意行为时,我们第一步可以考虑使用aapt这个tool哦,我们可以分析这个apk的权限列表,一旦有部分权限过大,比如发送短信、读取联系人信息等权限时,就可以进一步分析这个apk了。
aapt即Android Asset Packaging Tool,我们可以在SDK的platform-tools目录下找到该工具。aapt可以查看、 创建、 更新ZIP格式的文档附件(zip, jar, apk)。 也可将资源文件编译成二进制文件,尽管你可能没有直接使用过aapt工具,但是build scripts和IDE插件会使用这个工具打包apk文件构成一个Android 应用程序。
主要用法
下面的这个参数列表基本向我们展示了如何使用aapt以及aapt的基本功能了。
复制代码代码如下:
aapt l[ist]:列出资源压缩包里的内容。
aapt d[ump]:查看APK包内指定的内容。
aapt p[ackage]:打包生成资源压缩包。
aapt r[emove]:从压缩包中删除指定文件。
aapt a[dd]:向压缩包中添加指定文件。
aapt v[ersion]:打印aapt的版本。
使用aapt
这里我就用一个应用来做测试sample,应用为:应用汇应用市场。
列举出apk中的所有文件
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt l yingyonghui.apk
当然这个apk的内容太多,一张纸显示不了所有的内容,你可以将其重定向到一个专门的文件中去,这样查看也方便。
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt l yingyonghui.apk > yingyonghui.txt
查看apk的基本信息
aapt最实用的功能,通过d(ump)参数可以查看该apk的基本信息以及权限等,但该参数还有一个value,可以选用的value值如下:
d参数的语法如下:
复制代码代码如下:
aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]
values:
badging Print the label and icon for the app declared in APK.
permissions Print the permissions from the APK.
resources Print the resource table from the APK.
configurations Print the configurations in the APK.
xmltree Print the compiled xmls in the given assets.
xmlstrings Print the strings of the given compiled xml assets.
查看基本信息
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt d badging yingyonghui.apk
查看应用权限
复制代码代码如下:
walfred@ubuntu:~/lab$ aapt d permissions yingyonghui.apk
结语
怎么样,aapt这个小工具本领还真不小吧,当我们在判断一个apk是否有恶意行为时,我们第一步可以考虑使用aapt这个tool哦,我们可以分析这个apk的权限列表,一旦有部分权限过大,比如发送短信、读取联系人信息等权限时,就可以进一步分析这个apk了。
相关文章推荐
- Android圆形头像
- Android 二维码扫描工具 QRCodeReaderView
- 使用asm.jar将Android手机屏幕投影到电脑
- Android记录20-获取缓存大小和清除缓存功能
- Android官方开发文档Training系列课程中文版:OpenGL绘图之图形定义
- Android实现边缘凹凸的View
- Android 分享一个SharedPreferences的工具类,方便保存数据
- Android成长之路之layout加载过程
- Android Studio中DDMS下无法打开data目录
- 百度地图API的Android开发之申请秘钥
- android真机调试出现offline解决方法
- android Service的启动方式和重复绑定
- Android多媒体(二)
- Android利用shape画虚线
- Android Kernel 源码在线阅读与下载
- android studio使用github
- Android编程规范
- Android 开发艺术探究V第三章之view的事件分发机制
- Android多媒体(一)
- Android中intent传递对象和Bundle的用法