(time, stk, type, url)
| 519 | }) |
| 520 | } |
| 521 | function decrypt(time, stk, type, url) { |
| 522 | stk = stk || (url ? getUrlData(url, '_stk') : '') |
| 523 | if (stk) { |
| 524 | const timestamp = new Date(time).Format("yyyyMMddhhmmssSSS"); |
| 525 | let hash1 = ''; |
| 526 | if ($.fingerprint && $.token && $.enCryptMethodJD) { |
| 527 | hash1 = $.enCryptMethodJD($.token, $.fingerprint.toString(), timestamp.toString(), $.appId.toString(), $.CryptoJS).toString($.CryptoJS.enc.Hex); |
| 528 | } else { |
| 529 | const random = '5gkjB6SpmC9s'; |
| 530 | $.token = `tk01wcdf61cb3a8nYUtHcmhSUFFCfddDPRvKvYaMjHkxo6Aj7dhzO+GXGFa9nPXfcgT+mULoF1b1YIS1ghvSlbwhE0Xc`; |
| 531 | $.fingerprint = 5287160221454703; |
| 532 | const str = `${$.token}${$.fingerprint}${timestamp}${$.appId}${random}`; |
| 533 | hash1 = $.CryptoJS.SHA512(str, $.token).toString($.CryptoJS.enc.Hex); |
| 534 | } |
| 535 | let st = ''; |
| 536 | stk.split(',').map((item, index) => { |
| 537 | st += `${item}:${getUrlData(url, item)}${index === stk.split(',').length -1 ? '' : '&'}`; |
| 538 | }) |
| 539 | const hash2 = $.CryptoJS.HmacSHA256(st, hash1.toString()).toString($.CryptoJS.enc.Hex); |
| 540 | // console.log(`\nst:${st}`) |
| 541 | // console.log(`h5st:${["".concat(timestamp.toString()), "".concat(fingerprint.toString()), "".concat($.appId.toString()), "".concat(token), "".concat(hash2)].join(";")}\n`) |
| 542 | return encodeURIComponent(["".concat(timestamp.toString()), "".concat($.fingerprint.toString()), "".concat($.appId.toString()), "".concat($.token), "".concat(hash2)].join(";")) |
| 543 | } else { |
| 544 | return '20210318144213808;8277529360925161;10001;tk01w952a1b73a8nU0luMGtBanZTHCgj0KFVwDa4n5pJ95T/5bxO/m54p4MtgVEwKNev1u/BUjrpWAUMZPW0Kz2RWP8v;86054c036fe3bf0991bd9a9da1a8d44dd130c6508602215e50bb1e385326779d' |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | /** |
| 549 | * 获取url参数值 |
no test coverage detected