当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Get Application information from an APK using PHP script

问题描述:

How can I get the versionCode, versionName, application icon and application label from an APK with PHP

网友答案:

I'm not that familiar with php so I can't provide any code, but the idea is:

  • unzip the APK file (since it's "nomal" zip format)
  • open the AndroidManifest.xml and
  • parse the <manifest> tag for android:versionCode and android:versionName
网友答案:

If I'm not wrong, APKs are simply zip files. And android packages will have some sort of XML file that will mention the version information.

In PHP, you can unzip as well as read XMLs.

网友答案:

As you might know an APK is a simple zip formated archive with it's metadata in XML format.

Try and unzip some apks and see which files have the information you need.

This can all be easily done in PHP.

网友答案:

Well,

It is correct that the apk is in fact a zip-file and that is easy to unzip. However the manifest xml is not in standard xml format. It is some kind of propitiatory Android format.

You can use apktool to unpack the xml, but it is in Java and not very fun if you don't have Java on the server.

There is also a Python Library available, AXMLParsePY

Then we have AXmlPrinter2, also written in Java

I am myself looking for a PHP library and have given up. Now looking for something lightweight I can convert from some other language.

分享给朋友:
您可能感兴趣的文章:
随机阅读: