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

本文介绍了如何使用Eclipse内置的aapt工具来查询APK的包名、launchable-activity、版本等信息。通过在命令行中执行特定的aapt命令,如`aapt dump badging`和`aapt dump permissions`,可以获取APK的详细元数据,这对于配置系统hotSeat的XML文件非常有用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

        今天客户给了给了几个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的其他命令还在学习中,会慢慢更新。有错误欢迎指正讨论。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值