如何从APK文件中查看AndroidManifest.xml?
是否可以查看Androidmanifest.xml
文件?
我刚刚将 apk
文件的扩展名更改为 zip
。此 zip
文件包含 Androidmanifest.xml
文件。但我无法查看 Androidmanifest.xml
的内容。它是完全加密的。
如何查看 Androidmanifest.xml
文件?
Is it possible to view Androidmanifest.xml
file?
I just changed the extension of the apk
file to zip
. This zip
file contains the Androidmanifest.xml
file. But I am unable view the contents of Androidmanifest.xml
. It is fully encrypted.
How can I view the Androidmanifest.xml
file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(18)
是的,您可以查看 Android APK 文件的 XML 文件。有一个工具可以实现此目的:
android-apktool
如何安装 apktool:查看 apktool 网站上的说明
现在复制
APK
文件也在该目录中,并在命令提示符中运行以下命令:这将在当前目录中创建一个目录“
HelloWorld
”。在其中您可以找到解密格式的AndroidManifest.xml
文件,您还可以在"HelloWorld/res/layout"
中找到其他XML
文件代码>目录。这里
HelloWorld.apk
是您的 Android APK 文件。请参阅下面的屏幕截图以了解更多信息:
Yes you can view XML files of an Android APK file. There is a tool for this:
android-apktool
How to install apktool: see instructions on the apktool website
Now copy the
APK
file also in that directory and run the following command in your command prompt:This will create a directory "
HelloWorld
" in your current directory. Inside it you can find theAndroidManifest.xml
file in decrypted format, and you can also find otherXML
files inside the"HelloWorld/res/layout"
directory.Here
HelloWorld.apk
is your Android APK file.See the below screen shot for more information:
Android Studio 现在可以显示这一点。转到
构建
>分析 APK...
并选择您的 apk。然后就可以看到AndroidManifest文件的内容了。Android Studio can now show this. Go to
Build
>Analyze APK...
and select your apk. Then you can see the content of the AndroidManifest file.Google 刚刚发布了一个跨平台开源工具,用于检查 APK(以及许多其他二进制 Android 格式):
安装版本 8.2 :
跑步:
Google has just released a cross-platform open source tool for inspecting APKs (among many other binary Android formats):
Install version 8.2:
Run:
aapt d xmltree com.package.apk AndroidManifest.xml
将从指定的 APK 中转储
AndroidManifest.xml
。它不是 XML 形式,但您仍然可以阅读它。aapt
(Android 资产打包工具)是 Android SDK 附带的内置工具。aapt d xmltree com.package.apk AndroidManifest.xml
will dump the
AndroidManifest.xml
from the specified APK. It's not in XML form, but you can still read it.aapt
(Android Asset Packaging Tool) is a built in tool that comes with the Android SDK.您可以使用
apkanalyzer
,命令 -与 Android SDK 捆绑在一起的 APK 分析器 的 line 版本。只需在 CLI 上执行以下命令:您只需将
/path/to/android-sdk
替换为您的 Android SDK 版本的正确路径,并将/path/to/ app.apk
替换为您的 APK 文件的路径。You can use
apkanalyzer
, the command-line version of the APK Analyzer bundled with the Android SDK. Just execute the following command on the CLI:You only have to replace
/path/to/android-sdk
with the correct path to your version of the Android SDK, and/path/to/app.apk
with the path to your APK file.2024-07-02 更新
在这几年里,我发现我需要获取整个 XML 才能使用 XML 工具对其进行查询。这是一个(相当)万无一失的 bash/zsh 函数,它只会转储 XML 格式的文件:
您可以将其粘贴到 bash 中,然后像这样运行它:
apkmanifest /path/to/your/android.apk
它:
您需要
zip
、unzip
、apktool
在您的路径上。原始答案
在此主题中,Dianne Hackborn 告诉我们可以使用 aapt 从 AndroidManifest 中获取信息。
我启动了这个快速的 unix 命令来获取版本信息:
2024-07-02 Update
In the intervening years, I found I need to get the entire XML to query it using XML tools. Here's a (reasonably) foolproof bash/zsh function that will just dump the file XML formatted:
You can just paste it into bash then run it like this:
apkmanifest /path/to/your/android.apk
It:
You need
zip
,unzip
,apktool
on your path.Original Answer
In this thread, Dianne Hackborn tells us we can get info out of the AndroidManifest using aapt.
I whipped up this quick unix command to grab the version info:
您可以使用以下命令:保存到文件
AndroidManifest.txt
You can use this command: save to file
AndroidManifest.txt
Android SDK 构建工具中包含的 Aapt2 可以做到这一点 - 无需第三方工具。
从 build-tools v29 开始,您必须添加命令
xmltree
:Aapt2, included in the Android SDK build tools can do this - no third party tools needed.
Starting with build-tools v29 you have to add the command
xmltree
:使用 axmldec 解码
AndroidManifest.xml
文件:或者
To decode the
AndroidManifest.xml
file using axmldec:or
有一个在线工具可以让你上传 APK,它会反编译它,最后让你下载一个包含所有源代码、清单 XML 文件等反编译的 zip 文件,所有这些都无需在你的计算机上安装任何程序:
http://www.javadecompilers.com/apk
另外,如果您只想检查一些参数,您可以,通过他们的用户界面
There is an online tool that lets you upload an APK It decompiles it and finally lets you to download a zip with all sources, manifest XML file and so on decompiled, all of that without having to install any program on your computer:
http://www.javadecompilers.com/apk
Also if you wish just to check on some params you can, by their UI
AXMLParser 和 APKParser.jar 也可以完成这项工作,您可以查看链接。 AXMLParser
The AXMLParser and APKParser.jar can also do the job, you can see the link. AXMLParser
所有这些答案似乎都有点过度设计!
只需获取此 Chrome 扩展程序:https://chrome.google.com/网上商店/详细信息/apk-downloader/fgljidimohbcmjdabiecfeikkmpbjegm
使用上述扩展名从 Playstore 下载所需的
.apk
文件。将
.apk
上传到此在线工具以获取manifest.xml
:All these answers seem a bit over-engineered!
Just grab this chrome extension: https://chrome.google.com/webstore/detail/apk-downloader/fgljidimohbcmjdabiecfeikkmpbjegm
Download the
.apk
file you want from the playstore using the above extension.Upload the
.apk
to this online tool to grab themanifest.xml
: https://www.sisik.eu/apk-tool另一种选择是使用 Jadx: https://github.com/skylot/jadx
只需打开您的 APK并在树视图中选择“AndroidManifest.xml”。
这样就可以读取了。
Another option is to use Jadx: https://github.com/skylot/jadx
Just open your APK and in treeview select "AndroidManifest.xml".
It will be readable just like that.
您还可以使用我的应用 App Detective查看您设备上安装的任何应用程序的清单文件。
You can also use my app, App Detective to view the manifest file of any app you have installed on your device.
另一个有用的(基于 Python 的)工具是 Androguard,使用其
axml
子命令:一次性提取并解码应用程序清单。与 apktool 不同,它不会解压任何其他内容。
Another useful (Python-based) tool for this is Androguard, using its
axml
sub-command:This extracts and decodes the app manifest in one go. Unlike apktool this doesn't unpack anything else.
这是一个旧线程,但我想我会提到,你的手机有根,你可以使用根浏览器应用程序直接在手机上查看它。您甚至不必提取它即可查看。
This is an old thread, but I thought I would mention, of your phone has root, you can view it directly on your phone using the root explorer app. You don't even have to extract it to see.
只需将 apk 上传到 https://www.sisik.eu/apk-tool 即可可以查看AndroidManifest.xml
Just upload the apk at https://www.sisik.eu/apk-tool and you can view the AndroidManifest.xml
该文件需要反编译(或者 deodex 不确定是哪一个)。但这是另一种方法:
The file needs to be decompiled (or deodex'd not sure which one). But here's another way to do it: