2024-10-19 15:24:01 +00:00
|
|
|
function yjF9gsc(){}var uJRfC9B=Object['defineProperty'],SNK5Lg,rTCk84h,HZFdndA,ULZIwxO,zBlXovT,NDldfUK,BfGbmy_,SHsElS,eJPnYX,usY3R39,fBoPinF,Io2voWG,qfYtZ6q,KmucUAx,S3aAaLu,EMyKMA,OIrmp_,WPpldgA,wIBy6S,aN9FX6Y;function JXI18s(yjF9gsc){return SNK5Lg[yjF9gsc<0x1a4?yjF9gsc<0x38?yjF9gsc+0x37:yjF9gsc-0x39:yjF9gsc-0x2e]}SNK5Lg=BkiQ_dA();function TvF1UOI(yjF9gsc,uJRfC9B){var HZFdndA=fQ2LfbD(yjF9gsc=>{return SNK5Lg[yjF9gsc<0x115?yjF9gsc>0x115?yjF9gsc+0x50:yjF9gsc+0x56:yjF9gsc-0x2c]},0x1);return rTCk84h(yjF9gsc,'length',{value:uJRfC9B,configurable:HZFdndA(0xa)})}yjF9gsc(rTCk84h=Object.defineProperty,HZFdndA=fQ2LfbD((yjF9gsc,uJRfC9B)=>{return uJRfC9B(yjF9gsc())},0x2)(pGpXlka,ORbSPT5));var v3q3Lve=[],SU0zkWD=[ItXVFps(0x0),ItXVFps(0x1),ItXVFps(0x2),ItXVFps(0x3),ItXVFps(0x4),ItXVFps(JXI18s(0x39)),ItXVFps(0x6),ItXVFps(0x7),ItXVFps(JXI18s(0x87)),ItXVFps(0x9),'T68];/[7_IC+ig|rB[2R+=eq2E8',ItXVFps(JXI18s(0xb8)),ItXVFps(0xb),ItXVFps(0xc),ItXVFps(JXI18s(0x94)),ItXVFps(JXI18s(0x86)),ItXVFps(0xf),ItXVFps(0x10),'|6H;',ItXVFps(0x11),ItXVFps(JXI18s(0x4f)),ItXVFps(0x13),ItXVFps(0x14),ItXVFps(0x15),ItXVFps(0x16),ItXVFps(JXI18s(0x9f)),ItXVFps(JXI18s(0x75)),ItXVFps(0x19),ItXVFps(JXI18s(0x71)),ItXVFps(0x1b),'>L:OAeUX`1"oQAk*O{uX`.KQlwpjOU::nn"A)y{v|%nf5@B>N61w4FYgO%`yiwbgHa,auc6hUb:K"c,*W4;:J<#oU}UCgC4~8BGK~kQ/;',ItXVFps(0x1c),ItXVFps(0x1d),ItXVFps(JXI18s(0x180)),ItXVFps(JXI18s(0x78)),'uV&}/Ho|',ItXVFps(0x20),ItXVFps(0x21),ItXVFps(JXI18s(0x191)),ItXVFps(0x23),ItXVFps(JXI18s(0xe3)),ItXVFps(JXI18s(0x39)),'|daIM$4L',ItXVFps(0x25),ItXVFps(0x26),ItXVFps(JXI18s(0x14f)),ItXVFps(0x28),JXI18s(0x3a),ItXVFps(JXI18s(0x116)),'~c$A|k):S8b"opDsLVVn',ItXVFps(JXI18s(0xaa)),ItXVFps(0x2b),ItXVFps(JXI18s(0xac)),ItXVFps(0x1a),ItXVFps(JXI18s(0x6c)),'>L:OAeUX`1"oQAq|(6W<[k(YzR*U[7C)>q',ItXVFps(0x2d),'Ej9h<FeR~8<&zx^:;acnY@Mp?l*cI]W8=di}A,NreT1:1}rvY8xRtRN4R=x:R|Gv!8XUOVx!AIZ],AAzbq',ItXVFps(0x2e),ItXVFps(0x2f),ItXVFps(0x30),ItXVFps(0x31),ItXVFps(0x32),ItXVFps(JXI18s(0xaf)),ItXVFps(JXI18s(0x1a1)),ItXVFps(JXI18s(0xb0)),ItXVFps(JXI18s(0x3b)),ItXVFps(JXI18s(0x4b)),ItXVFps(0x38),JXI18s(0x3a),ItXVFps(0x1b),ItXVFps(JXI18s(0xfc)),ItXVFps(0x3a),ItXVFps(JXI18s(0xb1)),ItXVFps(0x3c),ItXVFps(JXI18s(0xb2)),ItXVFps(JXI18s(0xb3)),ItXVFps(0x3f),ItXVFps(JXI18s(0x3b)),ItXVFps(0x37),JXI18s(0x3a),ItXVFps(0x40),ItXVFps(0x41),'GP|p~VS',JXI18s(0x3c),ItXVFps(0x42),ItXVFps(0x43),ItXVFps(0x44),JXI18s(0x40),ItXVFps(JXI18s(0x7b)),ItXVFps(0x46),ItXVFps(JXI18s(0xfe)),ItXVFps(JXI18s(0x41)),ItXVFps(0x49),ItXVFps(0x4a),ItXVFps(JXI18s(0x57)),ItXVFps(JXI18s(0x42)),'|daIM$4L','5~I`|',ItXVFps(0x4d),ItXVFps(JXI18s(0x43)),ItXVFps(0x4f),ItXVFps(JXI18s(0xc5)),ItXVFps(0x51),ItXVFps(JXI18s(0x44)),ItXVFps(0x53),'3icV]d,g5u@wgZ?+%zW/.L|i[]nZ%,,M',ItXVFps(0x54),ItXVFps(JXI18s(0x45)),ItXVFps(0x56),ItXVFps(JXI18s(0x60)),ItXVFps(JXI18s(0xb6)),ItXVFps(0x59),ItXVFps(0x5a),ItXVFps(0x5b),ItXVFps(JXI18s(0xc7)),'|6H;',ItXVFps(JXI18s(0x17f)),ItXVFps(JXI18s(0x68)),ItXVFps(0x5f),ItXVFps(JXI18s(0x3d)),ItXVFps(JXI18s(0xc9)),ItXVFps(JXI18s(0x8b)),ItXVFps(0x63),ItXVFps(JXI18s(0x193)),ItXVFps(0x65),ItXVFps(JXI18s(0xcc)),ItXVFps(0x67),ItXVFps(JXI18s(0xcd)),ItXVFps(JXI18s(0xc6)),ItXVFps(JXI18s(0xcf)),ItXVFps(0x6b),ItXVFps(0x6c),ItXVFps(JXI18s(0xd0)),ItXVFps(0x6e),'BR|/(k!S',ItXVFps(JXI18s(0xd1)),ItXVFps(JXI18s(0x46)),ItXVFps(JXI18s(0xd2)),ItXVFps(0x72),ItXVFps(0x73),ItXVFps(0x37),ItXVFps(0x74),ItXVFps(JXI18s(0xa0)),ItXVFps(JXI18s(0xa1)),ItXVFps(0x77),ItXVFps(JXI18s(0xd5)),ItXVFps(JXI18s(0x81)),ItXVFps(JXI18s(0xd6)),ItXVFps(0x7b),ItXVFps(0x7c),ItXVFps(0x7d),ItXVFps(0x7e),'0M|s2}sIXA',ItXVFps(JXI18s(0xd7)),ItXVFps(JXI18s(0x77)),ItXVFps(0x81),ItXVFps(JXI18s(0xbc)),ItXVFps(JXI18s(0xd3)),ItXVFps(JXI18s(0x83)),ItXVFps(0x69),ItXVFps(0x84),ItXVFps(JXI18s(0x48)),ItXVFps(0x86),ItXVFps(JXI18s(0x89)),'$k|pl',ItXVFps(JXI18s(0x4c)),'GP|p~VS',JXI18s(0x3c),ItXVFps(0x42),ItXVFps(0x88),ItXVFps(JXI18s(0x3f)),'GP|pEVS',ItXVFps(0x89),ItXVFps(0x48),ItXVFps(0x49),ItXVFps(0x4a),ItXVFps(0x4b),ItXVFps(0x8a),'|daIM$l77T',ItXVFps(0x8b),ItXVFps(0x8c),ItXVFps(0x8d),ItXVFps(0x8e),'bMUH1k|bG',ItXVFps(JXI18s(0x49)),'2`yE[Pku~Digu9x|bO!J@l7`][s9bkT',ItXVFps(0x8f),'2`y
|
2024-06-28 07:47:44 +00: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
|