查看APK的包名,launchable-activity,版本等相关信息

来源:互联网 发布:mac ae插件怎么安装 编辑:程序博客网 时间:2024/05/29 13:43

        今天客户给了给了几个APK,要放在系统的hotSeat位置。这个定制是相对比较简单的,但是在配置hotSeat的xml文件时,需要配置packageName和className信息,通过apk查询这些信息困扰了我很久,这里说下我的方法。

       Eclipse本身自带aapt工具,可以用这个来查询。在sdk/platform-tools目录下面。


1 先cd到platform-tools目录


2 aapt dump badging [apk文件的目录]

比如我的apk为/home/blandon/work/KOOLYUN_SmartPosMobile_ky_mobile_unify_1.0.38_38_20151027C.apk

则命令为:

aapt dump badging /home/blandon/work/KOOLYUN_SmartPosMobile_ky_mobile_unify_1.0.38_38_20151027C.apk


即可得到各种信息。


aapt l <你的apk文件>,这个命令就是查看apk内容


下面详细说下 aapt dump 这个查询命令

基本格式为   aapt dump [] <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权限:

blandon@blandon-Lenovo-Product:~/adt-bundle-linux-x86_64-20130219/sdk/platform-tools$ aapt dump permissions /home/blandon/work/KOOLYUN_ActiveDevice4_ky_Mobile_unify_1.0.1_2_20151111B.apk -a




关于aapt的其他命令还在学习中,会慢慢更新。有错误欢迎指正讨论。




0 0
原创粉丝点击