从安卓APK文件解析版本code版本、文件、APK、code

2023-09-05 01:58:32 作者:冷笑

我知道的apk文件是.zip文件,但AndroidManifest.xml中看起来二进制,当然用grep或十六进制编辑器都没有成功提取版本code。

I know .apk files are .zip files, but AndroidManifest.xml looks binary and certainly grep or hex editors haven't been successful extracting the versionCode.

有谁知道如何解析或提取呢?我发现自己与的apk的Python脚本AndroidManifest.xml文件打开。

Does anybody know how to parse or extract it? I find myself in a Python script with the apks AndroidManifest.xml file open.

推荐答案

假设你已经在Android SDK安装,可以使用AAPT找到这个值。例如,在Linux上:

Assuming you have the Android SDK installed, you can use aapt to find this value. For example, on Linux:

aapt dump badging MyAwesomeApplication.apk |grep version