Document the project structure and setup while excluding local dependencies and IDE settings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
130 lines
4.1 KiB
JavaScript
130 lines
4.1 KiB
JavaScript
var b = function () {
|
|
function t() {
|
|
this.codeStr = "",
|
|
this.pubPass = "BX1o65CoobwcDP33iQW6ld1OyIPsNzF1",
|
|
this.pubPassNum = [],
|
|
this.publicKey = "",
|
|
this.setPass(this.pubPass)
|
|
}
|
|
|
|
return t.prototype.encode = function (t) {
|
|
var e = "";
|
|
try {
|
|
e = JSON.stringify(t)
|
|
} catch (n) {
|
|
return console.error(n + "这不是一个正确的json对象"),
|
|
""
|
|
}
|
|
return this.encryptCode(e)
|
|
}
|
|
,
|
|
t.prototype.decode = function (t) {
|
|
var e;
|
|
try {
|
|
e = JSON.parse(this.decryptCode(t))
|
|
} catch (n) {
|
|
return void console.error(n + "json对象转出失败")
|
|
}
|
|
return e
|
|
}
|
|
,
|
|
t.prototype.encryptCode = function (t) {
|
|
for (var e = encodeURI(t), n = [], i = 0, r = "", o = this.random(16, 32), a = this.randomStr(o), c = this.stringChangeASCIINumberArrs(a), s = 0, u = 0, l = 0, h = 0; h < e.length; h++)
|
|
i = e.charCodeAt(h),
|
|
s == this.pubPassNum.length && (s = 0),
|
|
i += this.pubPassNum[s],
|
|
s++,
|
|
u == c.length && (u = 0),
|
|
i += c[u],
|
|
u++,
|
|
l += i,
|
|
l > 65535 && (l -= 65535),
|
|
r = i.toString(36),
|
|
r = ("00" + r).substr(-2, 2),
|
|
1 == r.length && (r = "0" + r),
|
|
n.push(r);
|
|
var f = "";
|
|
return f = l.toString(36),
|
|
f = ("0000" + r).substr(-4, 4),
|
|
n.unshift(a),
|
|
n.unshift(o.toString(36)),
|
|
n.unshift(f),
|
|
n.join("")
|
|
}
|
|
,
|
|
t.prototype.decryptCode = function (t) {
|
|
var e = ""
|
|
, n = 0
|
|
, i = ""
|
|
, r = []
|
|
, o = []
|
|
, a = 0
|
|
, c = 0;
|
|
e = t.substr(4, 1),
|
|
n = parseInt(e, 36),
|
|
i = t.substr(5, n),
|
|
r = this.stringChangeASCIINumberArrs(i),
|
|
e = t.substr(5 + n, t.length - 5 - n);
|
|
for (var s = "", u = 0, l = 0, h = 0; h < e.length / 2; h++)
|
|
s = e.substr(l, 2),
|
|
l += 2,
|
|
u = parseInt(s, 36),
|
|
c == r.length && (c = 0),
|
|
u -= r[c],
|
|
c++,
|
|
a == this.pubPass.length && (a = 0),
|
|
u -= this.pubPassNum[a],
|
|
a++,
|
|
s = String.fromCharCode(u),
|
|
o.push(s);
|
|
return e = o.join(""),
|
|
e = decodeURI(e),
|
|
e
|
|
}
|
|
,
|
|
t.prototype.setPass = function (t) {
|
|
this.pubPassNum = this.stringChangeASCIINumberArrs(t)
|
|
}
|
|
,
|
|
t.prototype.stringChangeASCIINumberArrs = function (t) {
|
|
for (var e = [], n = 0; n < t.length; n++)
|
|
e.push(t.charCodeAt(n));
|
|
return e
|
|
}
|
|
,
|
|
t.prototype.random = function (t, e) {
|
|
return void 0 === t && (t = 0),
|
|
void 0 === e && (e = 1e4),
|
|
Math.floor(Math.random() * (e - t) + t)
|
|
}
|
|
,
|
|
t.prototype.randomStr = function (t) {
|
|
for (var e = [], n = 0; n < t; n++)
|
|
e.push(this.random(0, 35).toString(36));
|
|
return e.join("")
|
|
}
|
|
,
|
|
t
|
|
}()
|
|
|
|
function encrypt_payload(page) {
|
|
const aes = new b;
|
|
const data = {
|
|
"id": "ru9dz050bkg8oy3j",
|
|
"projectKey": "honsan_cloud_ccprec",
|
|
"clientKey": "ru9dyul1ixcuvpdn",
|
|
"token": null,
|
|
"clientDailyData": {},
|
|
"acts": [{
|
|
"id": "ru9dz04zw4wp164f",
|
|
"fullPath": "/ccprec.com.cn.web/client/info/cqweb_nonphy_cqzr",
|
|
"args": [page, 20, null]
|
|
}]
|
|
};
|
|
return aes.encode(JSON.stringify(data));
|
|
}
|
|
|
|
function decrypt_data(enc_data) {
|
|
const aes = new b;
|
|
return aes.decode(enc_data)
|
|
} |