added jspl_encoder_wrapper.py

This commit is contained in:
2025-08-13 16:26:49 +02:00
parent 9b191be6d6
commit 32eb83c5d6
6 changed files with 122 additions and 40 deletions
+11 -5
View File
@@ -247,16 +247,22 @@ function createJSPLGenerator(dateTimeStamp) {
}
// print process.argv
process.argv.forEach(function (val, index, array) {
console.log(index + ': ' + val);
});
// process.argv.forEach(function (val, index, array) {
// console.log(index + ': ' + val);
// });
var fingerprint = undefined
var dateTimeStamp = undefined
if (process.argv[2] != undefined) {
fingerprint = JSON.parse(process.argv[2])
}
dateTimeStamp = JSON.parse(process.argv[3])
// main
// if (dateTimeStamp == undefined) {
// dateTimeStamp = Math.floor(Date.now() / 1000)
// }
// let dateTimeStamp = Math.floor(Date.now() / 1000)
let dateTimeStamp = 1754908260
// let dateTimeStamp = 1754908260
// console.log(dateTimeStamp)
// 使用示例
@@ -293,7 +299,7 @@ let jsplGenerator = createJSPLGenerator(dateTimeStamp);
// "nm": false,
// "geb": false,
// "sqt": false,
// "pf": "MacIntel",
// "pf": "Linux armv81",
// "hc": 8,
// "br_oh": 745,
// "br_ow": 393,
+5 -3
View File
@@ -1,12 +1,14 @@
import json
import os
import subprocess
import time
def encrpte_to_jspl(fingerprint):
def encrpte_to_jspl(fingerprint_json):
dir = os.path.dirname(__file__)
# print(fingerprint_json)
p = subprocess.Popen(['node', dir + '/jspl_encoder.js', fingerprint_json], stdout=subprocess.PIPE)
_timestamp = int(time.time())
p = subprocess.Popen(['node', dir + '/jspl_encoder.js', fingerprint_json, str(_timestamp)], stdout=subprocess.PIPE)
encrypted_fingerprint = p.stdout.read()
_result = encrypted_fingerprint.decode('utf-8')
return _result
@@ -44,7 +46,7 @@ if __name__ == '__main__':
"nm": False,
"geb": False,
"sqt": False,
"pf": "MacIntel",
"pf": "Linux armv81",
"hc": 8,
"br_oh": 745,
"br_ow": 393,