aapt的使用
来源:互联网 发布:淘宝云客服多久结工资 编辑:程序博客网 时间:2024/05/27 01:31
aapt的使用
aapt:Android Asset Packaging Tool , 在SDK的tools/目录下. 该工具可以查看, 创建, 更新ZIP格式的文档附件(zip, jar, apk). 也可将资源文件编译成二进制文件.
同步软件中得到apk信息就是用的这么一个android已经提供好的工具。
- 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.
使用aapt dump badging *.apk可以查看这个apk文件的程序名、包名、所用的sdk,程序版本以及权限信息等等。如下:
aapt dump bagging EngineeringTest.apk 得到如下详细信息
- package: name='com.archermind.engineeringtest' versionCode='1' versionName='1.0'
- sdkVersion:'8'
- application-label:'EngineeringTest'
- application-icon-120:'res/drawable-ldpi/ic_launcher.png'
- application-icon-160:'res/drawable-mdpi/ic_launcher.png'
- application-icon-240:'res/drawable-hdpi/ic_launcher.png'
- application: label='EngineeringTest' icon='res/drawable-mdpi/ic_launcher.png'
- launchable-activity: name='com.archermind.engineeringtest.EngineeringTestActivity' label='EngineeringTest' icon=''
- uses-permission:'android.permission.INTERNET'
- uses-feature:'android.hardware.touchscreen'
- main
- other-activities
- other-receivers
- other-services
- supports-screens: 'small' 'normal' 'large'
- supports-any-density: 'true'
- locales: '--_--'
- densities: '120' '160' '240'
将上面的信息读入到字符串中,然后用正则表达式匹配一下。就可以把apk的信息放到同步软件中了。
另外同步软件中应该还会涉及到一些,手机固件的信息,比如说手机rom的版本等等,这些信息放在了android系统的system/build.prop文件里面。可以使用adb shell cat进行查看,如果要查看具体的每行的含义可以查看下面的网址:
http://www.cnblogs.com/wanqieddy/archive/2011/11/25/2263367.html
总结,aapt能获取下列信息:
aapt dump badging <file_path.apk>:查看apk包的packageName、versionCode、 applicationLabel、launcherActivity、permission等各种详细信息
aapt dump permissions <file_path.apk>:查看权限
aapt dump resources <file_path.apk>:查看资源列表
aapt dump configurations <file_path.apk>:查看apk配置信息
aapt dump xmltree <file_path.apk> res/*.xml:查看指定apk的指定xml文件 (以树形结构输出的xml信息)
aapt dump xmlstrings <file_path.apk> res/*.xml:查看指定apk的指定xml 文件(输出xml文件中所有的字符串信息)
- aapt的使用
- aapt命令的使用
- aapt的使用
- aapt的使用
- aapt命令的使用
- aapt命令的使用
- android aapt命令的使用
- aapt 快速分析apk工具aapt的使用
- aapt 使用
- aapt使用
- AAPT使用
- re-sign和aapt的使用规则
- [Android]aapt使用小结
- android aapt使用小结
- android aapt使用小结
- aapt 使用小结
- android aapt使用小结
- [Android]aapt使用小结
- jstl中fn表达式的应用
- AVPlayer 监听播放时长错误capturing 'self' strongly in this block is likely to lead to a retain cycle 的解决方法
- 虚拟地址与物理地址 -神贴
- BeanUtils.copyProperties(source, target)用法
- java面试题
- aapt的使用
- hdu1008简单电梯时间计算
- bootstrap 3 nav-tab 用法
- UML DESIGNER 教程 好不容易才找到!!!
- 硬件知识【0】:TTL电平和CMOS电平
- [笔记]ubuntu 13.04 配置YouCompleteMe
- A. Counting Sticks
- Poj 3687 Labeling Balls (拓扑排序)
- 解决 Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects