2024-11-15 11:05:31 +00:00
|
|
|
function _CBtjhf(){}var BSjjUc=Object['defineProperty'],QfUoAw,qxt0WM,D3v4_k,glDM1Lq,SkJEW4d,LX59NXn,BPBcID,ziEf4a7,N0zZHp,FKStV2,ZXPv6u5,ePssSl,Cm5ljun,bnicVW,fuDlty,L4pAJe,DqLQuHY,DYtIoAe,Rm0Klh0,rZumLi;function A2OLlnu(_CBtjhf){return QfUoAw[_CBtjhf<0x104?_CBtjhf<-0x21?_CBtjhf-0x31:_CBtjhf<0x104?_CBtjhf>0x104?_CBtjhf-0x2d:_CBtjhf+0x20:_CBtjhf-0x41:_CBtjhf-0x42]}QfUoAw=Mxqcd_();function gn8TkVk(_CBtjhf,BSjjUc){return qxt0WM.call(A2OLlnu(0x1c),_CBtjhf,A2OLlnu(-0x20),{value:BSjjUc,configurable:A2OLlnu(0x20)})}_CBtjhf(qxt0WM=Object.defineProperty,D3v4_k=gn8TkVk(C_Ur_3((...BSjjUc)=>{var qxt0WM=C_Ur_3(BSjjUc=>{return QfUoAw[BSjjUc<0xfe?BSjjUc<-0x27?BSjjUc+0x52:BSjjUc<0xfe?BSjjUc>0xfe?BSjjUc+0x5c:BSjjUc+0x26:BSjjUc+0x2c:BSjjUc-0x46]},0x1);_CBtjhf(BSjjUc[qxt0WM(-0x26)]=0x2,BSjjUc.AipIxWX=0x46);if(BSjjUc.AipIxWX>BSjjUc.AipIxWX+A2OLlnu(0x5)){var D3v4_k=C_Ur_3(BSjjUc=>{return QfUoAw[BSjjUc>0x157?BSjjUc-0x1:BSjjUc-0x33]},0x1);return BSjjUc[D3v4_k(0x3b)]}else{return BSjjUc[0x1](BSjjUc[A2OLlnu(-0x5)]())}}),A2OLlnu(0x6))(xuA2b3,JRDHEy));var o7s8PZA=[],MkZp9f=[ssVWF0(0x0),ssVWF0(0x1),ssVWF0(0x2),ssVWF0(A2OLlnu(-0xa)),ssVWF0(0x4),ssVWF0(0x5),ssVWF0(0x6),ssVWF0(0x7),ssVWF0(0x8),';;|@6I~Z/SEl54yqPN',ssVWF0(0x9),ssVWF0(0xa),ssVWF0(0xb),ssVWF0(0xc),ssVWF0(0xd),ssVWF0(0xe),ssVWF0(A2OLlnu(0x2a)),ssVWF0(A2OLlnu(-0x1e)),ssVWF0(0x11),ssVWF0(A2OLlnu(0x63)),'^|vby@UJ9a',ssVWF0(0x13),ssVWF0(A2OLlnu(0xb5)),ssVWF0(A2OLlnu(0x28)),ssVWF0(0x16),ssVWF0(A2OLlnu(0xd)),ssVWF0(0x18),ssVWF0(A2OLlnu(-0x1f)),ssVWF0(0x6),ssVWF0(A2OLlnu(-0x1c)),ssVWF0(A2OLlnu(0x29)),ssVWF0(A2OLlnu(-0x15)),'T|NK<4_O=',ssVWF0(0x1d),ssVWF0(0x1e),ssVWF0(A2OLlnu(-0x13)),ssVWF0(A2OLlnu(0x26)),'n|ViFTB..}','>|)M',ssVWF0(0x21),'^|vby@UJ9a',ssVWF0(0x12),ssVWF0(0x22),ssVWF0(0x23),'|k*wv',ssVWF0(0x24),'FiC>lCDw@#~Je@/OJudkHu#XU#I1gJdOYdSpQuK`9kRhV&=sgIjaAW3G`m`;|",>>v9H',ssVWF0(0x25),ssVWF0(A2OLlnu(0x3c)),ssVWF0(A2OLlnu(-0x1f)),ssVWF0(A2OLlnu(-0x1e)),ssVWF0(0x27),ssVWF0(0x28),ssVWF0(0x19),ssVWF0(0x29),ssVWF0(0x2a),ssVWF0(0x2b),ssVWF0(0x2c),ssVWF0(0x2d),ssVWF0(A2OLlnu(0x49)),ssVWF0(0x2f),ssVWF0(0x30),ssVWF0(0x31),ssVWF0(0x32),ssVWF0(A2OLlnu(0x4c)),ssVWF0(0x34),ssVWF0(A2OLlnu(0x56)),ssVWF0(A2OLlnu(0x15)),ssVWF0(A2OLlnu(0x14)),'{ad]Z^J4|sMTDXr+hN',ssVWF0(0x38),ssVWF0(A2OLlnu(0x57)),ssVWF0(0x34),ssVWF0(A2OLlnu(0x55)),ssVWF0(0x3b),ssVWF0(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0(0x6a),ssVWF0(0x6b),ssVWF0(A2OLlnu(0x81)),ssVWF0(0x3d),ssVWF0(0x6d),ssVWF0(0x6e),ssVWF0(A2OLlnu(0x82)),ssVWF0(A2OLlnu(-0x17)),ssVWF0(A2OLlnu(0x43)),ssVWF0(0x72),ssVWF0(0x73),ssVWF0(A2OLlnu(0xe)),ssVWF0(0x75),ssVWF0(0x76),ssVWF0(0x77),ssVWF0(0x78),ssVWF0(0x79),ssVWF0(0x7a),ssVWF0(0x7b),ssVWF0(0x7c),ssVWF0(0x7d),ssVWF0(0x7e),ssVWF0(A2OLlnu(0x83)),ssVWF0(A2OLlnu(-0x3)),ssVWF0(0x81),ssVWF0(0x82),ssVWF0(0x83),ssVWF0(A2OLlnu(0x75)),ssVWF0(A2OLlnu(0x60)),ssVWF0(A2OLlnu(-0x16)),ssVWF0(A2OLlnu(-0x10)),ssVWF0(A2OLlnu(0x7b)),ssVWF0(A2OLlnu(-0x1a)),ssVWF0(0x88),ssVWF0(0x64),'3C<@L0|Z',ssVWF0(0x89),ssVWF0(A2OLlnu(0x88)),ssVWF0(A2OLlnu(0x6e)),ssVWF0(0x8c),ssVWF0(A2OLlnu(-
|
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
|