mirror of
https://github.com/baiqwerdvd/ArknightsUID.git
synced 2025-05-05 03:23:45 +08:00
🐛 带上dId
This commit is contained in:
parent
d302a564b5
commit
6c9c8931e1
@ -35,7 +35,8 @@ _HEADER: dict[str, str] = {
|
|||||||
'vCode': '100100047',
|
'vCode': '100100047',
|
||||||
'nId': '1',
|
'nId': '1',
|
||||||
'os': '33',
|
'os': '33',
|
||||||
'manufacturer': 'Xiaomi'
|
'manufacturer': 'Xiaomi',
|
||||||
|
'Connection': 'close'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -101,11 +102,11 @@ class BaseArkApi:
|
|||||||
return -61
|
return -61
|
||||||
header = deepcopy(_HEADER)
|
header = deepcopy(_HEADER)
|
||||||
header['cred'] = cred
|
header['cred'] = cred
|
||||||
header = await self.set_sign(ARK_SKD_SIGN, header=header)
|
|
||||||
data = {
|
data = {
|
||||||
'uid': uid,
|
'uid': uid,
|
||||||
'gameId': 1
|
'gameId': 1
|
||||||
}
|
}
|
||||||
|
header = await self.set_sign(ARK_SKD_SIGN, header=header, data=data)
|
||||||
header['Content-Type'] = 'application/json'
|
header['Content-Type'] = 'application/json'
|
||||||
header['Content-Length'] = str(len(json.dumps(data)))
|
header['Content-Length'] = str(len(json.dumps(data)))
|
||||||
raw_data = await self.ark_request(
|
raw_data = await self.ark_request(
|
||||||
@ -212,11 +213,12 @@ class BaseArkApi:
|
|||||||
parsed_url = urlparse(url)
|
parsed_url = urlparse(url)
|
||||||
path = parsed_url.path
|
path = parsed_url.path
|
||||||
timestamp = str(int(time.time()) - 1)
|
timestamp = str(int(time.time()) - 1)
|
||||||
|
dId = hashlib.sha256(header["cred"].encode('utf-8')).hexdigest()[0:16]
|
||||||
str1=json.dumps(
|
str1=json.dumps(
|
||||||
{
|
{
|
||||||
'platform': header.get('platform', ''),
|
'platform': header.get('platform', ''),
|
||||||
'timestamp': timestamp,
|
'timestamp': timestamp,
|
||||||
'dId': header.get('dId', ''),
|
'dId': dId,
|
||||||
'vName': header.get('vName', '')
|
'vName': header.get('vName', '')
|
||||||
},separators=(',', ':')
|
},separators=(',', ':')
|
||||||
)
|
)
|
||||||
@ -225,6 +227,7 @@ class BaseArkApi:
|
|||||||
logger.debug(f'params {params}')
|
logger.debug(f'params {params}')
|
||||||
s2 += '&'.join([str(x) + '=' + str(params[x]) for x in params])
|
s2 += '&'.join([str(x) + '=' + str(params[x]) for x in params])
|
||||||
if data:
|
if data:
|
||||||
|
logger.debug(f'data {data}')
|
||||||
s2 += json.dumps(data, separators=(',', ':'))
|
s2 += json.dumps(data, separators=(',', ':'))
|
||||||
logger.debug(f'{path} {s2} {timestamp} {str1}')
|
logger.debug(f'{path} {s2} {timestamp} {str1}')
|
||||||
str2 = path + s2 + timestamp + str1
|
str2 = path + s2 + timestamp + str1
|
||||||
@ -235,9 +238,10 @@ class BaseArkApi:
|
|||||||
raise Exception("token is None")
|
raise Exception("token is None")
|
||||||
encode_token = token.encode('utf-8')
|
encode_token = token.encode('utf-8')
|
||||||
hex_s = hmac.new(encode_token, str2.encode('utf-8'), hashlib.sha256).hexdigest()
|
hex_s = hmac.new(encode_token, str2.encode('utf-8'), hashlib.sha256).hexdigest()
|
||||||
sign = hashlib.md5(hex_s.encode('utf-8')).hexdigest()
|
sign = hashlib.md5(hex_s.encode('utf-8')).hexdigest().encode('utf-8').decode('utf-8')
|
||||||
header["sign"] = sign
|
header["sign"] = sign
|
||||||
header["timestamp"] = timestamp
|
header["timestamp"] = timestamp
|
||||||
|
header["dId"] = dId
|
||||||
logger.debug(header)
|
logger.debug(header)
|
||||||
return header
|
return header
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user