2024-11-26 05:33:28 +00:00
|
|
|
function IYnjg7a(){}var vaP3tE=Object['defineProperty'],HXV58y,ke_t6rD,pl2g78,xlWJ5Pf,w0T3cf,tXT2s9c,xJ2rdT,TLIo2M,wv8H7GH,Wml7cB,KkTcbH,CzHtj6,ip8UV0I,tVUcPRU,FuxUui,bAP8Ptr;function Saj5KRn(IYnjg7a){return HXV58y[IYnjg7a>0x6d?IYnjg7a-0xb:IYnjg7a<0x6d?IYnjg7a<0x6d?IYnjg7a-0x1:IYnjg7a+0x60:IYnjg7a-0x55]}HXV58y=srlDmJJ();function sbpc02(IYnjg7a,vaP3tE){var pl2g78=f5GhVRD(IYnjg7a=>{return HXV58y[IYnjg7a<0x45?IYnjg7a-0x4a:IYnjg7a>0xb2?IYnjg7a+0x4e:IYnjg7a<0xb2?IYnjg7a-0x46:IYnjg7a-0x14]},0x1);ke_t6rD(IYnjg7a,pl2g78(0x4e),{value:vaP3tE,configurable:!0x0});return IYnjg7a}IYnjg7a(ke_t6rD=Object.defineProperty,pl2g78=f5GhVRD((IYnjg7a,vaP3tE)=>{return vaP3tE(IYnjg7a())},0x2)(syyj59j,pnKNjw));var VKbMmr6=[],pUQtTD=[AYpb2M(0x0),AYpb2M(Saj5KRn(0xb)),AYpb2M(0x2),AYpb2M(0x3),AYpb2M(0x4),'asQ|',AYpb2M(0x5),AYpb2M(0x6),AYpb2M(Saj5KRn(0x2a)),AYpb2M(Saj5KRn(0x16)),'vZO|',AYpb2M(Saj5KRn(0x18)),'|n%R22h','ly&|L',AYpb2M(0xa),AYpb2M(Saj5KRn(0x1c)),AYpb2M(0xc),AYpb2M(0xd),AYpb2M(Saj5KRn(0x14)),AYpb2M(0xf),AYpb2M(0x6),'vZO|','|n%R22h',Saj5KRn(0x1),'|n%R22h',Saj5KRn(0x1),AYpb2M(Saj5KRn(0x31)),'vZO|',AYpb2M(0x10),AYpb2M(0x11),AYpb2M(0x12),AYpb2M(0x13),AYpb2M(0x14),'t^+|',AYpb2M(0x15),AYpb2M(0x16),AYpb2M(0x17),AYpb2M(0x18),AYpb2M(0x19),AYpb2M(0x1a),AYpb2M(0x1b),AYpb2M(0x1c),AYpb2M(0xa),'vZO|aJ}W#',AYpb2M(0x1d),AYpb2M(0x1e),AYpb2M(0x1f),AYpb2M(0x20),AYpb2M(0x21),AYpb2M(0x22),AYpb2M(0x23),AYpb2M(Saj5KRn(0x6)),AYpb2M(0x25),AYpb2M(0x26),AYpb2M(0x27),AYpb2M(0x28),AYpb2M(0x29),AYpb2M(0x2a),'QYO|V2gpG',AYpb2M(Saj5KRn(0x21)),AYpb2M(0x2c),AYpb2M(0x2d),AYpb2M(0x2e),AYpb2M(0x2f),AYpb2M(0x30),AYpb2M(0x31),AYpb2M(0xa),AYpb2M(0x32),AYpb2M(0x33),AYpb2M(0x34),AYpb2M(0x35),AYpb2M(0x36),'3"mM|tW',AYpb2M(0x37),AYpb2M(0x38),AYpb2M(0x39),AYpb2M(0x3a),AYpb2M(0x3b),AYpb2M(0x3c),AYpb2M(0x3d),AYpb2M(0x3e),AYpb2M(0x3f),AYpb2M(0x40),AYpb2M(Saj5KRn(0x4b)),AYpb2M(0x42),AYpb2M(0x43),AYpb2M(0x44),AYpb2M(0x45),AYpb2M(0x46),'B}`z!XlKL3@2<I9j@8WD}m2Fst"xt7P|N@Ig:?/EpO9#L~F/yL;yV',AYpb2M(Saj5KRn(0x22)),AYpb2M(0x48),AYpb2M(0x49),AYpb2M(0x4a),AYpb2M(0x4b),AYpb2M(0x4c),'^x&|L',AYpb2M(0x4d),AYpb2M(0x33),AYpb2M(0xa),AYpb2M(0x4e),AYpb2M(0x4f),'(x&|LNvG',AYpb2M(0xa),AYpb2M(0x50),AYpb2M(0x51),AYpb2M(0x52),AYpb2M(0x53),AYpb2M(0x54),AYpb2M(0x55),AYpb2M(0x56),AYpb2M(0x57),AYpb2M(0x58),AYpb2M(0x59),AYpb2M(0xa),AYpb2M(0x5a),AYpb2M(0x5b),AYpb2M(0x34),AYpb2M(0x5c),AYpb2M(0x5d),AYpb2M(0x5e),AYpb2M(0x5f),AYpb2M(Saj5KRn(0x2b)),AYpb2M(0x61),AYpb2M(0x62),AYpb2M(0x63),AYpb2M(0x64),AYpb2M(0x65),AYpb2M(0x66),AYpb2M(0x67),'E%|kW;K9',AYpb2M(0x68),AYpb2M(0x69),AYpb2M(0x6a),AYpb2M(0x6b),AYpb2M(0xa),AYpb2M(0x6c),AYpb2M(0x6d),'cyO|wN&+tA$nM1qcmH',AYpb2M(0x6e),AYpb2M(0x3e),AYpb2M(0x6f),AYpb2M(0x70),AYpb2M(0x6f),AYpb2M(Saj5KRn(0x55)),AYpb2M(0xa),AYpb2M(0x71),AYpb2M(0x3c),'ly&|L',AYpb2M(0x72),AYpb2M(0x73),AYpb2M(0x74),AYpb2M(0x75),AYpb2M(0x76),AYpb2M(0x77),AYpb2M(0x78),AYpb2M(0x79),AYpb2M(Saj5KRn(0x3)),AYpb2M(0x7b),AYpb2M(0x7c),AYpb2M(Saj5KRn(0x2e)),AYpb2M(Saj5KRn(0x5)),AYpb2M(0x52),AYpb2M(0x53),AYpb2M(0x7e),AYpb2M(Saj5KRn(0x7)),AYpb2M(0x80),AYpb2M(0x81),AYpb2M(0x82),AYpb2M(0x83),AYpb2M(0x84),AYpb2M(0x85),AYpb2M(0x86),AYpb2M(0x87),AYpb2M(0x60),AYpb2M(0x54),AYpb2M(0x88),AYpb2M(0x89),AYpb2M(0x8a),AYpb2M(Saj5KRn(0x4)),AYpb2M(0x8b),AYpb2M(0x8c),AYpb2M(0x8d),AYpb2M(0x8e),AYpb2M(0x8f),AYpb2M(Saj5KRn(0x2)),AYpb2M(0x91),AYpb2M(0x92),AYpb2M(0x93),AYpb2M(0x94),'Qya|',AYpb2M(0x95),AYpb2M(0x96),AYpb2M(0x97),AYpb2M(0x98),AYpb2M(Saj5KRn(0x37)),AYpb2M(0x9a),AYpb2M(Saj5KRn(0x2)),AYpb2M(0x9b),AYpb2M(0x9c),AYpb2M(Saj5KRn(0x36)),AYpb2M(0x9e),AYpb2M(0x9f),AYpb2M(0xa),AYpb2M(0xa0),'cyO|wN&+tA$nM1qcmH',AYpb2M(0x61),'cyO|wNnG',AYpb2M(0xa1),AYpb2M(0xa),AYpb2M(Saj5KRn(0x3)),AYpb2M(0x4d),AYpb2M(0x61),AYpb2M(0xa),AYpb2M(0xa2),AYpb2M(0x4c),'^x&|L',AYpb2M(Saj5KRn(0x38)),AYpb2M(0xa),AYpb2M(0xa),AYpb2M(0xa2),'/n&|Xty/36+',AYpb2M(0x61),AYpb2M(0xa4),AYpb2M(0xa5),AYpb2M(0xa),AYpb2M(0xa6),AYpb2M(0xa7),AYpb2M(0xa),AYpb2M(Saj5KRn(0x4)),AYpb2M(0xa2),AYpb2M(0xa8),AYpb2M(Saj5KRn(0x5)),AYpb2M(0xa9),AYpb2M(0xaa),AYpb2M(0xab),'8xO|/diG',AYpb2M(0xac),AYpb2M(Saj5KRn(0x4)),AYpb2M(0xad),AYpb2M(0xae),AYpb2M(0xaf),AYpb2M(Saj5KRn(0x3b)),'|.bE*2@Xq',AYpb2M(0xb1
|
2024-09-30 12:28:14 +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
|