Skip to content

Commit

Permalink
Merge pull request snaptec#2754 from Flock82/soc_kia
Browse files Browse the repository at this point in the history
[Kia/Hyundai] - Hotfix App changes
  • Loading branch information
benderl authored Jul 4, 2023
2 parents 22e0faa + 77078fc commit 2c27544
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions modules/soc_kia/kiaauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def refreshAccessToken(refreshToken):
'Host': parameters.getParameter('host'),
'Connection': 'close',
'Accept-Encoding': 'gzip, deflate',
'User-Agent': 'okhttp/3.10.0'}
'User-Agent': 'okhttp/3.12.0'}

try:
response = kiahttp.postHTTP(url=url, headers=headers, data=data, timeout=parameters.getParameter('reqTimeout'))
Expand All @@ -104,7 +104,7 @@ def getDeviceId():

url = parameters.getParameter('baseUrl') + '/api/v1/spa/notifications/register'

data = {"pushRegId": parameters.getParameter('GCMSenderId'), "pushType": "GCM", "uuid": str(uuid.uuid1())}
data = {"pushRegId": parameters.getParameter('GCMSenderId'), "pushType": parameters.getParameter('PushType'), "uuid": str(uuid.uuid4())}
headers = {
'ccsp-service-id': parameters.getParameter('clientId'),
'ccsp-application-id': parameters.getParameter('appId'),
Expand All @@ -113,7 +113,7 @@ def getDeviceId():
'Host': parameters.getParameter('host'),
'Connection': 'Keep-Alive',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/3.10.0',
'User-Agent': 'okhttp/3.12.0',
'Stamp': stamps.getStamp()}

try:
Expand Down Expand Up @@ -265,7 +265,7 @@ def getAuthToken(authCode):
'Host': parameters.getParameter('host'),
'Connection': 'close',
'Accept-Encoding': 'gzip, deflate',
'User-Agent': 'okhttp/3.10.0'}
'User-Agent': 'okhttp/3.12.0'}

try:
response = kiahttp.postHTTP(url=url, headers=headers, data=data, timeout=parameters.getParameter('reqTimeout'))
Expand Down Expand Up @@ -296,7 +296,7 @@ def getControlToken(pin):
'Host': parameters.getParameter('host'),
'Connection': 'close',
'Accept-Encoding': 'gzip, deflate',
'User-Agent': 'okhttp/3.10.0'}
'User-Agent': 'okhttp/3.12.0'}

try:
response = kiahttp.putHTTP(url=url, data=data, headers=headers, timeout=parameters.getParameter('reqTimeout'))
Expand Down
6 changes: 4 additions & 2 deletions modules/soc_kia/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,18 @@ def loadBrandData():
setParameter('baseUrl', 'https://' + getParameter('host'))
setParameter('clientId', 'fdc85c00-0a2f-4c64-bcb4-2cfb1500730a')
setParameter('authClientId', '572e0304-5f8d-4b4c-9dd5-41aa84eed160')
setParameter('appId', 'e7bcd186-a5fd-410d-92cb-6876a42288bd')
setParameter('appId', 'a2b8469b-30a3-4361-8e13-6fceea8fbe74')
setParameter('GCMSenderId', '345127537656')
setParameter('PushType', 'APNS')
setParameter('basicToken', 'Basic ZmRjODVjMDAtMGEyZi00YzY0LWJjYjQtMmNmYjE1MDA3MzBhOnNlY3JldA==')
if getParameter('brand') == 'hyundai':
setParameter('host', 'prd.eu-ccapi.hyundai.com:8080')
setParameter('baseUrl', 'https://' + getParameter('host'))
setParameter('clientId', '6d477c38-3ca4-4cf3-9557-2a1929a94654')
setParameter('authClientId', '64621b96-0f0d-11ec-82a8-0242ac130003')
setParameter('appId', '014d2225-8495-4735-812d-2616334fd15d')
setParameter('appId', '1eba27d2-9a5b-4eba-8ec7-97eb6c62fb51')
setParameter('GCMSenderId', '414998006775')
setParameter('PushType', 'GCM')
setParameter(
'basicToken', 'Basic NmQ0NzdjMzgtM2NhNC00Y2YzLTk1NTctMmExOTI5YTk0NjU0OktVeTQ5WHhQekxwTHVvSzB4aEJDNzdXNlZYaG10UVI5aVFobUlGampvWTRJcHhzVg==')

Expand Down
8 changes: 4 additions & 4 deletions modules/soc_kia/stamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ def getStamp():
# Set App-ID and App-ID specific key
brand = parameters.getParameter('brand')
if brand == 'kia':
appid = "e7bcd186-a5fd-410d-92cb-6876a42288bd"
secret_ba = bytearray.fromhex("C0B4D5C7089D987F027C96015929C70FCE5B94FC9AE938CA6EE1E02F6142AFE2A1F20C7EB9C902C93E56EE1E0D81B9F7CEA3")
appid = "a2b8469b-30a3-4361-8e13-6fceea8fbe74"
secret_ba = bytearray.fromhex("C0B4D5C7089D987F027C96015929C70FA13486E934A33762BB2801E212E43395C283300BD43939B04DFA77F6F1E4F14C6D9B")

if brand == 'hyundai':
appid = "014d2225-8495-4735-812d-2616334fd15d"
secret_ba = bytearray.fromhex("445B6846AFEF0D726646776865A650C9F3A8B7B3AB22A195163F7A898D962F7CB21F967FA54BE5521AA60B10F6B7E0FA89E1")
appid = "1eba27d2-9a5b-4eba-8ec7-97eb6c62fb51"
secret_ba = bytearray.fromhex("445B6846AFEF0D726646776865A650C9AEF98E51A474DCB7EC9B1B67D29C66EAAEF621CA02522A0B80A8087F7A3A7BB0F71B")

# Combine plaintext and convert to bytearray
plaintext = appid + ":" + now
Expand Down

0 comments on commit 2c27544

Please sign in to comment.