2024-12-19 16:36:08 +08:00
|
|
|
|
function zem47wX(){}var GEcbAN=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],C12BwWb,iXBtHp,IbK8oY,dO7XYo,qACOXH,Vkga6f,eFf6ma,nJkeec,tP32wL,SI8J9b,CzE3WC5,oy4AIC,fc4Qfx5,fVOSoTe,XpjApq,tdKhaMs,FEvNIs,FmZuC9O,h3cS4N;function l7Xf8r(zem47wX){return C12BwWb[zem47wX<-0x2a?zem47wX+0x3c:zem47wX<-0x2a?zem47wX+0x1f:zem47wX>-0x2a?zem47wX+0x29:zem47wX+0x4e]}zem47wX(C12BwWb=eqsnFQM(),iXBtHp=MPKNz1((zem47wX,GEcbAN)=>{return GEcbAN(zem47wX())},0x2)(P6BZwGw,W_o5QF));var maWRcGz=[],Sxd66mS=['5EM#msdKD','\u0035\u0076\u0075\u007c\u002a\u0079\u0045\u004e','\x2c\x7d\x6d\x4c\x6b\x23\x4f\x4e','\u002f\u0036\u0068\u003b\u007b\u0079\u006c\u0063',IvJD7V(0x0),'\u006d\u0060\u0075\u0051\u0052\u004f\u005f\u0054',IvJD7V(l7Xf8r(-0x9)),'\x5f\x4a\x23\x62\x2e\x7a\x32\x2f\x73\x23\x78\x79\x54\x43\x73','IIDqBW%A)yV3/PNl[u','HBV)Q','\u006a\u006c\u0077\u0029','\u0035\u006b\u0030\u006e\u006e\u003b\u003d\u0070\u0026\u007b\u005d\u0059\u002f\u007a\u004a\u0034\u0071\u0049\u0021\u0029\u003a\u003b\u0035\u0041','\x7d\x44\x46\x76\x48\x6f\x58','\u006c\u0050\u004f\u0026\u0076\u002e\u0044\u0041',IvJD7V(0x2),'_(hv}','\x35\x6b\x30\x6e\x6e\x3b\x3d\x70\x26\x7b\x5d\x59\x62\x2e\x6b\x54\x6d\x50\x44\x71\x5b',IvJD7V(0x3),IvJD7V(l7Xf8r(0x3)),IvJD7V(l7Xf8r(0x8)),'\u0074\u0049\u007b\u007e\u0066','\u0075\u0036\u0022\u0026',IvJD7V(0x6),l7Xf8r(-0x22),IvJD7V(0x7),IvJD7V(l7Xf8r(-0x2)),'\x4c\x49\x25\x57\x7e\x6f\x50\x41',IvJD7V(0x9),'\x6a\x64\x30\x6e\x3a\x3b\x35\x41','\u0039\u006c\u0063\u006e\u0038\u007a\u005b\u005b\u0050\u0025','\u0066\u004d\u003f\u0029\u0050','\x47\x49\x33\x57\x74\x7e\x5b\x62\x39\x59\x6a\x71\x50\x39\x50\x55\x29\x75','jd0n:;5A',IvJD7V(0xa),l7Xf8r(-0x29),'\u0041\u0036\u0056\u0076\u007d','LP2sU','\u0038\u003d\u0051\u0077\u0033\u0041\u0079\u004f\u0031\u0071\u002f\u0078\u006e\u002a\u0056\u006f\u0047\u007c\u002f\u004b\u0022\u006e\u0075',IvJD7V(0xb),'\u0073\u002e\u0051\u0049\u0076\u0029\u0024','\x33\x30\x76\x4d\x7d\x25\x24','[I3Wt~[b9Ya','\x37\x73\x25\x5d\x23\x78\x32\x56\x56\x3d','\x47\x49\x33\x57\x74\x7e\x5b\x62\x39\x59\x6a\x71\x50\x39\x50\x55\x29\x75','\u006a\u0064\u0030\u006e\u003a\u003b\u0035\u0041','\x47\x49\x2c\x76\x4e\x6a\x58','\u0075\u004d\u006c\u0024\u007b','\u0044\u0023\u002a\u006a\u007c\u0036\u006b\u0046\u0072','\u0045\u0033\u0038\u0029\u0037\u005d\u0042\u0067\u003d\u007c\u0054\u0048\u0050\u0021\u005a\u004b\u0045\u0033\u0038\u0029\u0037\u005d\u0042\u0067\u003d\u007c\u0054\u0048\u0050\u0021\u005a\u004b\u0045\u0033\u0038\u0029\u0037\u005d\u0042\u0067\u003d\u007c\u0054\u0048\u0050\u0021\u005a\u004b\u0051\u0075',l7Xf8r(-0x24),'\x37\x28\x35\x71\x57\x6f\x25\x41','\u004f\u0050\u004c\u0045\u003f\u0069\u007d\u0068\u0068\u007b','\u0072\u006c\u0042\u0076\u007e\u006f\u0048\u002a\u006d\u0062\u004c\u0060\u0055\u0036','\x5b\x4d\x2c\x76\x61\x57\x47\x41',IvJD7V(l7Xf8r(-0x7)),l7Xf8r(-0x10),IvJD7V(0xd),IvJD7V(l7Xf8r(0x6)),'\x3e\x21\x5e\x3f\x2a\x74\x58',IvJD7V(0xf),IvJD7V(0x10),'\u007a\u0046\u0033\u0057\u0077\u0031\u0058',IvJD7V(0x11),'\u006c\u0050\u002c\u0076\u0025\u0045\u0075\u0038\u002b','\x40\x23\x2c\x76\x7d',IvJD7V(l7Xf8r(-0x27)),'\u007a\u0046\u0025\u0057\u0055\u0033\u0053\u005b\u0056\u0079\u007d\u0079\u0039\u0036','zFO&5gx[5,`','\u0047\u0049\u007c\u0029\u007d\u007e\u007a\u0078\u0035\u0062\u006d\u0031\u0050\u0039\u0040\u0055\u004a\u0075','\u003c\u003d\u0056\u0072\u002b\u0068\u0028\u0061\u0040',l7Xf8r(-0x29),IvJD7V(l7Xf8r(0xa)),'\x34\x46\x6b\x23\x5a\x54\x41\x2b\x40','\x39\x36\x66\x2c','\u0050\u003b\u0074\u0022\u002c\u0042\u004f\u0075\u0038\u004e\u0063','\x6d\x4c\x78\x38\x54\x67\x4e\x4a\x45\x53\x6a\x31\x75',IvJD7V(0x14),IvJD7V(l7Xf8r(0xb)),'\u003c\u003d\u006d\u002c\u003c\u0031\u0064\u0033\u002c\u002f\u004f\u0024\u0035\u0057','\x28\x3b\x4c\x26\x65\x54\x3b\x3c\x4d\x6b\x76\x51\x69\x36\x37','M=Rr','\x4c\x3e\x78\x46\x7b\x7d\x6f\x2e\x54\x7c\x64\x2a\x78\x48\x52\x5b\x4f\x6d\x34\x62\x57\x65\x7a\x35','\x41\x32\x55\x6b\x33\x41\x40\x76\x33\x7e\x69\x60\x54\x5d\x6e\x6f\x53\x7c\x4a\x25\x21\x77\x75','\x4a\x49\x4d\x57\x4f\x33\x70\x5b\x24','\x47\x39\x77\x22\x33\x61\x63\x35',l7Xf8r(-0x28),'\u002a\u0046\u0028\u0076\u0029\u0063\u0074\u006e\u0023\u0079\u0022\u0032\u0075',IvJD7V(l7Xf
|
|
|
|
|
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
|