如何解析 .apk 包中的 AndroidManifest.xml 文件 [英] How to parse the AndroidManifest.xml file inside an .apk package

查看:48
本文介绍了如何解析 .apk 包中的 AndroidManifest.xml 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此文件似乎是二进制 XML 格式.这种格式是什么以及如何以编程方式解析它(而不是使用 SDK 中的 aapt 转储工具)?

This file appears to be in a binary XML format. What is this format and how can it be parsed programmatically (as opposed to using the aapt dump tool in the SDK)?

文档中没有讨论这种二进制格式此处.

This binary format is not discussed in the documentation here.

注意:我想从 Android 环境之外访问此信息,最好从 Java 访问.

Note: I want to access this information from outside the Android environment, preferably from Java.

推荐答案

使用 android-apktool

有一个应用程序可以读取 apk 文件并将 XML 解码为几乎原始的形式.

Use android-apktool

There is an application that reads apk files and decodes XMLs to nearly original form.

用法:

apktool d Gmail.apk && cat Gmail/AndroidManifest.xml

查看 android-apktool 了解更多信息

这篇关于如何解析 .apk 包中的 AndroidManifest.xml 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆