Updated parameters with more up-to-date values

This commit is contained in:
Domenico Iezzi 2018-01-26 20:15:54 +01:00
parent c4ba7f80b3
commit a07640b90e
No known key found for this signature in database
GPG Key ID: 7AC94D5DDA2FB7EE
2 changed files with 16 additions and 18 deletions

View File

@ -102,30 +102,19 @@ class DeviceBuilder(object):
headers['device'] = "{0:x}".format(gsfid)
return headers
def getAuthParams(self, email, passwd):
return {"Email": email,
"EncryptedPasswd": passwd,
"accountType": ACCOUNT,
"has_permission": "1",
"source": "android",
"device_country": self.locale[0:2],
"service": "androidmarket",
"app": "com.android.vending",
"lang": self.locale,
"sdk_version": self.device['build.version.sdk_int']}
def getLoginParams(self, email, encrypted_passwd):
return {"Email": email,
"EncryptedPasswd": encrypted_passwd,
"service": "ac2dm",
"add_account": "1",
"accountType": ACCOUNT,
"google_play_services_version": self.device.get('gsf.version'),
"has_permission": "1",
"app": "com.google.android.gsf",
"source": "android",
"device_country": self.locale[0:2],
"lang": self.locale,
"sdk_version": self.device.get('build.version.sdk_int')}
"sdk_version": self.device.get('build.version.sdk_int'),
"client_sig": "38918a453d07199354f8b19af05ec6562ced5788",
"callerSig": "38918a453d07199354f8b19af05ec6562ced5788"}
def getAndroidCheckinRequest(self):
request = googleplay_pb2.AndroidCheckinRequest()

View File

@ -158,6 +158,11 @@ class GooglePlayAPI(object):
encryptedPass = self.encrypt_password(email, password).decode('utf-8')
# AC2DM token
params = self.deviceBuilder.getLoginParams(email, encryptedPass)
params['service'] = 'ac2dm'
params['add_account'] = '1'
params['callerPkg'] = 'com.google.android.gms'
headers = self.deviceBuilder.getAuthHeaders(self.gsfId)
headers['app'] = 'com.google.android.gsm'
response = requests.post(self.AUTHURL, data=params, verify=ssl_verify,
proxies=self.proxies_config)
data = response.text.split()
@ -195,8 +200,11 @@ class GooglePlayAPI(object):
raise LoginError('Either (email,pass) or (gsfId, authSubToken) is needed')
def getAuthSubToken(self, email, passwd):
requestParams = self.deviceBuilder.getAuthParams(email, passwd)
requestParams = self.deviceBuilder.getLoginParams(email, passwd)
requestParams['service'] = 'androidmarket'
requestParams['app'] = 'com.android.vending'
headers = self.deviceBuilder.getAuthHeaders(self.gsfId)
headers['app'] = 'com.android.vending'
response = requests.post(self.AUTHURL,
data=requestParams,
verify=ssl_verify,
@ -221,16 +229,17 @@ class GooglePlayAPI(object):
raise LoginError("auth token not found.")
def getSecondRoundToken(self, first_token, params):
if self.gsfId is not None:
params['androidId'] = "{0:x}".format(self.gsfId)
params['Token'] = first_token
params['service'] = 'androidmarket'
params['check_email'] = '1'
params['token_request_options'] = 'CAA4AQ=='
params['system_partition'] = '1'
params['_opt_is_called_from_account_manager'] = '1'
params['google_play_services_version'] = '11518448'
params.pop('Email')
params.pop('EncryptedPasswd')
headers = self.deviceBuilder.getAuthHeaders(self.gsfId)
headers['app'] = 'com.android.vending'
response = requests.post(self.AUTHURL,
data=params,
headers=headers,