2024-12-19 19:40:00 +08:00
|
|
|
var S2ejsQ,C0MlMB,x3Zcey,YwfTNkK,HDj3C8B,wgFgqDd,gJPVBO,g6baIf,aJIYC9,JFZOtSy,tkLFvty;const Yme4Vi=["length",0x1,0x3,0x2,0x0,"h",0x21,0x9,0x7,0x5,"f",0x52,0x8,0xff,"d",0x40,0xca,"undefined",void 0x0,"c",0xa7,"a",0x3f,0x6,"fromCodePoint",0xc,"push",0x67,"b",0x44,0xe3,0x5b,0x65,0x1fff,0x58,0xd,0xe,0xc5,0x5a,"g",0x47,0xa0,0x4,0x70,0x38,"e",0x23,0x9f,0xb6,0x62,0x1f,0x8f,"i",0x4f,0xa8,0x99,0x73,0x1d,0x54,0x2a,0x6e,0xf3,0xc7,0xac,0x3e,0x82,0xdb,0xc8,0xe5,0x48,0x13,!0x1,0x69,0x90,0x9c,0x6a,0xa,0x19,0xc9,0x88,0xd7,0xf4,0x75,0x5d,0x68,0x7f,0x80,0x81,0x72,0x77,0x3d,0xea,0xd8,0x8e,0x20,0x1b,0x91,0x84,0xd5,0x34,0x12,null,0x1a,0xf2,0xa2,0x1c,!0x0,0x9b,0xa1,0x9d,0x9a,0x9e,0xba," ",0xb4,0xa3,0xb9,0x61,0x30,0xbb,0x85,0xf0,0xed,0x26,0x3c,0x3e8,0xdf,"fg",0xe7,0xef,0x60,0x2c,0xee,0x6f,0x2d,0xf8,0xa4,0xb1,0xde,0x6d,0xbc,0xaa,0x57,0x64,0x100,"id",0x108,0x104,0x105,0x106,0x107,",,",0x109,",",0x10d,0x10e,0xad,0x76,0x37,0x93,0x7c,0x10,0x200,0xf,0xcf,0x46,0x25,0x3ff,0x4a,0xc0,0xe0,0x18,0x59,0xe8,0xf7,0xffff,0x98,"2","fn","cl","ua",0x135,0x13e,0x14a,0xec,0x35,0x3a,0x14e,0x31,"UA",0x8d,0x2f,0x83,"1",0x16b,0x7e,0xda,0x176];GFLDnp(hM0Y3ez(KVafUo),hM0Y3ez(wgkCmj,Yme4Vi[0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",">Z3]Yg5sWUrzqO!Qku5WpEX)#FsR?y","HZ.D0T6V","yZB]ZXgKjQfs8Mv9WUTblgEF[PW.=t~K%[(]O5P6(@~B!u;QPP2D","Z;\">;}cO!UTupU76&vd\":~*{;mfb{y!7cU:]PJ9]f@}@*@]","8;:Y]ej<d),X[_\"N8g;D\"g6W8nu[.6Y*^v|g.u=3>g1Qm8b_{;X?V+#","~T=bGw#:$QX<JL",":x^f#9&HTm^7OdP_9m3{rdlq,HLGb8S|z0*tCr0FE)M=:d9I5JV","XxabL8Z/znRtg)ceOJM{DuuBB1V2uMPYi.&2nuQH=gf5S>","d2T=?dEd$QE`s806[P+3(%DpX5Y^dRik]aR?De.]pmD)Q8)","`m6m1Wq)Hg@?_V,/(Q3Wz3M{sZ<bU17*&{wWn<L5=FYX#","+8Vyw=1s@1h`&!eKd0mg:=(vbjq}=txH]B!Wwp<F?)D|/VC$","t~b=pT{/UQtt|_=Y^>$_#pH<>gfjs","r2E]|}|Dcg[.>|oQ","5;3WFB=7GUN3h1t9`2,}Rp#","ua+YvM+BE)$R,8\"0[;({!2&HDOIQo1h/&Pb\"MUi]OQM`?=D","Cv8gWpppQK","rL;g%};&iP",";*Rt89jsD;Hdp|w$?>Rtm}9<!5wt8Mck7;MzU59/sme8ir=eF~o.dp1sYU0","F~s7egfFmQj_s","j0%?Yq#O*)","jJK_j=SsoZt@^<7p","CT6.ge#","UJba+RD6/Hk}x8#pCa}3xf[3\",$8RLa{","&;Q_&T\"/=1{wm8&9
|
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
|