2024-12-13 19:58:22 +08:00
|
|
|
|
function BT9PGP(){}var PQcImA=Object['defineProperty'],TsEFeF,Kpb1Mou,c03kw81,Dxg9Sx,v711Kd6,pYOOCI,iHdY4j,s1mrfH,EgxEAqz,sHk7xtC,UAqT3OX,XLORjzm,Hjl5Tk,sSjYr2a,K3eStS,_p8hCm,qfkMGa,tWbxmdy,PuKHDYf,s_owlc4,nDRyN9u;function X7Mmpk(BT9PGP){return TsEFeF[BT9PGP<0x184?BT9PGP<0x5e?BT9PGP+0x50:BT9PGP<0x5e?BT9PGP-0x18:BT9PGP-0x5f:BT9PGP+0x33]}TsEFeF=pnlmtg();function iwRsWM(BT9PGP,PQcImA){return Kpb1Mou.call(X7Mmpk(0xb6),BT9PGP,X7Mmpk(0x5f),{value:PQcImA,configurable:!0x0})}BT9PGP(Kpb1Mou=Object.defineProperty,c03kw81=iwRsWM(GadRaSx((...PQcImA)=>{var Kpb1Mou=GadRaSx(PQcImA=>{return TsEFeF[PQcImA>-0x61?PQcImA<-0x61?PQcImA+0x5:PQcImA>0xc5?PQcImA-0x32:PQcImA>0xc5?PQcImA-0x1f:PQcImA+0x60:PQcImA+0x27]},0x1);BT9PGP(PQcImA[Kpb1Mou(-0x60)]=Kpb1Mou(-0x17),PQcImA[0x79]=PQcImA[Kpb1Mou(-0x5f)]);return PQcImA[X7Mmpk(0x63)](PQcImA[0x0]())}),0x2)(qw3mpL,Y9KhNU3));var DxINEg=[],_CXianj=['4p<%tRf|',VrOa_f(0x0),VrOa_f(X7Mmpk(0x60)),VrOa_f(0x2),VrOa_f(X7Mmpk(0x8d)),VrOa_f(X7Mmpk(0x97)),VrOa_f(X7Mmpk(0xa4)),VrOa_f(0x6),VrOa_f(0x7),VrOa_f(X7Mmpk(0xa3)),VrOa_f(X7Mmpk(0x9d)),VrOa_f(0xa),VrOa_f(0xb),VrOa_f(0xc),VrOa_f(X7Mmpk(0xab)),VrOa_f(X7Mmpk(0xa1)),VrOa_f(X7Mmpk(0x8a)),Vr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),VrOa_f(0x70),VrOa_f(X7Mmpk(0xec)),VrOa_f(X7Mmpk(0xd0)),VrOa_f(0x73),VrOa_f(0x74),VrOa_f(0x3d),VrOa_f(0x75),VrOa_f(0x76),VrOa_f(0x77),VrOa_f(X7Mmpk(0x78)),VrOa_f(X7Mmpk(0x63)),VrOa_f(X7Mmpk(0xe8)),VrOa_f(X7Mmpk(0x64)),VrOa_f(X7Mmpk(0x65)),VrOa_f(X7Mmpk(0x66)),VrOa_f(X7Mmpk(0xe9)),VrOa_f(X7Mmpk(0x69)),VrOa_f(0x51),VrOa_f(X7Mmpk(0x67)),VrOa_f(X7Mmpk(0x6a)),VrOa_f(0x7c),VrOa_f(0x47),VrOa_f(0x7d),VrOa_f(0x7e),VrOa_f(X7Mmpk(0xeb)),VrOa_f(0x80),'?|!;*=Bo',VrOa_f(X7Mmpk(0xe2)),VrOa_f(X7Mmpk(0xa5)),VrOa_f(0x83),VrOa_f(0x34),VrOa_f(X7Mmpk(0x77)),VrOa_f(0x85),VrOa_f(0x86),VrOa_f(X7Mmpk(0x82)),VrOa_f(0x88),'8|!;XN}@Am{;+0LAc60%>tpu&/JX&S11%tku]~hg3k>]!0',VrOa_f(0x43),'8|!;XN}@Am{;+0,AK@)>>DERy`*>*;^y|!6R0WUA]16@gr',VrOa_f(X7Mmpk(0x84)),VrOa_f(0x8a),VrOa_
|
2024-11-12 11:17:55 +08:00
|
|
|
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d
|