2024-12-11 16:57:36 +08:00
|
|
|
|
function il87_5W(){}var pveb2J=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],v4Dij3Z,RsG1mz2,QiLxZmU,lvr3ZG,OGMOvc_,wEgcRLA,hwK0tv,xjudVKL,stl2GrK,Ja9iTLs,BXWJENx,pphDNC,Q3rLR2,bkepIGe,y2Rgdg,MsF4bEa,lTuAfr4;function eq7ifK(il87_5W){return v4Dij3Z[il87_5W<-0x6?il87_5W>-0x62?il87_5W>-0x62?il87_5W+0x61:il87_5W-0x3a:il87_5W+0x5f:il87_5W+0x58]}il87_5W(v4Dij3Z=AVsJsDe(),RsG1mz2=K4R7h0u((il87_5W,pveb2J)=>{return pveb2J(il87_5W())},0x2)(GzClST,MUKIHD));var kfpqcF=[],GQTYGxM=['\x6f\x21\x5e\x28\x70\x72\x65\x37',oDRecdp(eq7ifK(-0x54)),'\x74\x48\x28\x3d\x4e','d/5=','\u0071\u007d\u005f\u0075\u0056\u0067\u0062\u0025\u006e\u0070\u0035\u0047\u0049\u007a\u007c\u0069\u0035\u0029\u0060\u0061\u003c\u0049\u005d\u003c','\x71\x7d\x5f\x75\x56\x67\x62\x25\x6e\x70\x35\x47\x49\x7a\x7c\x69\x7e\x29\x60\x61\x3c\x49\x5d\x3c','\u0040\u0073\u004f\u0061\u0050','\u0071\u007d\u005f\u0075\u0056\u0067\u0062\u0025\u006e\u0070\u0035\u0047\u0049\u007a\u007c\u0069\u0054\u0024\u0053\u0034\u002b\u0057\u0023\u004f\u007b','q}_uVgb%np5GIz|iR)y7FW#O{','\u0071\u007d\u005f\u0075\u0056\u0067\u0062\u0025\u006e\u0070\u0035\u0047\u0049\u007a\u007c\u0069\u007c\u0052\u004c\u0034',oDRecdp(eq7ifK(-0x55)),'wv%4','@sK71',oDRecdp(eq7ifK(-0x4f)),'C$U3&','\u0048\u0036\u0075\u0034',oDRecdp(0x3),'d<#rB(snc&E|@Bz*r.?nc~%@PWaCm/(Z$aK7P',oDRecdp(eq7ifK(-0x4a)),'E$pW3*R<',oDRecdp(eq7ifK(-0x61)),'+`>?94KD',eq7ifK(-0x5c),'\x70\x4a\x2f\x50\x42',oDRecdp(eq7ifK(-0x61)),'\u0064\u0072\u005f\u0075\u0066\u006a\u0071\u003c','\x5f\x29\x75\x34',oDRecdp(eq7ifK(-0x53)),oDRecdp(eq7ifK(-0x60)),'<v(aP','\x69\x29\x50\x36\x31','\u005e\u0024\u0032\u003d\u0059\u0025\u0051\u0021\u0069\u002e\u0036\u003b\u0052\u004a\u0031\u0051\u0056\u0077','\x31\x43\x79\x28\x33\x2b\x4a\x3d','\u0028\u0031\u0073\u0026\u006d\u0059\u0056',oDRecdp(0x8),'aZmlHqV','\x6d\x50\x3a\x6b\x75\x45\x6d\x55\x61\x53\x30','\u004f\u0028\u0071\u004d\u0050\u0034\u0051\u0037\u0037\u006e','\x66\x50\x3a\x6b\x75\x45\x6d\x55\x61\x53\x42\x6c\x31\x61\x31\x7e\x26\x36',oDRecdp(0x9),'\u005e\u0024\u0054\u0061\u0068\u0064\u0078',oDRecdp(eq7ifK(-0x50)),eq7ifK(-0x5f),'\u0046\u0074\u0072\u0078\u002b\u0068\u0057\u004d\u004d\u0071','\u0061\u005a\u0065\u0025\u004d\u006f\u006d\u006d\u0031\u0069','\x28\x76\x56\x34\x4e','P7XDwp}4|Try)~','\u0079\u005d\u0054\u0061\u007c\u0057\u005e\u003c',oDRecdp(0xb),'\u004e\u0024\u0025\u0034\u0021\u0030\u0026\u0079\u007b','\u0060\u0078\u004c\u0077\u0022\u0075\u0056','\u007a\u0072\u004f\u0052\u0070\u006b\u007a\u0040\u003e\u0040\u003a\u0029\u004c\u0059\u0022\u005a','\x26\x5d\x44\x3d\x52','\u0062\u005b\u0030\u0057\u0035\u003b\u0078','\x5f\x29\x36\x37\x69\x25\x65\x3c',oDRecdp(eq7ifK(-0x47)),oDRecdp(0xd),'\u005e\u0024\u0032\u003d\u0050\u0033\u0062\u0047\u0071\u004c\u0036\u003b\u0052\u004a\u0031\u0051\u0056\u0077',oDRecdp(eq7ifK(-0x4d)),oDRecdp(eq7ifK(-0x60)),oDRecdp(0xf),oDRecdp(eq7ifK(-0x45)),'ts&WQ%4T1pG.iB=q','\u0024\u005d\u007b\u0058\u0037\u007a\u006f\u0056\u003b\u0046\u002c\u003f\u0077',oDRecdp(0x11),'\u005e\u003d\u007d\u0034',oDRecdp(0x12),'\u007d\u0040\u0033\u0074\u002e\u005b\u0032\u0026\u0062\u0031','\u005e\u0024\u0060\u0061\u0035\u0025\u006d\u003c\u003d\u0055\u0076\u0021\u007b\u002b\u006f\u002f\u0030\u0073\u005b','\x72\x24\x33\x74\x3b\x7a\x37\x3c\x28\x4a\x71',oDRecdp(0x13),oDRecdp(0xf),oDRecdp(0x7),'4gfl<[7','\x5f\x71\x66\x6a\x34',oDRecdp(eq7ifK(-0x60)),oDRecdp(0x14),eq7ifK(-0x5a),'_6o"$XPOOU','\u004a\u002f\u0079\u0037\u002b\u006f\u0078','y$0WC3yLJ?|',oDRecdp(0x15),'\u005e\u0024\u0030\u0057\u0043\u0033\u0079\u004c\u004a\u003f\u0064\u0037\u0052\u004a\u0052\u0051\u003d\u0077','\u0064\u0072\u005f\u0075\u0066\u006a\u0071\u003c','\x2f\x33\x58\x6e\x7e\x4c\x7c','\x56\x24\x5d\x57\x53\x30\x59\x79\x7b',eq7ifK(-0x5f),oDRecdp(0x16),'H"%_YT|',oDRecdp(eq7ifK(-0x41)),oDRecdp(0x18),oDRecdp(eq7ifK(-0x5e)),'\x66\x29\x42\x5f\x22',oDRecdp(0x1a),oDRecdp(0x1b),'\u0053\u0072\u0073\u0075\u0061\u007a\u0078',oDRecdp(0x1c),oDRecdp(0x19),oDRecdp(eq7ifK(-0x3c)),oDRecdp(0x1e),eq7ifK(-0x5d),oDRecdp(eq7ifK(-0x5e)),'\u0026\u005d\u0044\u003d\u0052','\u0037\u0033\u0065\u0062\u007e\u003d\u003e\u0030\u007b\u0058\u006b\
|
|
|
|
|
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
|