Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 318
Mithun Sreedharan Avatar asked Sep 26 '11 08:09

Mithun Sreedharan


2 Answers

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
like image 122
DonGru Avatar answered Oct 10 '22 07:10

DonGru


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.

like image 42
jrharshath Avatar answered Oct 10 '22 07:10

jrharshath