2024-01-27 12:44:37 +00:00
|
|
|
(function(_0x3e9a8c,_0x113eb6){const _0xa31c7b={_0x3985ba:'\x30\x78\x61\x64',_0x2d097d:'\x5b\x6f\x6c\x79',_0x5deb9e:'\x30\x78\x32\x30\x61',_0x4a6a2e:'\x23\x44\x40\x56',_0x110d62:'\x30\x78\x63\x36',_0x2d349f:'\x5d\x46\x35\x66',_0x7f0b43:'\x30\x78\x32\x31\x64',_0x4fe6d4:'\x67\x52\x39\x76',_0x15e8a1:'\x30\x78\x31\x37\x64',_0x416812:'\x26\x37\x6c\x76',_0x43de0e:'\x30\x78\x31\x66\x32',_0x4badaa:'\x30\x78\x31\x66\x38',_0x25ecdd:'\x2a\x75\x49\x23',_0x12f911:'\x30\x78\x31\x61\x32',_0x4238ca:'\x66\x77\x37\x78',_0x461528:'\x30\x78\x65\x34',_0x20fb5b:'\x4c\x42\x38\x26',_0x76ac9a:'\x30\x78\x31\x35\x35',_0x4169dd:'\x5d\x46\x35\x66',_0x1b2bcd:'\x30\x78\x31\x37\x66',_0x4e0bee:'\x5d\x76\x55\x5d'},_0x7a6932=_0x3e9a8c();while(!![]){try{const _0x3783bb=parseInt(_0x2f43(_0xa31c7b._0x3985ba,_0xa31c7b._0x2d097d))/(0x1833+0x10e4+-0x2916)*(parseInt(_0x2f43(_0xa31c7b._0x5deb9e,_0xa31c7b._0x4a6a2e))/(0x15a1*0x1+0x12cf+-0x286e))+parseInt(_0x2f43(_0xa31c7b._0x110d62,_0xa31c7b._0x2d349f))/(-0x1bce+0x2241+-0x1*0x670)+-parseInt(_0x2f43(_0xa31c7b._0x7f0b43,_0xa31c7b._0x4fe6d4))/(0x13d6*0x1+-0x4*-0x656+-0x2d2a)*(-parseInt(_0x2f43(_0xa31c7b._0x15e8a1,_0xa31c7b._0x416812))/(0x115*0x5+-0x13bc+-0x396*-0x4))+parseInt(_0x2f43(_0xa31c7b._0x43de0e,_0xa31c7b._0x2d097d))/(-0x1d*0xfb+0x1fef+-0x37a)*(-parseInt(_0x2f43(_0xa31c7b._0x4badaa,_0xa31c7b._0x25ecdd))/(0x1606*-0x1+0xac*0x12+0x9f5))+-parseInt(_0x2f43(_0xa31c7b._0x12f911,_0xa31c7b._0x4238ca))/(0x3d6+0x1*0x39e+-0x4*0x1db)+-parseInt(_0x2f43(_0xa31c7b._0x461528,_0xa31c7b._0x20fb5b))/(-0x10*-0x265+0x259c+-0x4be3)*(parseInt(_0x2f43(_0xa31c7b._0x76ac9a,_0xa31c7b._0x4169dd))/(-0x119*-0x15+0x32*-0x2f+-0x1*0xdd5))+-parseInt(_0x2f43(_0xa31c7b._0x1b2bcd,_0xa31c7b._0x4e0bee))/(-0x2*0xe71+-0x22f+0x1f1c);if(_0x3783bb===_0x113eb6)break;else _0x7a6932['push'](_0x7a6932['shift']());}catch(_0x5cddb2){_0x7a6932['push'](_0x7a6932['shift']());}}}(_0x55c1,0x6*-0x40fdd+0x1*-0x677c9+0x2d9eac));function _0x2f43(_0x1e67c2,_0x481d93){const _0x29ff30=_0x55c1();return _0x2f43=function(_0x214c4d,_0x184d38){_0x214c4d=_0x214c4d-(-0x12ce+0xd4b*0x1+0x601*0x1);let _0x383c30=_0x29ff30[_0x214c4d];if(_0x2f43['\x57\x43\x4b\x50\x4e\x4c']===undefined){var _0x3ab893=function(_0x201bfc){const _0x301221='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x14d5ff='',_0x33442d='',_0x59ae96=_0x14d5ff+_0x3ab893;for(let _0x2852e1=-0x1b48+0x1f31+-0xb*0x5b,_0x5cf00f,_0x3d393a,_0x2c4b3b=-0x1*-0x1e7d+0x24df+-0x435c;_0x3d393a=_0x201bfc['\x63\x68\x61\x72\x41\x74'](_0x2c4b3b++);~_0x3d393a&&(_0x5cf00f=_0x2852e1%(-0x1862+0xe9*0x19+0x1a5)?_0x5cf00f*(-0x15db+-0x1d32*0x1+0x334d)+_0x3d393a:_0x3d393a,_0x2852e1++%(-0x1*-0x10ed+0xebb*-0x1+0x117*-0x2))?_0x14d5ff+=_0x59ae96['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x2c4b3b+(0x207b*-0x1+-0x1cb+0x2250))-(0x52f+-0x14f5+0x2e*0x58)!==0x4f2+0x1*-0x268c+0x219a?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x21a0+-0x1bca+0x7*-0xb1&_0x5cf00f>>(-(-0x151b+-0x24*-0x90+0xdd)*_0x2852e1&0x61*0x39+0x43b*0x1+-0x19ce)):_0x2852e1:0x6b*-0x3d+-0xe9f+0x281e){_0x3d393a=_0x301221['\x69\x6e\x64\x65\x78\x4f\x66'](_0x3d393a);}for(let _0x121996=-0x21a0+-0x267*0x6+-0x22f*-0x16,_0x528595=_0x14d5ff['\x6c\x65\x6e\x67\x74\x68'];_0x121996<_0x528595;_0x121996++){_0x33442d+='\x25'+('\x30\x30'+_0x14d5ff['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x121996)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x157+0x23b4+-0x1*0x24fb))['\x73\x6c\x69\x63\x65'](-(-0x15ec+0x11*0x1b4+0x1f*-0x3a));}return decodeURIComponent(_0x33442d);};const _0x19ff28=function(_0x43e65d,_0x145a8b){let _0x2cfc58=[],_0x447fe7=-0x1ca3+0x4*0x54+0x1*0x1b53,_0x23d102,_0x61f94a='';_0x43e65d=_0x3ab893(_0x43e65d);let _0x27ffe9;for(_0x27ffe9=-0x3*0x32+-0x1ef5+0x5f*0x55;_0x27ffe9<0xa9*-0x1f+0x1070+-0x507*-0x1;_0x27ffe9++){_0x2cfc58[_0x27ffe9]=_0x27ffe9;}for(_0x27ffe9=0x1535*0x1+0x257b+-0x3ab0;_0x27ffe9<-0x83*-0x1e+-0x1bcf+0xd75;_0x27ffe9++){_0x447fe7=(_0x447fe7+_0x2cfc58[_0x27ff
|
2024-01-27 11:40:17 +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
|