从android apk文件解析versionCode [英] Parse versionCode from android apk files

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

问题描述

我知道 .apk 文件是 .zip 文件,但 AndroidManifest.xml 看起来是二进制文件,当然 grep 或 hex 编辑器没有成功提取 versionCode.

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.

有谁知道如何解析或提取它?我发现自己在一个打开了 apks AndroidManifest.xml 文件的 Python 脚本中.

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

这篇关于从android apk文件解析versionCode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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