aapt即 Android Asset Packaging Tool。该工具在SDK/tools目录下,如果你没有设置环境变量,那需要进入该目录下才能运行aapt命令,如果设置了环境变量则可以在任何目录下运行aapt命令了。
1、列出压缩文件目录
aapt l[ist] [-v] [-a] file.{zip,jar,apk}
参数:
-v:会以table的形式输出目录,table的表目有:Length、Method、Size、Ratio、Date、Time、CRC-32、Name。其中Method表示压缩形式,有Deflate和Stored两种,即该Zip目录采用的算法是压缩模式还是存储模式;Ratio表示压缩率。
-a:会详细输出所有目录的内容。
2、查看APK的相关信息
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.