googleplay-api icon indicating copy to clipboard operation
googleplay-api copied to clipboard

APK's version code problem

Open michaelhku2002 opened this issue 7 years ago • 5 comments

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!

michaelhku2002 avatar Dec 29 '17 10:12 michaelhku2002

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 avatar Dec 31 '17 14:12 matlink

@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?

michaelhku2002 avatar Jan 02 '18 02:01 michaelhku2002

I guess there is no way to get version codes without downloading apps.

matlink avatar Jan 10 '18 12:01 matlink

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,

SeBsZ avatar Mar 06 '18 10:03 SeBsZ

We should enhance the protobuf parsing in utils.py adding all the fields inside AppDetails object, as stated in #40

NoMore201 avatar Mar 08 '18 13:03 NoMore201