1
In a given case, a certain company does not want its application to be posted on Google Play. However the idea would be to create a version control within the company’s own system to make the upload of .apk
and save some basic information to a database table. This information would be an id, versionCode
, versionName
, URL of the address saved from .apk
, and date of dispatch.
I would like to extract only the versionCode
and the versionName
of apk
at the moment the upload is made, so that it is not necessary to type this manually at the time of the version registration.
How can I rescue the versionCode
and the versionName
from an APK?
Has in the
AndroidManifest.xml
, that crazy xml compiled from Android. I’ll see more details later– Jefferson Quesado
@Jeffersonquesado I think you did not understand the question very well. Hue
– viana
so, get this apk info, check? unzip on apk, read the compiled binary manifest. Wouldn’t that be it?
– Jefferson Quesado
@Jeffersontaken that way anyway. The system receives an apk, interprets, rescues the version code and the version name (in Manifest - as you said) and returns the values.
– viana
I believe that only with some command line tools or with Java that a person suggested is it possible to decode Manifest. This answer may help: https://stackoverflow.com/questions/2097813/how-to-parse-the-androidmanifest-xml-file-inside--apk-package. I have seen apktool generate yaml with some interesting links.
– Wakim
@acklay then i understood xD I’ve needed to do this a few times, after I’m on a computer I see here if I can rediscover my steps.
– Jefferson Quesado
@Wakim wanted to try using javascript or php, but not by command line. I found something in php, but returns only versionCode. I couldn’t adapt it to regale the versionName. Check it out: https://stackoverflow.com/a/16449148/2570426
– viana
I think using this same code from to extrapolate the versionName, because it’s right after versionCode, then just add some offset, based on versionCode also to get to the versionName. But then it’s the test basis to get the right amount.
– Wakim