googleplay-api
googleplay-api copied to clipboard
APK's version code problem
Hi! I'm now facing another problem. When I download the APKs for security checking, I also need to get the information about them, including version code and date. However, what I got about version code is the number that can be larger than 10000, instead of the format as 1.X.XX.XXX. I've just checked the program, finding that the code is come from the line "versionCode": app.details.appDetails.versionCode in line 27 of utils.py. So I wish to know how I can convert the version code to be the one as shown in google play store page? Thanks!
From what I know, you have to analyze the apk to get the "human" version code. Check pyaxmlparser for it: https://github.com/appknox/pyaxmlparser I guess APK('path/to/apk.apk').version_name is the line you want.
@matlink Thanks for your comment. I viewed the code in pyaxmlparser, finding that if I have to get the version code, what it needs to do is to download the apk file. But I wish to know will it contradict the download function of gpapi?
I guess there is no way to get version codes without downloading apps.
It is possible to get the "human" version name through the API by adding a line to utils.py:
"versionString": app.details.appDetails.versionString,
The versionString is passed in the details API, along with the versionCode. Just add the above line below the versionCode line that is already there:
"versionCode": app.details.appDetails.versionCode,
We should enhance the protobuf parsing in utils.py adding all the fields inside AppDetails object, as stated in #40