MCPcopy Create free account
hub / github.com/6dylan6/jdm / task

Function task

signapi.py:166–198  ·  view source on GitHub ↗
(func_id, body_json)

Source from the content-addressed store, hash-verified

164
165
166def task(func_id, body_json):
167 body_str = (body_json).strip()
168 client = "android"
169 client_version = "10.4.0"
170 uuid = ''.join(random.sample('0123456789abcdef0123456789abcdef0123456789abcdef', 40))
171 d_model = random.choice(
172 ["HUAWEI(NOH-AN00)", "Xiaomi(MI 9 Transparent Edition)", "Meizu(16T)", "HTC U-3w", "Redmi K20 Pro Premium Edition"])
173 osVersion = random.choice(["10", "11", "12"])
174 area = ''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(
175 random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4))
176 wifiBssid = "TP_LINK_".join(random.sample('0123456789ABCDEFG', 6))
177 screen = random.choice(["640x1136", "750x1334", "1080x1920"])
178 randomeid = ''.join(random.sample('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 20))
179 eid = f'eidAaf8081218as20a2GM${randomeid}7FnfQYOecyDYLcd0rfzm3Fy2ePY4UJJOeV0Ub840kG8C7lmIqt3DTlc11fB/s4qsAP8gtPTSoxu'
180 ext = quote('{"prstate":"0","pvcStu":"1"}')
181
182 sv, st, sign = get_sign(func_id, body_str, uuid, client, client_version)
183
184 ep = json.dumps({
185 "hdid": "JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw=",
186 "ts": st,
187 "ridx": -1,
188 "cipher": {"screen": base64Encode(screen), "wifiBssid": base64Encode(wifiBssid), "osVersion": base64Encode(osVersion),
189 "area": base64Encode(area), "openudid": base64Encode(uuid), "uuid": base64Encode(uuid)},
190 "ciphertype": 5,
191 "version": "1.0.3",
192 "appname": "com.360buy.jdmobile",
193 }).replace(" ", "")
194
195 body_str = quote(body_str)
196 ep = quote(ep)
197 data_str = f"body={body_str}&build=168069&client={client}&clientVersion={client_version}&d_brand=android&d_model={d_model}&ef=1&eid={eid}&ep={ep}&ext={ext}&isBackground=N&joycious=124&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&partner=android&rfs=0000&scope=11&st={st}&sv={sv}&sign={sign}"
198 return {"fn": func_id, "body": data_str}
199
200
201@server.route('/sign', methods=['post'])

Callers 1

signFunction · 0.70

Calls 3

get_signFunction · 0.85
base64EncodeFunction · 0.85
dumpsMethod · 0.80

Tested by

no test coverage detected