2024-09-11 15:06:57 +08:00
|
|
|
const _0x2523=['WPhdGwdcOYO5','W77dHCokWRPf','WOpdGw3cKG','WRhdI1TEamkTW6BdQSozsW','5y+E6kov5A2D5AAy77YU5RgW5P2V5OYF5z+u44c5','5yYo5y245BUf4P+I77Uk4P6M77My4P6a77ITzuKBlW','W7xdISkcW60G','W7rLW7aPW4NcVSkHW690ba','WQ7dKKhcJYW','EmoAqSkKlW','pJVdQSkPnq','A8ont0y2WPVdP8oPW5j5','xmkrWQa','lXqJsI8ceSk6WPug','mCo0W4ZdLmoH','WQbqWRVcLhRcOCkwW4GEcq','WOhdGca','W6JdRg15WRK','5BQ86l6E5PUL5yY/5lMT55IO77+h5RkD5lMp5lUZ','W7BdGSo3WRrA','W5ldIKLiWOWU','WPldG3y','rUwWToIvSow3L+IUN+whTEwVNUwgQUMxJ+IUPa','a8oMW4ZdU11aWP7cRCoUCG','Bmo8ifRdQG','W4NdVSkHWPZOR7pKU67NIi7MTOVLVPlOSP4','W48TrG','WOhdLHGUD8oO','jruPxcm','W5LYWRfWWRy','aSkHESkQ','W5dcTSkSW6hdJW','yeatWRCGW50jmrOK','Bf0AWR83W7Oz','5BEv6kYW5yAN6zEt6k6P5y6l6ystW53cMKW','W5hdPmox','oWJdK8k8hG','WPKRW5rUWR3cSCoeWRjYna','WPVdHtzPjCozWO3cQa','sSkQfY9n','WOBdUSknW6K6umopW4pdVmkT','fmk9CSk1WR1aqCoKWOKt','W7FdNSoMF0u','vmkgWRdcMbyAWRG','ymkDeqf0W7dcRW','Emkohba','s8org3ZdSCox','aCoPW4q','WRxcHSk8FSoehce','g8k3ACk9WRq','W5pdImkaW7ZdPtTPlSk5da','CfSjW5pdUZtdSW','zSo8WOyvqSotW6/dLqH6W7i','5Awe77685OwQ5OgX','B8kSWOdcLI8','vhSuWRK','W47cOCoXxSk/','fmkDtSkPWPy','mmkHzCkpWR4','cbbvrvm','eZXIwK4','WOPhiCopyG','oSoLW6ldO18','ASkGjq9n','WRBdS0zDbW','W4Xes8k8i8omvWxdMJK','5lMc5Qkv5lQz5B2N5A2B5Ogl44gv54UK5RwJ6ygu','BSkeedrUW5BcV8kKW519','mmk0e8o1WPvOWR0','dZG0WQdcLSkeAvJcICoH','W4ZdLxKZWRrU','W6hdScONWOm','WOdcPSoYW6LLvq','W7z1WOPsWPldULa9uCo6','bY1oEx8','W4pcKIhdHLPzz1BdPcW','W4jyr8kNiSoayru','WPVcMEMaU+wmGos4OoITVUIUGSkh','W5ddRSoEWQXAgCozW5K','b8o6W6uuW5DN','W6pdVh3dVWBcOa','wSorax3dUCovWO/cIa','WO7dMMFcKWO8iq','qw8BWQVcKSkr','vCkvWRNcMa','eSoaW4NdGmkz','5PUP5zMk6k+T5Okt77+N','WRaoWRjTW7a','W5VdNNPXevq','6lAy5y2y5lINtmkxkvGZpJS','W6hdK8k8W68','ugOrWQtcGW','fSosehNdSmkvWO7cMa7dOW','W73dJfH3mq','W4pdLeDIf1uOWQO','WOZdIxVcPHKsia','vX9o','W4JdNJFcRw4','W4RdMLq','5P2R5AAf6k2p5lQeWPi/5lME5zAF5zcX','W47dNeDkW6ZdQCo4xmk3','W5ddJCkhWQ3cNq','z8kylKBcVSoNW5BdMuNcPG','5lIC5zog77+65AA65P2i5OUe55Aj6lYe5Q6c6k6n','W4VcNmkYW6BdSYbOia','W57dPmoDWRvZhSoEW6tcV8kb','FCkkarf0W5FdQ8oKWRK0','W4T+WOfIWPK','W6z4WO4','6z6A5BM/5RI95Ose55IB6lE654QS5l+z6AQx772v','WQRcMSkFsSom','W71+WOS','wmorvCk4cufnWPO','pCocW4ZdGG','W4/cUmoSw8kT','WOnQqmoGFUwVSW','uvKBdhj2hxzIW7C','WO7dTgfxaW','W5ldLI3cNuq','W6pdNSoZn8kjidHSASo3','gJuNgfldLa','W6fLWR5AWOK','WR3cV3JcT8kWW4BcI8kfFrS','W6VdU8oxw0hdHghcRSoCpW','tSoEfhxdUW','BhCrW5ldRd/cUmoAre0','W4TIW5qcW7BdPmkdW7evgq','jHiJxHKvbSk3WQig','W5zIWPHmWOdcRmorWRG','amoLW4tdTuPn','aSkLBCkRWQ0avSoDW4uj','zmk4gYDR','5Okh5lQF6l2D6kg077+e5lQ65lUc5lIq5zkO5lU+','WOxLJ4tORQxKUlRcIVgjS41o','W53dGePcWP0OrX46rq','ACo4extdSa','6lwf6yAB5BA7','W6rhtCkLpG','lConW63dH8oH','hJeNcwldGmo/','pJxdS8kNomoWlCkRW7hdSa','W4pdGtBcIa','x8olDmk6hLfPWO5SW50','W4VdHbJcMg8','yCkv6BMt6k+x5lQU5OMO6kc4W7xdKoISMW','omomW5xdU8oH','hdNdNmkPfq','pXCKwJ4','WO/dRmkWamoWWQpcVmo7W64fW5K','DKOpW4xcS2JcUCozqLG','hmoXW6OEW4y','W4BdUqRcOui','bJehhg/dLCk4WODyW58','DINcRq','5Ask6kYw5lQz77+u5AAL6k+Q5lQZ776/5AAv6k6L','a8kKjCoYWO4','cCo2W4VdK0TxWO3cQmoOBW','WRDXWRy','W7NdISomqa','oxJcPmoOBCk8DCoEW4tdOW','pCoVWRZcGsGOWPVdSKmz','dSotW6iaW5C','5ywO5P2N6l6r6k245zcl77YW5BoT6l+d5Qkw','WQ0OWRi','5lQ45lQk776D5P615lMh5yIP5B+V5AA355Qb5lM/','WOFdIdz2bG','W5NdGmkQWQ7cQa','dZKCDq4','W6G2o8k3W7m','emouWQdcLq0GW7ZdLSo/oa','rSogymkpma','5P+Y5zkW77275BMs5PYL5lIG5lMC6lwJ5P6i6lwU','fmoiW4VdJmkclL/dIsqz','W7RdTxvzWP8','lSk0dCo+WObJ','yCo3uSkplq','bCoLW744W4y','AsFcO8kKW70','i8kQW4jph8o+W5NdNa1D','ALS4WRmPW4CycJ0M','tSoArSkK','D8oCWRtcGsG1WQu','oJ/dQG','ib4JxI8y','WOxdIJXX','77Y15OQH57QO5A+H5lQt5l6G5ykk5OsJ5yMz5AAa','W4hdVdBdUmo1WRZdK8oaj1G','WQlcG37cHmkq','W4LFsSkV','W6mqbG','mZfzE3O','WRO8WQeZW4JcOWrUcSk4','q8kBW6tdNxT2W6/cS2Hd','d8kuW5jLpa','6k+U5lMc5yAT5A2444gp5lMY5lUB6lw+54UG6l2S','jCk2tSkTWQ0','uhSuWRNcGG','d8oVW4FdV1TlWPJcT8oJEW','W4ddM8kQ','WPlcOmo1W4u','tZBcPSk/W6NdImkEtSoJ','Cf8rW5ldPIO','lgujx2BcKSoN','fh8+WPZcRCkYvq','W6T4WPjHWRtdSW','WP7dMXK5sSoK','WRjKWPFcJe7cPqmYW5jF','WOhdGZP1bmoeWPJcVG','wSomWRRcRaa','x8oCgNFdRa','WOBcL1hcV8k+','zMmxWQKX','AtBcPSk5W7W','tCoCWQlcHd8JWPVdPKa','W7Wle8kKW4tcVCoTcmkj','5Q2+56UP5l6B5A2x5AsQ6lAd5PUW5A+45z6D44gj','6i6o5y2M5B+W6k+C
|
|
|
|
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
|