aapt是android自动打包工具之一。
环境配置:aapt一般在android sdk的build-tools中对应文件夹里面,将其路径添加到环境变量中,即可在命令行中直接使用aapt命令;
aapt参数详解aapt 命令后可直接查看参数详解
aapt l[ist] [-v] [-a] file.{zip,jar,apk}aapt l xxx.apk :查看apk目录
aapt l -a xxx.apk:详细列出apk内容;
若内容较多,可保存到本地文件中,如 aapt l -a xxx.apk > xxx.txt
aapt l -v xxx.apk : 以table的形式输出目录
table的表目有:Length、Method、Size、Ratio、Date、Time、CRC-32、Name。其中Method表示压缩形式,有:Deflate及Stored两种,即该Zip目录采用的算法是压缩模式 or 存储模式。可以看出resources.arsc、*.png采用压缩模式,而其它采用压缩模式。Ratio表示压缩率。CRC-32未明其意,Sodino盼指教。aapt dump 命令
aapt d[ump] [—values] WHAT file.{apk} [asset[asset …]]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
Demo:
查找apk包中所有Activity的名称
通过查找AndroidManifest.xml文件内容来定位:
aapt dump xmltree facebook_googleplay_V1.0.0.apk AndroidManifest.xml | grep activity始发于2017.6.13