Skip to content

Commit

Permalink
Merge pull request #4 from marty0678:google-login-issues
Browse files Browse the repository at this point in the history
Google-login-issues
  • Loading branch information
marty0678 authored May 28, 2022
2 parents 91a6f31 + 2339c89 commit a64cb59
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
8 changes: 6 additions & 2 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# Json login file must be placed in the root be structured like:
# {
# "log_in_name": {
# "username": "username",
# "password": "password",
# "deviceName": device_name:str,
# "gsfId" : id_number:int,
# "authSubToken" : token:str
Expand Down Expand Up @@ -34,8 +36,10 @@ def resource_path(relative_path):

print("Logging in...")
server.login(
gsfId=current_log_in['gsfId'],
authSubToken=current_log_in['authSubToken']
email=current_log_in['username'],
password=current_log_in['password'],
# gsfId=current_log_in['gsfId'],
# authSubToken=current_log_in['authSubToken']
)
print("Complete!")

Expand Down
5 changes: 3 additions & 2 deletions gpapi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 13 additions & 12 deletions gpapi/googleplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def init_poolmanager(self, *args, **kwargs):
context = SSLContext()
context.set_ciphers(ssl_.DEFAULT_CIPHERS)
context.verify_mode = ssl.CERT_REQUIRED
context.options &= ~ssl_.OP_NO_TICKET
context.options &= ~0x4000
self.poolmanager = PoolManager(*args, ssl_context=context, **kwargs)


Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a64cb59

Please sign in to comment.