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.
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.
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.
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.
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.
The old caching code could cause a query to be cached for ever,
returning always the same set of result for a specific query. This is
not a good behaviour, since search results change continuously. In the
future, this behaviour could be reintroduced with a better logic (for
example, check if the query was in cache longer than some hours or days)
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
Previously, the ac2dm was meant to be saved in the application state, and later used for
subsequent logins, along with the gsfId. This is not correct, because the app needs it
only for the first login, and then remains unused in the application state.
The correct behaviour is to save the gsfId and the authSubToken, and provide only these two
values for subsequent logins
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>