2020-08-20

aapt dump命令

aapt (Android Asset Packaging Tool),Android资源打包工具,也可以用来查看apk中的一些字段信息
主要使用aapt dump命令,这里记录一下
aapt d[ump] [–values] [–include-meta-data] WHAT file.{apk} [asset [asset …]]

commanduse
stringsPrint the contents of the resource table string pool in the APK.
badgingPrint the label and icon for the app declared in APK.
permissionsPrint the permissions from the APK.
resourcesPrint the resource table from the APK.
configurationsPrint the configurations in the APK.
xmltreePrint the compiled xmls in the given assets.
xmlstringsPrint the strings of the given compiled xml assets.

1.查看所有string字段
aapt dump strings xxx.apk

2.查看label,packageName,versionCode,launchActivity等应用信息
aapt dump badging xxx.apk

3.查看应用注册的权限
aapt dump permissions xxx.apk

4.查看res资源信息,比如某些config属性值
aapt dump resources xxx.apk >res.txt
一边资源较多,保存为文件方便查看,比如查看系统某些属性值
aapt dump strings framework-res.apk >res.txt
在res.txt中寻找config_screenBrightnessSettingMaximum值,为屏幕背光最大值
resource 0x010e00aa android:integer/config_screenBrightnessSettingMaximum: t=0x10 d=0x000007ff (s=0x0008 r=0x00)
其中d=0x000007ff中7ff为16进制,可以使用工具转换成10进制,linux上可以使用命令
printf %d 0x7ff
实际值为2047

5.参看配置信息
aapt dump configurations xxx.apk

6.以xml的方式输出给定的assets文件
aapt dump xmltree framework-res.apk res/xml/power_profile.xml

7.以string输出给定的assets文件
aapt dump xmlstrings framework-res.apk res/xml/power_profile.xml

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值