2024-12-11 16:57:36 +08:00
|
|
|
|
function F83w62(){}var FB60Ad=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],Esbs4Y,ESF5zeN,wMTZ2g7,bqr8hL,P7Qg9Oe,pRvD35J,eHrR5kL,DcR6bv,fq1NmX,on0fAs,yl1NF5,sb5vOe,m3hOPkg,TqaKCd,wif_WH3,vfY9ap9;function aV3Tnia(F83w62){return Esbs4Y[F83w62<-0x5d?F83w62-0x2f:F83w62+0x5c]}F83w62(Esbs4Y=rweh0t5(),ESF5zeN=K_XM9Q((F83w62,FB60Ad)=>{return FB60Ad(F83w62())},0x2)(EMLPXEK,MH6Sf8J));var bnKKD8G=[],R1Jn38=[x520Fo(0x0),x520Fo(0x1),'\x72\x2a\x2a\x7e\x4e\x65\x49\x63\x3f',x520Fo(0x2),'\x69\x35\x49\x2a\x52\x25\x65\x60\x7a\x47\x61\x2f\x26',x520Fo(aV3Tnia(-0x32)),'\x5d\x43\x25\x37','\u007d\u0061\u005b\u006d\u006d\u0034\u0033\u0044\u0024\u0067\u0053\u0056\u0041\u0071\u0051\u0073\u0075\u002f\u0077\u0037\u0076\u0034\u007d\u003c',x520Fo(aV3Tnia(-0x26)),'\x43\x35\x2e\x24\x72\x74\x7e\x3c','\u007d\u0061\u005b\u006d\u006d\u0034\u0033\u0044\u0024\u0067\u0053\u0056\u0056\u0035\u003a\u005b\u006d\u005f\u006a\u0028\u0055\u003a\u006f\u0051\u007c\u0067\u0047',x520Fo(aV3Tnia(-0x2f)),'\x7d\x61\x5b\x6d\x6d\x34\x33\x44\x24\x67\x53\x56\x21\x74\x61\x3e\x28\x35\x7e\x75\x5e',x520Fo(aV3Tnia(-0x35)),x520Fo(aV3Tnia(-0x24)),'\x44\x28\x68\x72\x66\x7e\x38\x56\x4a\x6f\x50\x39\x62\x4e\x5b\x6a\x7e\x6c\x5b\x54\x23\x3e\x40\x69\x73\x47\x72','\u0079\u002f\u0067\u0063\u0048',x520Fo(aV3Tnia(-0x2b)),'\u0068\u0028\u006d\u0024',x520Fo(0x9),'\x5d\x3c\x4f\x47\x33\x3d\x23\x4b\x4c\x48\x22\x36\x4e\x33\x74\x65\x47\x42\x56\x4b\x4c\x77\x78\x4e\x6a\x54\x72\x79\x73\x43\x3d\x3e\x2f\x72\x59\x75\x6a','\u0047\u006c\u0051\u0024\u0032','\x22\x2f\x60\x54\x63\x65\x35\x3c','\u006e\u002f\u006c\u0054\u0079\u0063\u005e\u0021\u003f\u0056\u005d\u0075\u0035\u003f\u0035\u0040\u0037\u0045','\x5d\x47\x5b\x6d\x76\x34\x7d\x3c',aV3Tnia(-0x53),x520Fo(0xa),aV3Tnia(-0x5c),x520Fo(0xb),x520Fo(0xc),x520Fo(0xc),x520Fo(0x9),aV3Tnia(-0x51),'\x2c\x33\x32\x25\x6c\x3c\x4f\x2e\x6b\x75\x41\x39\x6d\x49\x3d\x65\x6e\x3b\x41\x4b\x78\x6d\x45',x520Fo(0xd),x520Fo(aV3Tnia(-0x30)),x520Fo(aV3Tnia(-0x56)),'\x5e\x2f\x6c\x54\x79\x63\x5e\x21\x3f\x56\x36',aV3Tnia(-0x55),aV3Tnia(-0x5c),x520Fo(0xb),'\u006e\u002f\u004d\u0072\u0057\u005d\u0046','\u0045\u0066\u0043\u004a\u0067','\u006e\u002f\u004d\u0072\u0031\u0071\u0034\u0051\u004a','\x7c\x6c\x2c\x37\x42\x53\x68\x31\x33\x3b\x3e\x52\x35\x77\x7a\x4b\x7c\x6c\x2c\x37\x42\x53\x68\x31\x33\x3b\x3e\x52\x35\x77\x7a\x4b\x7c\x6c\x2c\x37\x42\x53\x68\x31\x33\x3b\x3e\x52\x35\x77\x7a\x4b\x32\x45',aV3Tnia(-0x58),'\x42\x23\x7d\x75\x54\x65\x60\x3c',x520Fo(0x10),'\x3a\x43\x68\x72\x63\x65\x52\x49\x28\x21\x22\x6f\x40\x5f','\x5e\x66\x4d\x72\x36\x54\x6e\x3c',x520Fo(aV3Tnia(0x34)),x520Fo(aV3Tnia(-0x33)),'\x6e\x2f\x29\x72\x79\x74\x25\x4d\x69\x70\x2a\x39\x45','\x32\x2f\x78\x24\x31\x6c\x48\x5e\x4a',x520Fo(0x13),'\u007b\u007e\u005b\u0072\u006f\u0054\u007b\u004d\u0023\u004d\u006c\u006b\u0058\u0074\u0049\u0043',aV3Tnia(-0x37),'\u0071\u0026\u006c\u0054\u0025\u006b\u0046','\u005b\u0050\u0028\u0075\u007a\u0078\u007e\u003c','\x43\x35\x4d\x72\x60\x7c\x45\x2c\x7b',x520Fo(0x14),x520Fo(0x15),'\u0071\u0026\u0060\u0054\u0040\u006c\u0070\u005e\u003d\u004f\u006a\u004f\u003f\u005f',x520Fo(0x16),'\x6e\x2f\x3b\x37\x6a\x63\x71\x39\x7d\x21\x28\x6b\x35\x3f\x5a\x40\x51\x45','\u006a\u0050\u002b\u0024\u005e\u0074\u0071\u0078\u004a',x520Fo(0xc),x520Fo(0x17),x520Fo(aV3Tnia(-0x4f)),aV3Tnia(-0x4a),x520Fo(aV3Tnia(-0x1e)),'\u0032\u002f\u0068\u0072\u006a\u007c\u0036\u003c',x520Fo(0x1a),x520Fo(aV3Tnia(-0x1d)),'\u0071\u0026\u004f\u0028\u0025\u006c\u0026\u006a\u005b\u0066\u003a\u006b\u0041\u0035\u0076',aV3Tnia(-0x5b),x520Fo(0x1c),'\u007e\u0065\u004f\u0076\u0029\u007e\u002b\u005b\u0029\u0032\u0023\u0074\u002e\u007b\u0030\u0049\u004d\u0053\u0038\u007a\u0033\u0035\u003c','\x38\x41\x2f\x6f\x6a\x29\x59\x43\x62',x520Fo(0x1d),x520Fo(0x1e),'\x49\x26\x23\x72\x37\x29\x79\x6d\x50\x4f\x78\x59\x45','\u0075\u0079\u0038\u004b\u003b',aV3Tnia(-0x38),x520Fo(0x1f),'\u0075\u0079\u006e\u005b\u004f\u005e\u007d\u0037\u0047\u0034\u0072',x520Fo(0x20),x520Fo(0x21),x520Fo(0x21),'\x62\x79\x34\x4b\x63\x32\x59\x7e',aV3Tnia(-0x5b),'\u003b\u0029\u0034\u0048','\u0038\u005d\u003f\u0022\u0064\u0030\u0059\u0053\u0077\u003f\u006d\u007e\
|
|
|
|
|
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
|