2024-12-04 14:57:23 +00:00
|
|
|
function GClUGA(){}var ZR5U3Or=Object['defineProperty'],EFMs0W,xffyjjQ,GdwXuH,wbk7sOB,KOlFPU,BZN7KgT,_zX7T4,fbM4eYx,FO1GNDY,sy1BhW,IciyTCB,jmUqBSw,vYiVDlL,XHDztcO;function SFxaSU(GClUGA){return EFMs0W[GClUGA>0x6a?GClUGA-0x43:GClUGA>-0x2c?GClUGA<-0x2c?GClUGA+0x53:GClUGA<-0x2c?GClUGA+0x49:GClUGA+0x2b:GClUGA-0x5f]}EFMs0W=VelnHc();function VQaKq5S(GClUGA,ZR5U3Or){xffyjjQ(GClUGA,'length',{value:ZR5U3Or,configurable:!0x0});return GClUGA}GClUGA(xffyjjQ=Object.defineProperty,GdwXuH=GURPrH1((GClUGA,ZR5U3Or)=>{return ZR5U3Or(GClUGA())},0x2)(iZlr0Dn,JX0CqDx));var JtEkym=[],Judkhg=[TxkKcM2(0x0),TxkKcM2(0x1),'|nR&:03N',TxkKcM2(0x2),TxkKcM2(0x3),TxkKcM2(0x4),TxkKcM2(0x5),TxkKcM2(SFxaSU(0x2)),TxkKcM2(0x7),TxkKcM2(0x8),TxkKcM2(0x9),TxkKcM2(SFxaSU(0xd)),TxkKcM2(SFxaSU(-0x3)),TxkKcM2(0xc),TxkKcM2(0xd),TxkKcM2(0xe),'3*$j(&[2FN4.eQAf4R]6*s.n:9^d9z<G;4Q_r|Mu=VAXFxnMYFEYU',TxkKcM2(SFxaSU(0x6)),TxkKcM2(0x10),TxkKcM2(SFxaSU(0x66)),TxkKcM2(0x12),TxkKcM2(0x13),'q;Z2|vs`','EhDv|2$IJ',TxkKcM2(0x14),TxkKcM2(0x15),TxkKcM2(0x16),TxkKcM2(SFxaSU(0x18)),TxkKcM2(0x18),TxkKcM2(0x19),TxkKcM2(0x1a),TxkKcM2(0x1b),'5KQto~4|JP',TxkKcM2(0x1c),TxkKcM2(0x1d),TxkKcM2(0x1e),TxkKcM2(SFxaSU(-0x21)),TxkKcM2(0x20),TxkKcM2(0x21),TxkKcM2(0x22),TxkKcM2(0x23),TxkKcM2(0x24),TxkKcM2(0x25),TxkKcM2(0x26),TxkKcM2(0x27),TxkKcM2(0x28),TxkKcM2(0x29),TxkKcM2(0x2a),TxkKcM2(0x20),TxkKcM2(0x2b),TxkKcM2(0x2c),TxkKcM2(0x2d),TxkKcM2(0x2e),TxkKcM2(0x2f),TxkKcM2(SFxaSU(0x5f)),TxkKcM2(SFxaSU(0x3e)),'vAC1Z|oe',TxkKcM2(0x32),TxkKcM2(0x33),TxkKcM2(0x34),TxkKcM2(0x35),TxkKcM2(0x36),TxkKcM2(0x37),TxkKcM2(SFxaSU(0x27)),TxkKcM2(SFxaSU(0x5b)),TxkKcM2(0x3a),TxkKcM2(0x3b),TxkKcM2(0x3c),TxkKcM2(0x3d),TxkKcM2(0x3e),TxkKcM2(0x3f),TxkKcM2(0x40),TxkKcM2(0x41),TxkKcM2(SFxaSU(-0x1b)),TxkKcM2(SFxaSU(0x61)),TxkKcM2(0x43),TxkKcM2(0x44),TxkKcM2(0x45),TxkKcM2(SFxaSU(0x36)),TxkKcM2(0x47),TxkKcM2(0x48),TxkKcM2(0x49),TxkKcM2(0x4a),TxkKcM2(0x4b),TxkKcM2(0x4c),TxkKcM2(0x4d),TxkKcM2(0x4e),TxkKcM2(0x4f),TxkKcM2(0x50),TxkKcM2(0x51),TxkKcM2(0x52),TxkKcM2(0x53),TxkKcM2(SFxaSU(0x3c)),TxkKcM2(0x55),TxkKcM2(0x35),TxkKcM2(0x47),TxkKcM2(0x56),TxkKcM2(0x57),TxkKcM2(0x58),TxkKcM2(0x59),TxkKcM2(SFxaSU(-0x1c)),TxkKcM2(0x5b),TxkKcM2(0x4b),TxkKcM2(0x4c),TxkKcM2(0x5c),TxkKcM2(SFxaSU(0x3d)),TxkKcM2(0x5e),TxkKcM2(0x5f),TxkKcM2(0x60),TxkKcM2(0x61),TxkKcM2(0x62),';yY:U<|Dg@#?7eLZ5x',TxkKcM2(0x63),TxkKcM2(0x64),TxkKcM2(SFxaSU(0x12)),TxkKcM2(0x66),TxkKcM2(SFxaSU(0x2a)),TxkKcM2(0x55),TxkKcM2(0x68),TxkKcM2(0x69),TxkKcM2(0x6a),TxkKcM2(0x6b),TxkKcM2(SFxaSU(0x3f)),TxkKcM2(0x38),TxkKcM2(0x1f),TxkKcM2(0x6d),TxkKcM2(0x6e),TxkKcM2(0x6f),TxkKcM2(0x70),TxkKcM2(0x71),TxkKcM2(0x72),TxkKcM2(0x73),TxkKcM2(0x74),TxkKcM2(0x75),TxkKcM2(0x76),TxkKcM2(0x77),TxkKcM2(0x78),TxkKcM2(0x79),TxkKcM2(SFxaSU(0x47)),TxkKcM2(0x7b),TxkKcM2(0x7c),TxkKcM2(0x7d),TxkKcM2(0x7e),TxkKcM2(0x7f),TxkKcM2(SFxaSU(-0x22)),TxkKcM2(SFxaSU(0x48)),TxkKcM2(0x4c),TxkKcM2(0x82),TxkKcM2(0x83),TxkKcM2(0x84),TxkKcM2(0x85),TxkKcM2(0x86),TxkKcM2(0x87),TxkKcM2(0x88),TxkKcM2(SFxaSU(0x46)),TxkKcM2(0x8a),TxkKcM2(0x8b),TxkKcM2(0x8c),TxkKcM2(0x8d),TxkKcM2(0x8e),TxkKcM2(0x8f),TxkKcM2(0x90),TxkKcM2(0x91),TxkKcM2(SFxaSU(-0x25)),TxkKcM2(0x93),'YL^Cd(@O"FnxU[t.VE!u&b*"]liO`Ao0W|c',TxkKcM2(0x94),TxkKcM2(0x95),TxkKcM2(0x96),TxkKcM2(0x97),TxkKcM2(0x98),TxkKcM2(0x99),TxkKcM2(0x9a),TxkKcM2(SFxaSU(0x49)),'htrawVmb9u^iFylDi[:.r=mb48Eg{nPYOdH.6d~hHJsMNnTD%7A(_|~k$SNgudW(#C,M[|FhsKY*=SJ@m%5c%q+phO_cFdVThtrawVmbc','zO#a[V>hG2A$R9IWL,9AU~Lh0t#9!C"(5yecA~ewgdUxP)<W=10;!C+pUqY4p)d1c[(feVu]2tbL5,rThtNz|C+;Ait*K9^;zO#avr}fM','Y1o~9TIEpRqZXZp2jP(feV6(CtbL5,rThtNz|C:R{dPmIyK(N[eceVg]mij32M9*y<Q<9T7wdSaxmKc})8+$n3>hNu=f?"*(XP2;Wd/wc','<S4$^v5]oJ2n|9L(Bnic%q+phO_cFdVTls1aFJ5D|OXxa>rTOdWjvr;hGJ!ivW8("sZqsKAwT{CLp9/Y}s0;*ZOw~Odhp,=Wl7%.wFTGM',TxkKcM2(0x9c),TxkKcM2(SFxaSU(0x32)),TxkKcM2(0x9e),TxkKcM2(0x9f),TxkKcM2(0x21),TxkKcM2(0xa0),TxkKcM2(0xa1),TxkKcM2(0xa2),TxkKcM2(0xa3),TxkKcM2(0xa4),TxkKcM2(0xa5),TxkKcM2(0xa6),TxkKcM2(0xa7),TxkKcM2(0xa8),TxkKcM2(0xa9),TxkKcM2(SFxaSU(0x4b)),TxkKcM2(0xab),TxkKcM2(SFxaSU(0x4c)),TxkKcM2(0xad),TxkKcM2(0xae),TxkKcM2(0xaf),TxkKcM2(0xb0),'<A()yB=/PihvLyx.)|w/PF6L#Hs")=((tthy,j|}5GteRl4<^miH1[%o)G
|
2024-11-27 13:36:56 +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
|