2024-11-19 08:12:22 +00:00
|
|
|
|
function BbvN2F(){}var du2xCWC=Object['defineProperty'],DuIvNeM,CQbBre,tlayoX,wfTyej,oPe0OvO,DIanAJ2,sgbAI7,qq76LW,JHgaUkW,qwoexP,gEw36WS,LA7UMv,m4WXvZ,WLiz0fv,pNNeWwl,e_LhP4Z,zMn1pk,jWBq6b,V_ofnJk,yHu6U59,j_g66b,dj66h0;function jAKzVGV(BbvN2F){return DuIvNeM[BbvN2F<0x26?BbvN2F-0x4c:BbvN2F>0x26?BbvN2F>0x288?BbvN2F+0x61:BbvN2F-0x27:BbvN2F+0x56]}DuIvNeM=rhETDO();function se_GSx(BbvN2F,du2xCWC){return CQbBre(BbvN2F,jAKzVGV(0x69),{value:du2xCWC,configurable:jAKzVGV(0x9e)})}BbvN2F(CQbBre=Object.defineProperty,tlayoX=Yem5Iz((BbvN2F,du2xCWC)=>{return du2xCWC(BbvN2F())},0x2)(PWZQV9,WNFkYj));var dgsBmtl=[],V7K1LC=[V60SVNW(jAKzVGV(0x67)),V60SVNW(jAKzVGV(0x66)),'[a#xu|A0',V60SVNW(jAKzVGV(0x86)),V60SVNW(jAKzVGV(0x78)),'"@F_d|79',V60SVNW(jAKzVGV(0x82)),V60SVNW(jAKzVGV(0x7f)),V60SVNW(jAKzVGV(0x74)),V60SVNW(jAKzVGV(0x28)),V60SVNW(jAKzVGV(0x84)),V60SVNW(jAKzVGV(0x9c)),V60SVNW(jAKzVGV(0x9a)),V60SVNW(jAKzVGV(0x9d)),'|o*T',V60SVNW(jAKzVGV(0x72)),V60SVNW(jAKzVGV(0x77)),V60SVNW(jAKzVGV(0x7a)),'42iz<|:03{]3w^E5!*^xt64bp9R',V60SVNW(jAKzVGV(0x71)),V60SVNW(jAKzVGV(0x7c)),V60SVNW(jAKzVGV(0xa1)),V60SVNW(jAKzVGV(0x76)),V60SVNW(jAKzVGV(0x6f)),V60SVNW(jAKzVGV(0xa2)),V60SVNW(jAKzVGV(0x7d)),V60SVNW(jAKzVGV(0x27)),V60SVNW(jAKzVGV(0x2b)),V60SVNW(jAKzVGV(0xa4)),V60SVNW(jAKzVGV(0x6b)),V60SVNW(jAKzVGV(0xaa)),V60SVNW(jAKzVGV(0xac)),V60SVNW(jAKzVGV(0xaf)),'dM|[a',V60SVNW(jAKzVGV(0xb0)),V60SVNW(jAKzVGV(0x94)),V60SVNW(jAKzVGV(0x6e)),V60SVNW(jAKzVGV(0x30)),V60SVNW(jAKzVGV(0x3a)),V60SVNW(jAKzVGV(0xbd)),V60SVNW(jAKzVGV(0x2d)),'R^|*[pHXxdlqf6%,i*t9',V60SVNW(jAKzVGV(0x89)),V60SVNW(jAKzVGV(0xdc)),V60SVNW(jAKzVGV(0x29)),V60SVNW(jAKzVGV(0x2a)),V60SVNW(jAKzVGV(0x27)),V60SVNW(jAKzVGV(0x2c)),V60SVNW(jAKzVGV(0xea)),V60SVNW(jAKzVGV(0x91)),V60SVNW(jAKzVGV(0xeb)),V60SVNW(jAKzVGV(0xe8)),V60SVNW(jAKzVGV(0x28)),V60SVNW(jAKzVGV(0x29)),V60SVNW(jAKzVGV(0xb8)),V60SVNW(jAKzVGV(0xec)),V60SVNW(jAKzVGV(0x2a)),V60SVNW(jAKzVGV(0x2b)),V60SVNW(jAKzVGV(0xe7)),V60SVNW(jAKzVGV(0x2c)),V60SVNW(jAKzVGV(0x2d)),'R^|*[pHXxdlqf6%,',V60SVNW(jAKzVGV(0xed)),V60SVNW(jAKzVGV(0xf1)),V60SVNW(jAKzVGV(0xf2)),V60SVNW(jAKzVGV(0x29)),V60SVNW(jAKzVGV(0x2a)),V60SVNW(jAKzVGV(0x27)),V60SVNW(jAKzVGV(0x2c)),V60SVNW(jAKzVGV(0x27)),V60SVNW(jAKzVGV(0x2c)),V60SVNW(jAKzVGV(0x29)),V60SVNW(jAKzVGV(0x2a)),V60SVNW(jAKzVGV(0x27)),V60SVNW(jAKzVGV(0x2c)),V60SVNW(jAKzVGV(0x29)),V60SVNW(jAKzVGV(0x2a)),V60SVNW(jAKzVGV(0xb1)),V60SVNW(jAKzVGV(0xf4)),V60SVNW(jAKzVGV(0x56)),V60SVNW(jAKzVGV(0xf5)),V60SVNW(jAKzVGV(0xd4)),V60SVNW(jAKzVGV(0x83)),V60SVNW(jAKzVGV(0x2d)),'0gwT|y7EK',V60SVNW(jAKzVGV(0x43)),V60SVNW(jAKzVGV(0xf6)),V60SVNW(jAKzVGV(0xf7)),V60SVNW(jAKzVGV(0x97)),V60SVNW(jAKzVGV(0xae)),V60SVNW(jAKzVGV(0xf8)),V60SVNW(jAKzVGV(0x73)),V60SVNW(jAKzVGV(0x2e)),jAKzVGV(0x2f),V60SVNW(jAKzVGV(0xf9)),V60SVNW(jAKzVGV(0x2e)),jAKzVGV(0x2f),V60SVNW(jAKzVGV(0xfa)),jAKzVGV(0x32),V60SVNW(jAKzVGV(0xfb)),V60SVNW(jAKzVGV(0x92)),V60SVNW(jAKzVGV(0x30)),V60SVNW(jAKzVGV(0x98)),V60SVNW(jAKzVGV(0xfd)),V60SVNW(jAKzVGV(0xfe)),V60SVNW(jAKzVGV(0xff)),V60SVNW(jAKzVGV(0x101)),V60SVNW(jAKzVGV(0x31)),V60SVNW(jAKzVGV(0x100)),'yjRe^4[whmbWo^B!eX9whP`oIJ&|e[RRssb^ZAXO$tsKu{%y#FmJl2=>ethA6JC>)k+k95F([CR`b5+!El3R,0DW[G[a>alp@%]`pBon3',V60SVNW(jAKzVGV(0xbc)),V60SVNW(jAKzVGV(0x103)),V60SVNW(jAKzVGV(0x104)),V60SVNW(jAKzVGV(0x105)),V60SVNW(jAKzVGV(0xbb)),V60SVNW(jAKzVGV(0x87)),V60SVNW(jAKzVGV(0x108)),'Oev{}!Vt#)YZGB:^Y@83e&ZE|a]paf2*TYB7>Jg`?":M#sEgi#AiS',V60SVNW(jAKzVGV(0x2d)),V60SVNW(jAKzVGV(0x109)),V60SVNW(jAKzVGV(0x28)),V60SVNW(jAKzVGV(0x42)),V60SVNW(jAKzVGV(0x10e)),V60SVNW(jAKzVGV(0x10c)),V60SVNW(jAKzVGV(0x34)),V60SVNW(jAKzVGV(0x62)),V60SVNW(jAKzVGV(0x38)),V60SVNW(jAKzVGV(0x35)),'0gFp?|s',V60SVNW(jAKzVGV(0x4e)),V60SVNW(jAKzVGV(0x31)),V60SVNW(jAKzVGV(0x33)),V60SVNW(jAKzVGV(0x120)),V60SVNW(jAKzVGV(0x116)),jAKzVGV(0x32),V60SVNW(jAKzVGV(0x134)),V60SVNW(jAKzVGV(0xca)),V60SVNW(jAKzVGV(0x5b)),V60SVNW(jAKzVGV(0x93)),V60SVNW(jAKzVGV(0x63)),V60SVNW(jAKzVGV(0x39)),V60SVNW(jAKzVGV(0x36)),V60SVNW(jAKzVGV(0x37)),V60SVNW(jAKzVGV(0x8f)),V60SVNW(jAKzVGV(0x7e)),V60SVNW(jAKzVGV(0x2d)),V60SVNW(jAKzVGV(0x33)),V60SVNW(jAKzVGV(0x8e)),V60SVNW(jAKzVGV(0x152)),V60SVNW(jAKzVGV(0x34)),V60SVNW(jAKzV
|
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
|