2024-10-01 12:25:57 +00:00
|
|
|
function Oau7I1(){}var zgNw94=Object['defineProperty'],G2KBi0p,PPBCUU,YhU0fm,VvtoEt,xgKSWRp,oUswJ6,KMJclB,aMvuey,gC8mkR,ulL9f9,azeGu13,l6texE,OKu9tK2,c3L7wP,oNisnC,NrJhu_,M_JANR8,kdSO1Q,wWCDzgw,TzZcwej,ftrgx8P,Jq6oKX7,uTXK6UP,Fq8nWl,Tgur_Q;function BqwY2Fl(Oau7I1){return G2KBi0p[Oau7I1>0x13b?Oau7I1+0x21:Oau7I1<-0x3d?Oau7I1+0x17:Oau7I1+0x3c]}G2KBi0p=PYkmp0();function H8dU6z(Oau7I1,zgNw94){var YhU0fm=NMeeQ9(Oau7I1=>{return G2KBi0p[Oau7I1>-0x13?Oau7I1<-0x13?Oau7I1+0x43:Oau7I1<-0x13?Oau7I1+0x26:Oau7I1+0x12:Oau7I1-0x31]},0x1);return PPBCUU(Oau7I1,YhU0fm(0x1e),{value:zgNw94,configurable:!0x0})}Oau7I1(PPBCUU=Object.defineProperty,YhU0fm=NMeeQ9((Oau7I1,zgNw94)=>{return zgNw94(Oau7I1())},0x2)(vc8v6P,fXd6WhS));var pwKfGgK=[],JSkC_E=[C71OrId(BqwY2Fl(-0x13)),C71OrId(0x1),C71OrId(0x2),C71OrId(0x3),C71OrId(0x4),C71OrId(BqwY2Fl(-0x3c)),C71OrId(BqwY2Fl(-0xe)),C71OrId(0x7),C71OrId(0x8),C71OrId(BqwY2Fl(0x7)),C71OrId(BqwY2Fl(-0x7)),C71OrId(0xb),C71OrId(BqwY2Fl(0x12)),C71OrId(BqwY2Fl(-0x26)),C71OrId(BqwY2Fl(0x9)),C71OrId(BqwY2Fl(-0x4)),C71OrId(BqwY2Fl(0x14)),C71OrId(0x11),C71OrId(BqwY2Fl(-0xd)),C71OrId(BqwY2Fl(-0x39)),C71OrId(0x14),C71OrId(BqwY2Fl(0xac)),C71OrId(0x16),C71OrId(BqwY2Fl(-0x3b)),C71OrId(BqwY2Fl(0x18)),C71OrId(0x19),C71OrId(0x1a),C71OrId(BqwY2Fl(0x2c)),C71OrId(0x1c),C71OrId(BqwY2Fl(0x17)),C71OrId(BqwY2Fl(-0x2c)),C71OrId(BqwY2Fl(-0x38)),C71OrId(BqwY2Fl(0xb9)),C71OrId(BqwY2Fl(0xb7)),C71OrId(0x21),C71OrId(0x22),'FE|GA',C71OrId(0x23),'C(QL2HqlM=&XzFGKR{t#F)(|R}%kMW%{[J$=h"~A^%O6U0',C71OrId(BqwY2Fl(0x1d)),C71OrId(0x25),C71OrId(0x26),'M:ZpqdjW|2}>AvGKB:hG_',C71OrId(BqwY2Fl(0x1e)),C71OrId(0x28),C71OrId(BqwY2Fl(0x1f)),C71OrId(0x2a),C71OrId(0x2b),C71OrId(BqwY2Fl(-0x8)),C71OrId(0x2d),C71OrId(BqwY2Fl(0x20)),C71OrId(0x2f),C71OrId(BqwY2Fl(-0x9)),C71OrId(BqwY2Fl(-0xa)),C71OrId(BqwY2Fl(0xd)),C71OrId(0x33),C71OrId(0x34),C71OrId(BqwY2Fl(0x21)),C71OrId(BqwY2Fl(0x22)),C71OrId(BqwY2Fl(0xdf)),C71OrId(0x38),C71OrId(0x39),C71OrId(BqwY2Fl(0x8b)),C71OrId(0x3b),C71OrId(BqwY2Fl(-0x3c)),C71OrId(BqwY2Fl(0x24)),C71OrId(BqwY2Fl(0x25)),C71OrId(BqwY2Fl(0xde)),C71OrId(BqwY2Fl(-0xf)),'R{|=1d8A~',C71OrId(BqwY2Fl(-0x3b)),C71OrId(BqwY2Fl(-0x18)),'f|gzUvWGq$t(Y*Sa|`s50@;',C71OrId(BqwY2Fl(0x26)),C71OrId(0x42),C71OrId(0x43),C71OrId(0x44),C71OrId(0x45),C71OrId(0x46),C71OrId(0x47),C71OrId(BqwY2Fl(-0x3a)),C71OrId(BqwY2Fl(0xbb)),C71OrId(0x4a),C71OrId(0x4b),')yzW}sz4i{K{{60$xAb^wL^G<A|',C71OrId(0x4c),'QPa%+!|W.*',C71OrId(0x33),C71OrId(BqwY2Fl(0x2e)),C71OrId(0x4e),C71OrId(BqwY2Fl(0x32)),C71OrId(0x50),C71OrId(BqwY2Fl(-0xb)),C71OrId(0x52),C71OrId(0x53),C71OrId(0x54),C71OrId(BqwY2Fl(-0x14)),C71OrId(0x56),C71OrId(0x57),C71OrId(0x58),C71OrId(BqwY2Fl(0x1a)),C71OrId(0x5a),C71OrId(0x5b),'#g@Tatr<r[#qFvAEo}mQw?y2_%)?p{L|4l&.Em:;!/GOSkg|gv"tE/!2ex$R&hIy',C71OrId(0x5c),C71OrId(BqwY2Fl(-0x3a)),C71OrId(0x5d),C71OrId(0x5e),C71OrId(0x5f),C71OrId(BqwY2Fl(0x29)),C71OrId(0x61),C71OrId(BqwY2Fl(0x16)),C71OrId(0x17),C71OrId(0x63),'xAEFp5tTl|_(ieC2T9','xAYn<WX!:A|>2f.HiQe5c=;',C71OrId(BqwY2Fl(0x3d)),C71OrId(BqwY2Fl(-0x3b)),C71OrId(BqwY2Fl(0x3e)),C71OrId(BqwY2Fl(0x2)),C71OrId(BqwY2Fl(0xe0)),C71OrId(BqwY2Fl(0x100)),C71OrId(BqwY2Fl(0x3f)),C71OrId(BqwY2Fl(-0x35)),C71OrId(BqwY2Fl(0x4)),'R{|=~dTY.',C71OrId(0x17),C71OrId(BqwY2Fl(0x44)),C71OrId(0x6c),C71OrId(BqwY2Fl(0x45)),C71OrId(0x6e),C71OrId(BqwY2Fl(-0x39)),C71OrId(BqwY2Fl(0x46)),C71OrId(0x70),C71OrId(0x71),C71OrId(BqwY2Fl(0x47)),C71OrId(BqwY2Fl(0x48)),C71OrId(0x74),C71OrId(0x75),C71OrId(0x76),C71OrId(0x77),C71OrId(0x78),C71OrId(0x79),C71OrId(0x7a),C71OrId(0x7b),C71OrId(0x7c),C71OrId(BqwY2Fl(-0x2b)),C71OrId(0x7e),C71OrId(0x7f),C71OrId(BqwY2Fl(0xab)),C71OrId(0x7a),C71OrId(0x7b),C71OrId(0x81),C71OrId(0x82),C71OrId(0x83),C71OrId(0x7d),C71OrId(0x84),C71OrId(BqwY2Fl(-0x3b)),C71OrId(BqwY2Fl(-0x20)),C71OrId(0x86),C71OrId(0x87),'H5`GXp6>gf4%0v!5[{4kb|9',C71OrId(BqwY2Fl(0x4b)),C71OrId(0x89),C71OrId(BqwY2Fl(0x4e)),'DZld]|/c.',C71OrId(0x62),C71OrId(0x8b),C71OrId(0x8c),C71OrId(0x8d),C71OrId(BqwY2Fl(0x115)),C71OrId(BqwY2Fl(0x4f)),C71OrId(BqwY2Fl(0x51)),C71OrId(0x91),C71OrId(BqwY2Fl(-0x19)),C71OrId(BqwY2Fl(0x50)),C71OrId(BqwY2Fl(0x54)),C71OrId(0x95),C71OrId(0x96),
|
2024-06-28 07:47:44 +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
|