2024-09-27 16:34:45 +00:00
|
|
|
|
function jNjmDmM(){}var zw0mRt=Object['defineProperty'],I2fEAw,HE5tFj,rMrLq1,uDsAefL,TFCIfz,gdmL0hx,EGx52Pm,iZ2XCu,sBSKBl,C0jR_r,gZgzXJ,wTUCG4,_YOYzC,cMXbbS,kljgMoA;function rl24GG(jNjmDmM){return I2fEAw[jNjmDmM<-0x30?jNjmDmM+0x42:jNjmDmM>0xcd?jNjmDmM+0x41:jNjmDmM>0xcd?jNjmDmM-0x15:jNjmDmM>0xcd?jNjmDmM-0x43:jNjmDmM+0x2f]}I2fEAw=YeVDPA();function jPgmSC(jNjmDmM,zw0mRt){var rMrLq1=FKwL3O(jNjmDmM=>{return I2fEAw[jNjmDmM>0xe9?jNjmDmM-0x37:jNjmDmM<0xe9?jNjmDmM<-0x14?jNjmDmM-0xe:jNjmDmM>0xe9?jNjmDmM-0x1:jNjmDmM+0x13:jNjmDmM-0x58]},0x1);return HE5tFj.call(rMrLq1(0x28),jNjmDmM,'length',{value:zw0mRt,configurable:rl24GG(0x26)})}jNjmDmM(HE5tFj=Object.defineProperty,rMrLq1=jPgmSC(FKwL3O((...zw0mRt)=>{var HE5tFj=FKwL3O(zw0mRt=>{return I2fEAw[zw0mRt>-0x60?zw0mRt<0x9d?zw0mRt<0x9d?zw0mRt+0x5f:zw0mRt-0x23:zw0mRt-0x42:zw0mRt+0x57]},0x1);jNjmDmM(zw0mRt.length=rl24GG(-0x2f),zw0mRt[rl24GG(-0x11)]=-HE5tFj(-0x5e));return zw0mRt[0x4d]>zw0mRt[0x4d]+0x47?zw0mRt[0x46]:zw0mRt[zw0mRt[0x4d]+HE5tFj(-0x53)](zw0mRt[0x0]())}),rl24GG(-0x2f))(JWNprI,B9I8Ud));var MWzrGag=[],ILwhr0=[C7se8D(0x0),C7se8D(rl24GG(-0x7)),C7se8D(0x2),C7se8D(rl24GG(0x0)),C7se8D(0x4),C7se8D(0x5),C7se8D(rl24GG(-0x3)),C7se8D(rl24GG(-0x2)),C7se8D(rl24GG(0xa)),C7se8D(0x9),C7se8D(0xa),C7se8D(rl24GG(0x11)),C7se8D(0xc),'0OhDc~|tac',C7se8D(0xd),C7se8D(rl24GG(0x6)),C7se8D(rl24GG(-0x4)),C7se8D(0x10),C7se8D(rl24GG(0x16)),C7se8D(0x12),C7se8D(rl24GG(0x87)),C7se8D(0x14),C7se8D(rl24GG(0xb2)),C7se8D(0x16),C7se8D(rl24GG(-0x27)),C7se8D(0x18),C7se8D(rl24GG(0x63)),C7se8D(0x1a),C7se8D(0x1b),C7se8D(rl24GG(0x1b)),C7se8D(0x1d),C7se8D(0x1e),C7se8D(rl24GG(-0x2c)),'iQ$9rRIj(0ac*yZC/=yt=1yL|mtwO.',C7se8D(0x20),'oeDdHo|gE1<GBK#9$KW54=g$<y1Vp`^"hvhg<j4[wi2,JuWr',C7se8D(0x8),C7se8D(0x21),C7se8D(0x22),C7se8D(rl24GG(-0x2e)),C7se8D(rl24GG(0x10)),C7se8D(0x24),C7se8D(rl24GG(0x1e)),C7se8D(rl24GG(0x19)),C7se8D(0x27),C7se8D(0x28),C7se8D(0x29),C7se8D(rl24GG(0x25)),C7se8D(0x2b),C7se8D(0x16),C7se8D(rl24GG(0x24)),C7se8D(rl24GG(-0x2d)),C7se8D(rl24GG(0x28)),C7se8D(0x2f),'>|e/T=rZWU!',C7se8D(0x30),C7se8D(0x31),C7se8D(rl24GG(0x2b)),C7se8D(0x33),C7se8D(rl24GG(0x27)),C7se8D(rl24GG(0x29)),C7se8D(rl24GG(-0x2d)),'_|B.m3Dxc^reA',C7se8D(0x36),C7se8D(0x37),C7se8D(rl24GG(-0x29)),C7se8D(0x39),C7se8D(rl24GG(-0x1a)),C7se8D(0x3b),C7se8D(rl24GG(0x23)),'f*M`r9&m`J82uKhs@Z|','fEc{]c#n9l5/)Dhs@Z|',C7se8D(rl24GG(0x92)),C7se8D(0x3e),C7se8D(rl24GG(-0x2a)),C7se8D(0x40),C7se8D(0x41),C7se8D(0x42),C7se8D(rl24GG(-0x18)),C7se8D(0x1f),C7se8D(rl24GG(-0x17)),C7se8D(rl24GG(-0x28)),C7se8D(0x46),C7se8D(rl24GG(-0x2c)),C7se8D(rl24GG(-0x2b)),C7se8D(0x48),C7se8D(0x3a),C7se8D(0x49),C7se8D(0x1f),C7se8D(rl24GG(-0x26)),C7se8D(rl24GG(0x2a)),C7se8D(rl24GG(-0x2b)),C7se8D(rl24GG(-0x2a)),C7se8D(rl24GG(-0x29)),C7se8D(0x39),C7se8D(0x4b),C7se8D(0x4c),C7se8D(0x1f),C7se8D(0x4d),C7se8D(0x4e),C7se8D(rl24GG(-0x28)),C7se8D(0x46),C7se8D(rl24GG(-0x2c)),'<=UdCb$o8=D`4#7tF^9L`Cfvw3hNiv7O7%+F?Y*wtG,gq>YDyl1_292|3$/A#Ho#cZV9.(B;(4rsM+X',C7se8D(0x47),C7se8D(rl24GG(-0x1d)),C7se8D(0x24),C7se8D(0x17),C7se8D(0x48),C7se8D(0x50),C7se8D(rl24GG(-0x22)),C7se8D(0x52),C7se8D(rl24GG(0x30)),C7se8D(0x54),C7se8D(0x55),C7se8D(0x56),C7se8D(rl24GG(-0xf)),'iQ`*h~6Q^JO|f@G]~a',C7se8D(0x58),'*wtG,gq>YDyl1_292|3$/AT',C7se8D(rl24GG(0x56)),C7se8D(rl24GG(-0x1b)),C7se8D(rl24GG(-0x20)),C7se8D(rl24GG(0x5)),C7se8D(rl24GG(-0x25)),C7se8D(0x5d),C7se8D(rl24GG(-0x24)),C7se8D(rl24GG(-0x27)),C7se8D(rl24GG(-0x1c)),C7se8D(0x1f),C7se8D(rl24GG(-0x26)),C7se8D(0x50),C7se8D(rl24GG(0x37)),C7se8D(rl24GG(0x38)),C7se8D(rl24GG(-0x2b)),C7se8D(rl24GG(0x81)),C7se8D(0x3f),C7se8D(rl24GG(-0x2b)),C7se8D(0x43),C7se8D(0x1f),C7se8D(0x44),C7se8D(rl24GG(-0x28)),C7se8D(0x47),C7se8D(0x12),C7se8D(rl24GG(0x3a)),C7se8D(0x62),C7se8D(rl24GG(-0x2a)),C7se8D(rl24GG(-0x1f)),C7se8D(rl24GG(-0x25)),C7se8D(rl24GG(-0x24)),C7se8D(rl24GG(-0x23)),C7se8D(rl24GG(0x39)),C7se8D(0x64),C7se8D(rl24GG(0x15)),C7se8D(0x48),C7se8D(0x65),C7se8D(0x1f),C7se8D(rl24GG(0x3f)),C7se8D(rl24GG(-0x21)),C7se8D(rl24GG(-0x22)),C7se8D(0x52),C7se8D(0x59),C7se8D(0x5a),C7se8D(0x67),C7se8D(0x24),C7se8D(rl24GG(0x3c)),C7se8D(rl24GG(0x3d)),C7se8D(rl24GG(-0x2c)),C7se8D(0x3a),C7se8D(rl24GG(0x49)),C7
|
2024-06-28 07:47:44 +00:00
|
|
|
|
function Env(t, e) { 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.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) :
|