Android aapt 在 Mac 上的使用
Android aapt 在 Mac 上的使用
最近需要用到android sdk的aapt来解析apk包,这里我分享一下我的使用过程,首先配置aapt的环境变量:
AAPT_HOME=/Users/admin/Library/Android/sdk/build-tools/29.0.3export AAPT_HOMEexport PATH=$PATH:$AAPT_HOME
把这几行加入到~/.zshrc中去,然后测试,重新打开一个terminal:
(base) ➜ ~ aaptAndroid Asset Packaging ToolUsage: aapt l[ist] [-v] [-a] file.{zip,jar,apk} List contents of Zip-compatible archive. aapt d[ump] [--values] [--include-meta-data] WHAT file.{apk} [asset [asset ...]] strings Print the contents of the resource table string pool in the APK. 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.
说明添加成功,然后进行操作,这里以拼多多的apk为例:
(base) ➜ android aapt dump badging 拼多多官方.apkpackage: name='com.xunmeng.pinduoduo' versionCode='51101' versionName='5.11.1' compileSdkVersion='29' compileSdkVersionCodename='10'sdkVersion:'15'targetSdkVersion:'27'uses-permission: name='android.permission.INTERNET'uses-permission: name='android.permission.ACCESS_WIFI_STATE'uses-permission: name='android.permission.ACCESS_NETWORK_STATE'uses-permission: name='android.permission.READ_PHONE_STATE'uses-permission: name='android.permission.READ_LOGS'uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'uses-permission: name='android.permission.CAMERA'uses-permission: name='android.permission.FLASHLIGHT'uses-permission: name='android.permission.READ_CONTACTS'uses-permission: name='android.permission.RECORD_AUDIO'uses-permission: name='android.permission.MODIFY_AUDIO_SETTINGS'uses-permission: name='android.permission.WAKE_LOCK'uses-permission: name='android.permission.GET_PACKAGE_SIZE'uses-permission: name='android.permission.REQUEST_INSTALL_PACKAGES'.....
参考文献
[1].Android aapt 在 Mac 和 Windows 上使用方法小结. 配置AAPT环境变量.
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~