I am trying to create a PHP script to get the app version from Android APK file.
Extracting XML file from the APK (zip) file and then parsing XML is one way, but I guess it should be simpler. Something like PHP Manual, example #3.
Any ideas how to create the script?
I am trying to create a PHP script to get the app version from
Share
If you have the Android SDK installed on the server, you can use PHP’s exec (or similar) to execute the
aapttool (in$ANDROID_HOME/platforms/android-X/tools).And the output should include:
If you can’t install the Android SDK, for whatever reason, then you will need to parse Android’s binary XML format. The
AndroidManifest.xmlfile inside the APK zip structure is not plain text.You would need to port a utility like AXMLParser from Java to PHP.