2024-11-28 07:30:07 +00:00
|
|
|
function mENAxj_(){}var FTAX6oy=Object['defineProperty'],ht79gxI,DJ1F4y,cdbjci,FZixwbi,o6BRzzZ,KIA_Hp,F0klWIQ,u3UKFT9,LtiXFW,U6crvY,E2mgPx,uW8N_o,xscLC4,rt2U9TF,HmYi3Wj;function AWfMPD(mENAxj_){return ht79gxI[mENAxj_<0x9f?mENAxj_<0x9f?mENAxj_<0x9?mENAxj_+0xe:mENAxj_<0x9f?mENAxj_-0xa:mENAxj_+0x45:mENAxj_-0x4b:mENAxj_-0x6]}ht79gxI=QEglFh2();function Iszb1t(mENAxj_,FTAX6oy){var cdbjci=niNT19(mENAxj_=>{return ht79gxI[mENAxj_<-0x65?mENAxj_+0x3d:mENAxj_<0x31?mENAxj_+0x64:mENAxj_+0x16]},0x1);DJ1F4y(mENAxj_,cdbjci(-0x4e),{value:FTAX6oy,configurable:!0x0});return mENAxj_}mENAxj_(DJ1F4y=Object.defineProperty,cdbjci=Iszb1t(niNT19((...FTAX6oy)=>{var DJ1F4y=niNT19(FTAX6oy=>{return ht79gxI[FTAX6oy<-0x5c?FTAX6oy+0x49:FTAX6oy<-0x5c?FTAX6oy-0x5b:FTAX6oy<-0x5c?FTAX6oy-0x18:FTAX6oy>0x3a?FTAX6oy+0x4d:FTAX6oy+0x5b]},0x1);mENAxj_(FTAX6oy.length=0x2,FTAX6oy[DJ1F4y(-0x5b)]=-0x86);if(FTAX6oy.afIP8r1>-AWfMPD(0x27)){return FTAX6oy[-0xd1]}else{var cdbjci=niNT19(FTAX6oy=>{return ht79gxI[FTAX6oy<0x9?FTAX6oy+0x51:FTAX6oy-0xa]},0x1);return FTAX6oy[cdbjci(0xb)](FTAX6oy[FTAX6oy[AWfMPD(0xa)]+0x86]())}}),AWfMPD(0xc))(omUCI3q,kgXQ3yn));var xTcp66=[],myXO2v=[SceBCW(0x0),SceBCW(AWfMPD(0xb)),'F|e%}:cM',SceBCW(AWfMPD(0xc)),SceBCW(0x3),SceBCW(0x4),SceBCW(0x5),SceBCW(0x6),SceBCW(0x7),SceBCW(0x8),SceBCW(0x9),SceBCW(0xa),SceBCW(0xb),SceBCW(0xc),SceBCW(AWfMPD(0x1c)),SceBCW(0xe),SceBCW(0xf),SceBCW(0xe),SceBCW(0xf),'7<Br8B(|L!N,bq7r){?1}E.',SceBCW(0x10),SceBCW(0x11),SceBCW(0x12),SceBCW(0x13),SceBCW(AWfMPD(0x1f)),SceBCW(AWfMPD(0x31)),SceBCW(0x16),SceBCW(0x17),SceBCW(0x18),SceBCW(AWfMPD(0x33)),SceBCW(0x1a),SceBCW(0x1b),SceBCW(0x1c),SceBCW(AWfMPD(0x5a)),SceBCW(0x1e),SceBCW(AWfMPD(0x2f)),SceBCW(0x20),']|vn',SceBCW(0x21),SceBCW(0x22),'||y2$LD.',SceBCW(AWfMPD(0xd)),SceBCW(0x24),'*Jft?7rE#{aN|t1F(tiY;%J_S?@W@b2gw[=','||p":,5.','/k@L|WeUK53#qT4',SceBCW(AWfMPD(0xe)),SceBCW(0x26),SceBCW(0x27),SceBCW(0x28),SceBCW(0x29),SceBCW(0x2a),SceBCW(0x2b),SceBCW(0x2c),SceBCW(0x2d),SceBCW(0x2e),SceBCW(0x2f),SceBCW(0x30),SceBCW(0x31),SceBCW(0x32),SceBCW(0x33),SceBCW(AWfMPD(0x53)),SceBCW(0x35),SceBCW(0x36),SceBCW(0x37),SceBCW(AWfMPD(0x30)),SceBCW(0x39),SceBCW(0x3a),'|:&Ux)99W?,',SceBCW(0x3b),SceBCW(0x3c),SceBCW(AWfMPD(0x68)),'m|!MMz%*',SceBCW(0x3e),SceBCW(0x3f),SceBCW(0x40),SceBCW(0x41),SceBCW(0x42),SceBCW(0x43),SceBCW(0x44),SceBCW(0x45),SceBCW(0x46),SceBCW(0x47),SceBCW(0x48),SceBCW(0x49),SceBCW(AWfMPD(0x9a)),SceBCW(0x4b),SceBCW(AWfMPD(0x96)),SceBCW(0x4d),'1iAju8%#g%R"#_m+)+_7F]kyT*CR+_^:ww~]w}Cq=Jp_/>F:@faONlgwSj)2A:cw$.,Fozrq,x)~UeFcV~E76;be]C!k=?*w*I/zLkRySx&*Q[j+ywW~Q+uu^m9LV1>lno)mGN9/%?W4IAXUPuSz|$5c}YvSGeeU7IAj$DuGC?@[Uus@o1v7q~&(zcu>;s<>&a<sxw;0I7iR[1;/&w91O~*CXcePGU2+spEnnB_b0C^|U;Eq`R(_19be]C!kR[uqU4cX4{Wu',SceBCW(0x4e),SceBCW(0x4f),SceBCW(0x50),SceBCW(AWfMPD(0x3a)),SceBCW(AWfMPD(0x1a)),SceBCW(0x53),SceBCW(0x54),SceBCW(0x55),SceBCW(0x56),SceBCW(0x57),SceBCW(0x58),SceBCW(0x59),SceBCW(0x5a),SceBCW(0x5b),SceBCW(0x5c),SceBCW(0x5d),SceBCW(0x5e),'_wlDZB||z?',SceBCW(0x5f),SceBCW(0x60),'"[|@"47VhkOx@5*',SceBCW(0x61),SceBCW(AWfMPD(0x15)),SceBCW(0x63),'t|&L4"1*',SceBCW(0x64),SceBCW(0x65),SceBCW(0x66),'~Z#OYIVEEj|ru',SceBCW(0x67),SceBCW(AWfMPD(0x22)),'U|kM]/R#u',SceBCW(0x69),SceBCW(0x6a),SceBCW(0x6b),SceBCW(0x6c),SceBCW(AWfMPD(0x3c)),SceBCW(0x6e),SceBCW(0x6f),SceBCW(0x70),SceBCW(0x71),SceBCW(0x72),SceBCW(0x73),SceBCW(0x74),SceBCW(AWfMPD(0x77)),SceBCW(0x76),SceBCW(0x77),SceBCW(0x78),SceBCW(0x79),SceBCW(0x7a),SceBCW(0x7b),SceBCW(0x7c),SceBCW(0x7d),'WF&L|W`','2|~,XY#su',SceBCW(0x7e),SceBCW(AWfMPD(0xf)),SceBCW(AWfMPD(0x13)),SceBCW(0x81),SceBCW(0x82),'K|BkWr1*',SceBCW(0x83),SceBCW(0x84),SceBCW(0x85),SceBCW(0x86),SceBCW(AWfMPD(0x3d)),SceBCW(AWfMPD(0x2e)),SceBCW(0x89),SceBCW(0x8a),'t|Z2;',SceBCW(0x8b),'||ZEvW`','*fZIWy<.Bj3xOo!:gJ?IlX.CC*<*"^Y4|4e',SceBCW(0x8c),'K|!P%0JZu',SceBCW(0x8d),SceBCW(0xe),SceBCW(0x8e),'zoMK4%|.',SceBCW(0x8f),SceBCW(0x90),SceBCW(0x91),SceBCW(0x92),SceBCW(0x93),SceBCW(0x94),SceBCW(0x95),SceBCW(0x96),SceBCW(AWfMPD(0x3f)),SceBCW(0x98),SceBCW(0x99),SceBCW(AWfMPD(0x86)),SceBCW(0x9b),SceBCW(0x9c),SceBCW(0x9d),SceBCW(AWfMPD(0x2a)),SceBCW(0x9f),SceBCW(0xa0),SceBCW(0xa1),SceBCW(0xa2)
|
2024-08-31 01:21:50 +00:00
|
|
|
function Env(o, t) { 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((r, i) => { s.call(this, t, (t, e, s) => { t ? i(t) : r(e) }) }) } 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.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", 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.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null, ...s) { try { return JSON.stringify(t, ...s) } catch { return e } } getjson(t, e) { let s = e; if (this.getdata(t)) 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(r => { this.get({ url: t }, (t, e, s) => r(s)) }) } runScript(a, o) { return new Promise(r => { let t = this.getdata("@chavy_boxjs_userCfgs.httpapi"); t = t && t.replace(/\n/g, "").trim(); var e = (e = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +e : 20, [s, i] = (e = o && o.timeout ? o.timeout : e, t.split("@")); this.post({ url: `http://${i}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: e }, headers: { "X-Key": s, Accept: "*/*" }, timeout: e }, (t, e, s) => r(s)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), r = !s && this.fs.existsSync(e); if (!s && !r) return {}; r = s ? t : e; try { return JSON.parse(this.fs.readFileSync(r)) } catch (t) { return {} } } writedata() { var t, e, s, r, i; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), r = !(s = this.fs.existsSync(t)) && this.fs.existsSync(e), i = JSON.stringify(this.data), !s && r ? this.fs.writeFileSync(e, i) : this.fs.writeFileSync(t, i)) } lodash_get(t, e, s) { let r = t; for (const t of e.replace(/\[(\d+)\]/g, ".$1").split(".")) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, r, e) { return Object(t) === t && ((r = Array.isArray(r) ? r : r.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((t, e, s) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(r[s + 1]) >> 0 == +r[s + 1] ? [] : {}, t)[r[r.length - 1]] = e), t } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { var [, s, r] = /^@(.*?)\.(.*?)$/.exec(t); if (s = s ? this.getval(s) : "") try { const t = JSON.parse(s); e = t ? this.lodash_get(t, r, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { var [, r, i] = /^@(.*?)\.(.*?)$/.exec(e), a = this.getval(r), a = r ? "null" === a ? null : a || "{}" : "{}"; tr
|