|
|
|
|
function PHpbqBT(){}var sUTt1G=Object['defineProperty'],mGGobxn,l2BI5vn,x7k7RM4,rOfJEX,OTjFpf,bqY9RG,FwhrQw,uDI9Mkd,UjCvIJl,WSAAmO,rFpR1V,ZnR2Wj,pKOqlcm,I0IgjvD,MNWBq_d,X6itVc,fchtPu,wTpV95m,l6yrxx4,iMrCle,jbe7T7;function X2nUHZ(PHpbqBT){return mGGobxn[PHpbqBT>0xf4?PHpbqBT-0x1d:PHpbqBT>0xf4?PHpbqBT-0x16:PHpbqBT<0xf4?PHpbqBT<0xf4?PHpbqBT+0x5b:PHpbqBT+0x50:PHpbqBT-0x5c]}mGGobxn=qhv92K();function OS_wro(PHpbqBT,sUTt1G){return l2BI5vn(PHpbqBT,'length',{value:sUTt1G,configurable:!0x0})}PHpbqBT(l2BI5vn=Object.defineProperty,x7k7RM4=q0rmP_((PHpbqBT,sUTt1G)=>{return sUTt1G(PHpbqBT())},0x2)(XSmwhZM,Dv2YLrF));var UFYpR8j=[],TbSwucO=[cmiEaYT(0x0),cmiEaYT(X2nUHZ(-0x31)),'\x62\x70\x61\x4b\x7c\x2e\x7a\x3d\x72',cmiEaYT(0x2),cmiEaYT(X2nUHZ(-0x3a)),cmiEaYT(0x4),cmiEaYT(X2nUHZ(-0x39)),cmiEaYT(0x6),cmiEaYT(X2nUHZ(-0x33)),'\u0072\u0072\u007d\u0058\u007c\u0045\u0065\u0036\u0054\u004b\u002b\u0055\u0046\u005a\u0070\u0059\u0069\u0077',cmiEaYT(0x8),cmiEaYT(0x9),cmiEaYT(0xa),cmiEaYT(X2nUHZ(-0x2c)),cmiEaYT(0xc),cmiEaYT(0xd),cmiEaYT(X2nUHZ(-0x1e)),cmiEaYT(0xf),cmiEaYT(0x10),cmiEaYT(0x11),cmiEaYT(X2nUHZ(-0x32)),cmiEaYT(X2nUHZ(-0x2b)),cmiEaYT(X2nUHZ(-0x2d)),'|u%$',cmiEaYT(X2nUHZ(0xa7)),cmiEaYT(X2nUHZ(-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r8x<t$|;DA3L',cmiEaYT(0x7e),cmiEaYT(X2nUHZ(-0x37)),cmiEaYT(X2nUHZ(-0x38)),cmiEaYT(0x81),cmiEaYT(0x82),cmiEaYT(0x83),cmiEaYT(X2nUHZ(0x2e)),'|}?,ko7Cc)2i;G!1l.69:DjdZ7GEUj',cmiEaYT(0x31),'\u0025\u0075\u0030\u0059\u0029\u0047\u003e\u002f\u0063\u003a\u0061\u0023\u007d\u007c\u003f\u0066\u006a\u0028\u0067\u004c\u0039\u0024\u006c',cmiEaYT(0x85),cmiEaYT(X2nUHZ(-0x57)),cmiEaYT(X2nUHZ(-0x3f)),cmiEaYT(0x87),X2nUHZ(-0x58),cmiEaYT(0x88),cmiEaYT(0x89),')>{cc|w^#L',cmiEaYT(0x8a),cmiEaYT(0x8b),cmiEaYT(0x8c),'%>AE|E@6',cmiEaYT(0x8d),'\u0062\u006f\u004a\u0029\u0033\u007c\u004a\u0046\u0035\u0044',cmiEaYT(X2nUHZ(0x2f)),cmiEaYT(0x8f),cmiEaYT(0x90),'rn"K,|XF',';$qx^|o"','\x29\x3e\x7b\x63\x63\x7c\x77\x5e\x23
|
|
|
|
|
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
|