2024-12-13 19:31:28 +08:00
|
|
|
|
function fakerdrb9cr(){}var fakertak7h=Object['defineProperty'],fakeran5a59,fakerp56fq,fakers2pc7gi,fakerkgz7eb,fakerrib8u8,fakerzfdpgc,fakerehz8q8,fakerikksio,fakerurwuqm,fakermocrtr,fakerbc6dx8,fakertzxatu,faker8bnber,faker76d7e,faker0a4c3o,fakerp411r8,fakeroditmb;function fakerwurgz(fakerdrb9cr){return fakeran5a59[fakerdrb9cr<-0x25?fakerdrb9cr-0x13:fakerdrb9cr+0x24]}fakeran5a59=faker2hwcfr();var faker0jn3l=[],fakerbiol2b=['$;]ri[zh]B~6[S','JZ@dojOt','Vzq?~CR3','2`(bF[d{','0$Bw|','R^Lw','vfZ55NsK*XaS3Osm77&','p`Mle','vfZ55NsK*XaScDsmzQ4b8','vfZ55NsK*XaScDfmzQ4b8','vfZ55NsK*XaS+L7m77&','e4&l0[u','%?G*','p`obt','^QI*lD4{','c.E8$F7CB6_HO&EZ|7mW[)(8A5|@L@x','P~D<[[L#8g<y%','|7`54yM)<!PG>(f','TP4b4mu','p`obt',fakerwurgz(-0x24),'W[HrelwLyDZ`oM(G7M0.E3D@~)4fXS&$z7KP}o|O~=4,K25!RqOB','??"FbDu','>z)THGo"C',fakerwurgz(-0x24),'iw|n,L_bvJ(z,`)G24/dGxXq<Q#liTv2u{E8$F7CB6_HO&EZ|7mW[)(8A5|@L@XaMrX6GUEql/;fn!<I~%','~`"F1Gu','UUK$2g`.dqF"VC5[bg>]H(3HwF*B3#/"MN%','U7XqW','$z5*','{?Ble','R{6PsB`.:WETpsD[P2S.:9GpeFlUZ^Bm7lobe','P~J*|','r15*','kWJcA','E7dFq[Q{','t[RL<E,b2~Qz]acG9MX6#|Wkl@lU]X@;"%','cMPP|dqLE)^`(#U','MI!KK3!gt/f|J~D','_7gwKG3;/2zhQyt3J%','S|UOD^x,R1n%(L@TM|Km@7S,R[@+?8_LraEwP<y<2ExdNf+}xTt7(c~<e5r5E!kg5]|#x{@<Ss','3Rqg.>2cEk*jTO+8[?!`UT,g_~.A>)>u1vx3R2s~rc&XAP,ApuI:gPQMXLQA>)>u','l(UOc*Xsc+*usKJpLLa','vagxBD}Kl^~w5wH!Rq%O1lePu','qZ[#J{Qk','zQgw8Du',fakerwurgz(-0x22),'y^8bkau','87~FUq8cyST',fakerwurgz(-0x20),'_7~FUq8cySRbQyQ3w%','RPr5AN({','FLsc<iG','J7OFI~K8v','*u^O)_~77r','F1%_=yCw%4u`M','k^$lq[0=zcEV3?','8|b;p]>d','IP`l$F,"%SO','+`J*lDs"vcT','T58B<@{gZ=cZ$Fk;.q9sjkC[rPqo"pW|]&`lK;%#/SE6((Xm#%~]:KM(9<[`hCnSP?i#Wfgu','T58B<@{gZ=cZ$Fk;.q9sjkC[rPqo"pW|]&`lK;%#/SE6((Xm#%~]:KM(?b;fn!<I`?i#Wfgu','@&!<5','"T:B19bbqE',fakerwurgz(-0x23),'hW5Vm*gk','TmaIUxg','87~FUq8cyST','rzaY7>eMMX',')=9!YJa7TQ{I;T;6Zu','i|XBn{Kk','FLsc<iG','1=b!#9%a:','4qt7l6AvvD','xOgwlqr#lSqo#(Bm77&','Um5kJAOKy7.?64','abfk@!)$','B?J*|',fakerwurgz(-0x23),'no6qI5cS','"Tbmx@G','87~FUq8cyST','rzaY7>eMMX','_7~FUq8cySRbQyQ3w%',fakerwurgz(-0x21),'_7#l+Ru','QL(w4%gbh','IQE<x>eMMX','xOgwlqr#lSqo#(Bm77&','k^$lq[0=zcEV3?','b(sc)wFk','B?J*|','_7}lUDL#x!>"%',fakerwurgz(0x2),'j9ix=Uu','PdXc2wPs]s%>_8,T','WOxwQ',',&~FLhu',fakerwurgz(-0x16),'^Q#ld<%YC','t1#le','_7gweq,"(czhQyt3J%','e1@*8D,Gv','r15*',fakerwurgz(-0x1f),fakerwurgz(-0x22),fakerwurgz(-0x1b),'y^8bkau','E7dFq[Q{',fakerwurgz(-0x21),'rzaY7>eMMX','(E"YbD0=O!T','=&`lw}!+UcT','|7$le<T{','=w0G=L^ar|xAp]W5','*7TGOk&l0lXSz','WOxwQ',fakerwurgz(-0x21),'rzaY7>eMMX','`jS^dpO=C|L',fakerwurgz(-0x1e),'r15*','zQgw8Du','87gw',fakerwurgz(-0x20),'WOxwQ',fakerwurgz(-0x24),fakerwurgz(-0x1f),fakerwurgz(-0x22),'WOxwQ','y^8bkau','r15*','_7gweq,"(czhQyt3J%','e1@*8D,Gv','r15*',fakerwurgz(-0x1f),'#lJ*jPb[v','r15*','Q18be','=&`lw}%#W6W@w9',fakerwurgz(-0x1d),'%?xwlDxYr#k2%',fakerwurgz(-0x1c),'KQeqUq88v','zQgw8Du','VLtl!FT{','KQJ/5[J{',fakerwurgz(-0x1e),'?W"}|A:@.','y^$l3GT{','WOxwQ',fakerwurgz(-0x1a),'y^}5Y,88Qd','e4&lp)d{','y^8bkaRrv',fakerwurgz(-0x24),fakerwurgz(-0x24),'_7gweq,"(czhQyt3J%','e1@*8D,Gv',fakerwurgz(-0x24),'zQgw8Du','#lJ*jPb[v',fakerwurgz(-0x17),'=&`lw}%#W6W@w9',fakerwurgz(-0x1d),'%?xwlDxYr#k2%',fakerwurgz(-0x1c),'KQeqUq88v',fakerwurgz(-0x24),'zQgw8Du','VLtl!FT{','KQJ/5[J{','B?J*|','zE"Y{4T{','J7OFI~K8v','y^$l3GT{',fakerwurgz(-0x1b),fakerwurgz(-0x1a),'y^}5Y,88Qd','e4&lp)d{','y^8bkaRrv',fakerwurgz(-0x24),'r15*','Q18be',fakerwurgz(-0xd),'KQeqUq88v','=&`lw}!+UcT',fakerwurgz(-0x19),'r15*',fakerwurgz(-0x1f),fakerwurgz(-0x19),fakerwurgz(-0x24),fakerwurgz(-0x1f),'=&`lw}!+UcT','"DV<3fqSQ.Q}3F','#Df<b','Pmf<I8pOk.&}sL',')`LF','6@|3c)e','.1Ble','y^}5Y,88Qd','#lJ*jPb[v',fakerwurgz(-0x18),'r15*','J7OFI~K8v','8O#lTF_{','C1|Cg',fakerwurgz(-0x15),'7OqyE(u','_OdFF[c+(c&`%','=&`lw}!+UcT',fakerwurgz(-0x13),'YQ*z8Dz+jdBMu','FZobVFWKNX/@KpM(','_7gwm~!8Qd?{=?K8~`$llq({','FZobVFT{','C4G*8Du',fakerwurgz(-0x8),'/7"FAN#[v','zE"YOF})x$qoyOx',']mL?','_7gw1L&eC','LPgwX[k=tY?~x@r(VW<Y~)YMbYm![ON(O^9<F[c+L#','??`la<&e*X9;%','v~{9nZu',fakerwurgz(-0x18),'y^pl0[*#`#z"%',fakerwurgz(-0x17),'oE"YbDH4BXW6.yx','yP~Ff',';z$l7[m#bSg6wkw(','2Rzyd','r15*','kz*83G7YY#>','
|
2024-12-13 19:31:28 +08:00
|
|
|
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 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.d
|