From dbaa06f6e825be058d04130a6ba9bbaf2015f842 Mon Sep 17 00:00:00 2001 From: Marty <49799843+marty0678@users.noreply.github.com> Date: Sat, 28 May 2022 02:17:14 -0400 Subject: [PATCH] Implemented the changes in https://github.com/NoMore201/googleplay-api/pull/161 Still not working however, getting bad auth --- gpapi/config.py | 5 +++-- gpapi/googleplay.py | 23 ++++++++++++----------- requirements.txt | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/gpapi/config.py b/gpapi/config.py index 24d4df3..4b95db5 100644 --- a/gpapi/config.py +++ b/gpapi/config.py @@ -141,8 +141,9 @@ def getLoginParams(self, email, encrypted_passwd): "device_country": self.locale[0:2], "lang": self.locale, "client_sig": "38918a453d07199354f8b19af05ec6562ced5788", - "callerSig": "38918a453d07199354f8b19af05ec6562ced5788"} - + "callerSig": "38918a453d07199354f8b19af05ec6562ced5788", + "droidguard_results": "dummy123"} + def getAndroidCheckinRequest(self): request = googleplay_pb2.AndroidCheckinRequest() request.id = 0 diff --git a/gpapi/googleplay.py b/gpapi/googleplay.py index 2f8a442..26fe62a 100644 --- a/gpapi/googleplay.py +++ b/gpapi/googleplay.py @@ -244,10 +244,12 @@ def login(self, email=None, password=None, gsfId=None, authSubToken=None): 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 = self.session.post(AUTH_URL, data=params, verify=ssl_verify, - proxies=self.proxies_config) + with requests.Session() as s: + s.headers = {'User-Agent': 'GoogleAuth/1.4'} + response = s.post(AUTH_URL, + data=params, + verify=ssl_verify, + proxies=self.proxies_config) data = response.text.split() params = {} for d in data: @@ -286,13 +288,12 @@ def getAuthSubToken(self, 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 = self.session.post(AUTH_URL, - data=requestParams, - verify=ssl_verify, - headers=headers, - proxies=self.proxies_config) + with requests.Session() as s: + s.headers = {'User-Agent': 'GoogleAuth/1.4', 'device':"{0:x}".format(self.gsfId)} + response = s.post(AUTH_URL, + data=requestParams, + verify=ssl_verify, + proxies=self.proxies_config) data = response.text.split() params = {} for d in data: diff --git a/requirements.txt b/requirements.txt index 20d419f..f80b6b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ protobuf==3.13.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycparser==2.20 -pyinstaller==4.0 +pyinstaller==4.9 pyinstaller-hooks-contrib==2020.9 pytz==2020.1 pywin32-ctypes==0.2.0