Initial password encryption implementation

Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
This commit is contained in:
Domenico Iezzi 2017-09-08 16:26:37 +02:00
parent dae29b68c1
commit 7cb82a47bd
2 changed files with 11 additions and 1 deletions

View File

@ -2,7 +2,8 @@
SEPARATOR = ";" SEPARATOR = ";"
LANG = "en_US" LANG = "en_US"
ANDROID_ID = "8AAF7D11483A175" ANDROID_ID = "320d104c4dc6eaa4"
GOOGLE_PUBKEY = "AAAAgMom/1a/v0lblO2Ubrt60J2gcuXSljGFQXgcyZWveWLEwo6prwgi3iJIZdodyhKZQrNWp5nKJ3srRXcUW+F1BD3baEVGcmEgqaLZUNBjm057pKRI16kB0YppeGx5qIQ5QjKzsR8ETQbKLNWgRY0QRNVz34kMJR3P/LgHax/6rmf5AAAAAwEAAQ=="
GOOGLE_LOGIN = "" GOOGLE_LOGIN = ""
GOOGLE_PASSWORD = "" GOOGLE_PASSWORD = ""
AUTH_TOKEN = "" AUTH_TOKEN = ""

View File

@ -60,6 +60,15 @@ class GooglePlayAPI(object):
self.lang = lang self.lang = lang
self.debug = debug self.debug = debug
def encrypt_password(self, login, passwd):
def readInt(byteArray, start):
return struct.unpack(">I", byteArray[0:4])[0]
binaryKey = base64.b64encode(bytes(config.GOOGLE_PUBKEY, 'utf-8'))
i = readInt(binaryKey, 0)
def toDict(self, protoObj): def toDict(self, protoObj):
"""Converts the (protobuf) result from an API call into a dict, for """Converts the (protobuf) result from an API call into a dict, for
easier introspection.""" easier introspection."""