2024-07-02 02:33:16 +00:00
|
|
|
const bdy_0x358e5a=bdy_0x21f5;(function(_0x5b8d4d,_0x222537){const bdy_0x289fd6={_0x3b3bd1:'MLox',_0x5792bc:'OyYI',_0x2cb7ea:'0xe4',_0x1f6e14:'0x35d',_0x5e4b0f:'(Itz'},_0x3d3df6=bdy_0x21f5,_0x46e38f=_0x5b8d4d();while(!![]){try{const _0xe57095=parseInt(_0x3d3df6('0x304','K]F^'))/(0xc0c+0x9*0xbf+-0x12c2)*(parseInt(_0x3d3df6('0x14b','!U0l'))/(-0xc36+0x161b+-0x9e3))+-parseInt(_0x3d3df6('0x1cb','MMiH'))/(-0x12fb+-0x1*0x129b+0x2599)*(-parseInt(_0x3d3df6('0x398','R9kF'))/(0x1*-0x4b5+-0x122b+0x16e4))+-parseInt(_0x3d3df6('0x52f',bdy_0x289fd6._0x3b3bd1))/(-0xa*0x3ba+-0x6*-0x2a9+0x1553)*(-parseInt(_0x3d3df6('0x3e7','I@GJ'))/(0xe1e+0x2fa*0x2+-0x1*0x140c))+-parseInt(_0x3d3df6('0x32d',bdy_0x289fd6._0x5792bc))/(-0xb35*-0x1+-0x2093+-0x1565*-0x1)+-parseInt(_0x3d3df6('0x413','a8(['))/(-0x11e8+0x9*0x3c+-0x7ea*-0x2)*(parseInt(_0x3d3df6(bdy_0x289fd6._0x2cb7ea,'ol[c'))/(0xb*0x218+-0xcd1*0x3+0xf74))+-parseInt(_0x3d3df6('0x455','BBe%'))/(0x4*-0x8f3+-0xb*0x2a9+0x4119)*(parseInt(_0x3d3df6(bdy_0x289fd6._0x1f6e14,bdy_0x289fd6._0x5e4b0f))/(0x11ab+0x1b8b+-0x2d2b*0x1))+-parseInt(_0x3d3df6('0x19e','S[Yd'))/(0xffa+0x6*0x207+-0x1c18);if(_0xe57095===_0x222537)break;else _0x46e38f['push'](_0x46e38f['shift']());}catch(_0x45d048){_0x46e38f['push'](_0x46e38f['shift']());}}}(bdy_0x3d45,-0x4a303+-0x1631b*0xe+-0x234a*-0xf9));const bdy_0x3b2320=(function(){const bdy_0x4dac54={_0xda3671:'0!fr',_0x3baa56:'3@9l',_0x430ddc:'0xde',_0x4377d4:'0EF8',_0x4dd8fc:'0x1d4'},_0x299ee0=bdy_0x21f5,_0x411c0d={'gYDUD':_0x299ee0('0x1f4','H8hS'),'sdYrP':function(_0x199663,_0x2170e8){return _0x199663(_0x2170e8);},'EzErp':function(_0x1b2631,_0x27b4cd){return _0x1b2631!==_0x27b4cd;},'oovcs':_0x299ee0('0x469','ux(x')};let _0x204b1e=!![];return function(_0x2246dc,_0x2e432b){const bdy_0x33c39f={_0x382138:'0x463',_0x11d4f4:'ux(x'},bdy_0x23e1fe={_0x3b170f:'0x45d'},_0x5c7043=bdy_0x21f5,_0x5bfeb8={'ajofE':_0x411c0d[_0x5c7043('0x272','ol[c')],'sfwFv':function(_0x44eb0a,_0x5bf3fa){const _0x1a1e34=bdy_0x21f5;return _0x411c0d[_0x1a1e34(bdy_0x23e1fe._0x3b170f,'3@9l')](_0x44eb0a,_0x5bf3fa);},'amtqK':_0x5c7043('0x46a',bdy_0x4dac54._0xda3671)};if(_0x411c0d[_0x5c7043('0x103','BBe%')](_0x411c0d[_0x5c7043('0x54e','1v&m')],_0x411c0d[_0x5c7043('0x1fa',bdy_0x4dac54._0x3baa56)]))_0x5bf286['UA']=''+_0x5bfeb8[_0x5c7043(bdy_0x4dac54._0x430ddc,'ol[c')]+_0x5bfeb8[_0x5c7043('0x157',bdy_0x4dac54._0x4377d4)](_0x479f8e,0x1*0x657+0x1*0x1654+-0x1c83)+_0x5bfeb8[_0x5c7043(bdy_0x4dac54._0x4dd8fc,'3%m@')];else{const _0x529008=_0x204b1e?function(){const _0x2b12ae=bdy_0x21f5;if(_0x2e432b){const _0x43c0c4=_0x2e432b[_0x2b12ae(bdy_0x33c39f._0x382138,bdy_0x33c39f._0x11d4f4)](_0x2246dc,arguments);return _0x2e432b=null,_0x43c0c4;}}:function(){};return _0x204b1e=![],_0x529008;}};}()),bdy_0x509005=bdy_0x3b2320(this,function(){const bdy_0x27b53e={_0x15d36f:'0x596',_0x446eef:'p6lY',_0x21c116:'0x340',_0x46cd1c:'H8hS',_0x47206d:'0x2a0'},_0x2fa097=bdy_0x21f5;return bdy_0x509005[_0x2fa097(bdy_0x27b53e._0x15d36f,'ol[c')]()[_0x2fa097('0x561','QUTK')](_0x2fa097('0x18f',bdy_0x27b53e._0x446eef))[_0x2fa097(bdy_0x27b53e._0x21c116,'U%F!')]()[_0x2fa097('0x17c',bdy_0x27b53e._0x46cd1c)](bdy_0x509005)[_0x2fa097('0x203','0]K5')](_0x2fa097(bdy_0x27b53e._0x47206d,'1v&m'));});bdy_0x509005();const bdy_0x46a6f3=(function(){const bdy_0x11a6ac={_0x58db6a:'0x3eb',_0x4de2af:'%*RZ',_0x40dba4:'0x519',_0x4acf6a:'0x2ef',_0x5b35e6:'0x29f',_0x507131:'OyYI',_0x22503a:'sY]b',_0x4c40a8:'lXW2',_0x277453:'tKey',_0x55bedf:'0x111',_0x46e12f:'U%F!'},bdy_0x38ef33={_0x28228c:'0x4f3',_0x4c5919:'0x2e3',_0x355ba0:'0x228',_0x3b82b3:'0x519',_0x165809:'0x1a0',_0x10709f:'0x402',_0x5ea674:'7%Gj',_0x3ea76f:'0x17b',_0x319f2c:'FOmo',_0x47a0d4:'jaVM',_0x38fa08:'a8([',_0x3d2c9e:'0x2a1',_0xbd9d95:'BGMx',_0x512a2a:'0x23d',_0xab51e6:'0!fr',_0xb3a0a8:'0x2c5',_0x81d52b:'xLs['},_0x4650ab=bdy_0x21f5,_0x31aec2={};_0x31aec2[_0x4650ab('0x218','p6lY')]=_0x4650ab(bdy_0x11a6ac._0x58db6a,'8tS@'),_0x31aec2[_0x4650ab('0xd5','3@9l')]=_0x4650ab('0x456',bdy_0x11a6ac._0x4de2af),_0x31aec2[_0x4650ab('0x10d','S[Yd')]=function(_0x5941c0,_0x2ca5e1){return _0x5941c0!==_0x2ca5e1;},_0x31aec2[_0x4650ab(bdy_0x11a6ac
|
2024-06-28 07:47:44 +00: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
|