Commit Graph

71 Commits

Author SHA1 Message Date
Domenico Iezzi
78113555b5 updated device data for bacon 2018-03-23 13:47:47 +01:00
Domenico Iezzi
5ea4ab08c7 utils: parse apk permissions 2018-03-23 13:47:47 +01:00
Domenico Iezzi
425a3f8334
Merge pull request #46 from android-police/feature/add-description-recentchanges-fields
Exposed descriptionHtml, recentChangesHtml, versionString and saleEnds in utils.py
2018-03-13 22:00:44 +01:00
SeBsZ
d966b33d09 Exposed descriptionHtml, recentChangesHtml, versionString and saleEnds in utils.py
Added saleEnds to protobuf definition for app offers.
2018-03-13 15:40:12 +01:00
Domenico Iezzi
6f5565bdef
Some improvements to code
- Remove unstable userProfile API
- Changed names for some variables
- Disabled print calls. Loggin is now entirely up to the user.
- Implemented device config token, retrieved after the `uploadDevice`
procedure
- Updated headers from play-store-api project
- Fixed initialization for obb_download_test.py
2018-02-03 14:30:21 +01:00
Domenico Iezzi
d984a92dc7
Added log function
This function is needed by the purchase API to insert app into user's
library. Without this, new apps won't be downloaded
2018-02-01 11:53:16 +01:00
Domenico Iezzi
7f0fad78ef
Added functions to change locale
Locale and Timezone can be changed even during a session, and results
will change accordingly
2018-01-27 19:42:36 +01:00
Domenico Iezzi
2e4166f4e5
locale and timezone should be mandatory arguments 2018-01-27 19:15:45 +01:00
Domenico Iezzi
0a13755ff9
_delivery_data returns more information 2018-01-27 18:39:40 +01:00
Domenico Iezzi
e05d126f6b
Updated device info for shamu, sailfish, op3, op3t 2018-01-26 21:05:31 +01:00
Domenico Iezzi
3d0d399434
Updated device info for mako, kenzo, fp2 2018-01-26 20:58:49 +01:00
Domenico Iezzi
a07640b90e
Updated parameters with more up-to-date values 2018-01-26 20:15:54 +01:00
Domenico Iezzi
c4ba7f80b3
Added auth headers
c21ac5eaf5
2018-01-26 19:46:23 +01:00
Domenico Iezzi
23937e6cb8
Improved file delivery + minor changes
* Updated user agent string with data taken from play-store-api
* *download* and *delivery* functions will now return a python generator
rather than raw bytes, to prevent app loading entire files in memory.
This generator can be iterated to get chunk of bytes to write, as
discussed in issue #35.
* as a consequence of the previous point, there is no more progress bar
feature for downloading. It should be implemented by developers using
the API.
2018-01-26 18:24:19 +01:00
Domenico Iezzi
e1c73c8af0
Updated device info for bullhead and hammerhead 2018-01-25 12:11:54 +01:00
Domenico Iezzi
24a3e1a09b
Changed Locale and TimeZone initialization
Before, if locale wasn't specified as a parameter, it was picked from
the system running gpapi. Similar thing happened for timezone, but its
value was hardcoded in config.py.
To avoid problems related to missing or unavailable apps, this commit
enforces users to provide a locale and a timezone value. Without them,
gpapi can't be initialized.
2018-01-25 11:36:25 +01:00
Domenico Iezzi
d7a322dd82
Updated device info for angler and bacon 2018-01-25 11:20:54 +01:00
Domenico Iezzi
f7d2077d78
Added proxy config to userProfile request 2017-12-09 11:50:20 +01:00
Domenico Iezzi
a4dbf80a73
Updated pbuf definitions with protobuf 3.5.0 2017-12-09 11:37:38 +01:00
Domenico Iezzi
1e567277f5 Initial userProfile implementation 2017-12-09 11:36:56 +01:00
Domenico Iezzi
8dc2eb58c7
Improvements to helper functions 2017-12-09 10:58:00 +01:00
Domenico Iezzi
55499a015e
Helper functions for response parsing 2017-12-09 10:06:34 +01:00
Domenico Iezzi
6a6c0b01d0
Init proxies_config with given value in __init__ 2017-12-09 09:59:42 +01:00
Domenico Iezzi
2f24058086
Fixed commit d422074 re-formatting issue 2017-12-09 09:55:11 +01:00
Domenico Iezzi
b99ceb8410 Revert "Added proxy config for requests"
This reverts commit d422074ea8.
2017-12-09 09:41:07 +01:00
Artem Smirnov
d422074ea8 Added proxy config for requests 2017-12-07 05:02:59 +03:00
Domenico Iezzi
0fc9cb9fef
Removed debug feature 2017-11-15 15:48:55 +01:00
Domenico Iezzi
12109621a6
Tightened locale checks
Consider the case when locale is manually initalized with a non-string
value, and the case when python's getdefaultlocale() returns None
2017-11-14 11:22:19 +01:00
Domenico Iezzi
c61819d00b
Fix #22
Now gpapi checks if the locale retrieved from system or provided by the
user is valid. In case it's invalid, default to en_US.
2017-11-13 11:44:15 +01:00
Domenico Iezzi
ac2d07a8c9
Some code optimizations
Changed nested for loops with list comprehensions and maps. Also some
small fixes to indentation
2017-11-11 21:59:14 +01:00
Domenico Iezzi
6a9f29c6ce
Device info setup moved inside __init__
Since most of the device data is used only for the checkin procedure,
which is run only after the first login with email and passwd, it
is useless to have functions in GooglePlayAPI to modify them at runtime.

Now if the user wants to specify custom data, this data should be
provided as arguments to the constructor.
2017-11-10 22:25:33 +01:00
Domenico Iezzi
e6c69a5552
Updated default values for bacon 2017-11-10 22:12:34 +01:00
Domenico Iezzi
693ae8348f
Take latest apk if not version specified
If no *versionCode* parameter is specified to *download* or *delivery*
methods, fetch the latest one with a simple `self.details(pkgName)`
2017-11-09 12:25:39 +01:00
Domenico Iezzi
639c7f9e98
Python code linting and cleanup 2017-11-07 14:02:23 +01:00
Domenico Iezzi
512dc4000f
Removed debug string 2017-11-05 15:56:53 +01:00
Domenico Iezzi
6a3926fcd6
search: fixed wrong doc check 2017-11-05 15:43:23 +01:00
Domenico Iezzi
11128cde27
search: manage case when no result is found 2017-11-05 12:58:38 +01:00
Domenico Iezzi
df2fa823fd
Fix #18
As described in play-store-api code [1] recenlty google introduced a Time
To Live to each auth token, which caused them to expire in a matter of
seconds. Moreover, in order to retrieve a long-ttl token, a second auth
request now is needed, sending the Master Token returned from the first
request. This 'second round' request will return the actual authSubToken.

Another addition is that the code now return response's text for some
generic errors, in order to help debugging those problems.
2017-11-03 11:35:50 +01:00
Domenico Iezzi
25bfb4aaec
bulkDetails: handle case when app doesn't exist
Now the function returns None if an app doesnt't exists. This does not
apply for details() function, which instead return a RequestError if the
app doesn't exist.
2017-11-02 17:34:49 +01:00
Domenico Iezzi
866c633b1c
Integrity check before returning lists
In order to catch invalid tokens, an additional integrity check is done
before returning lists in details() and bulkDetails() functions. If the
check doesn't pass, raise a LoginError.
2017-11-01 11:23:24 +01:00
Domenico Iezzi
e1acc14424
Dinamically change locale and timezone
During DeviceBuilder initialization, retrieve locale from system using
python `locale` module, and set timezone to `Europe/Berlin`. Added some
helpers to get and set those values at runtime.
2017-10-30 17:30:10 +01:00
Domenico Iezzi
0a7cca7be7
Throw right kind of error when token expired 2017-10-22 17:25:58 +02:00
Domenico Iezzi
5034244620 Build request params with current device data
Login and Auth parameters are built using device selected in
deviceBuilder object. Also got rid of an unused parameter client_sig.
2017-10-19 17:51:03 +02:00
Domenico Iezzi
dd2d7b64d1 Added timeout to requests
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-19 13:14:27 +02:00
Domenico Iezzi
6857b15d45 Bool flag to control expansion files + cleanup
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-17 17:57:31 +02:00
Domenico Iezzi
b3f28cb0c4 Download optional expansion files (obb files)
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-17 11:41:39 +02:00
Domenico Iezzi
9d0d14450b Fix #16
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-13 19:12:06 +02:00
Domenico Iezzi
2ab7ce09c6 Added bacon (OnePlus 1) as default device
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-13 18:20:09 +02:00
Domenico Iezzi
ed2d658f61 Updated UserAgent string with latest gp version
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-13 18:17:32 +02:00
Domenico Iezzi
5d92b6d0d8 Disabled non-working devices
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-13 18:16:54 +02:00