mirror of
https://github.com/6dylan6/jdpro.git
synced 2026-11-06 18:50:24 +08:00
1
This commit is contained in:
1 parent
95e1c7cbe6
commit
d74b7853cb
1 file changed
+3
-3
+3
-3
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
45 0,6 * * * jd_dygetbeans_.js
|
||||
35 0,7 * * * jd_dygetbeans_.js
|
||||
*/
|
||||
|
||||
const $ = new Env('每日抽豆');
|
||||
const bdy_0x4e51ab=bdy_0x201b;(function(_0x282449,_0x5d4163){const bdy_0x4ec049={_0x2cb625:'0x19f',_0xa88774:']fkw',_0x1d4c4f:'0x275',_0x398ff6:'bQ5%',_0x13674e:'0x4ab',_0x513581:'n6@L',_0x5b535b:'0x35c',_0x261dbf:'pO^8',_0x226607:'0x368',_0x3f64ab:']fkw',_0x3fe2bb:'0x264',_0x3982c1:'PLc^',_0x2bf9d1:'0x2c7',_0x91e499:'MWBn',_0x26eadc:'0x2ba',_0x40e74d:'%](X',_0x6d2905:'0x3d6',_0x24737d:'6oUZ'},_0x25200f=bdy_0x201b,_0x10306a=_0x282449();while(!![]){try{const _0x5d8fb9=parseInt(_0x25200f(bdy_0x4ec049._0x2cb625,bdy_0x4ec049._0xa88774))/(-0x194e+-0x8a*0xe+0x20db)+parseInt(_0x25200f(bdy_0x4ec049._0x1d4c4f,bdy_0x4ec049._0x398ff6))/(-0x41c*0x4+0x19a5+-0x933)+-parseInt(_0x25200f(bdy_0x4ec049._0x13674e,bdy_0x4ec049._0x513581))/(-0x1809+-0x266a+-0x5*-0xc7e)*(parseInt(_0x25200f(bdy_0x4ec049._0x5b535b,bdy_0x4ec049._0x261dbf))/(0x1*-0xf1+0xeab+-0xdb6))+parseInt(_0x25200f(bdy_0x4ec049._0x226607,bdy_0x4ec049._0x3f64ab))/(-0x1*-0x1597+0x199+-0x3*0x7b9)+parseInt(_0x25200f(bdy_0x4ec049._0x3fe2bb,bdy_0x4ec049._0x3982c1))/(0x8d*-0x1+-0x14cb*-0x1+-0x1438)+parseInt(_0x25200f(bdy_0x4ec049._0x2bf9d1,bdy_0x4ec049._0x91e499))/(-0x21c6+-0x317+-0x6*-0x626)+-parseInt(_0x25200f(bdy_0x4ec049._0x26eadc,bdy_0x4ec049._0x40e74d))/(-0x1*0x5f9+0x62*0x1c+-0x4b7)*(parseInt(_0x25200f(bdy_0x4ec049._0x6d2905,bdy_0x4ec049._0x24737d))/(0x8*-0x2d4+0x15*0x136+-0x2c5*0x1));if(_0x5d8fb9===_0x5d4163)break;else _0x10306a['push'](_0x10306a['shift']());}catch(_0x751c64){_0x10306a['push'](_0x10306a['shift']());}}}(bdy_0x17d2,-0x1*0x1936c+0x3a0d0+-0x28f*-0x49));const bdy_0x6a7a8f=(function(){const bdy_0x2ef4d4={_0x3650b5:'0x3b4',_0x2eddfd:']fkw',_0x2df460:'0x30f',_0x16f0c8:'ACS^',_0x368d26:'0x43f',_0x340aaf:'MWBn',_0x56d5d2:'0x1fd',_0xc11a60:'AwKJ',_0x447d1b:'0x2fc',_0x5d368e:'az7^',_0x58e5c2:'0x4b2',_0x8319b5:']fkw',_0x44e6da:'0x197',_0x268611:'*#]W',_0x32c896:'0x1d6',_0x44febf:'Kwr8'},bdy_0x4ed78c={_0x45ab7c:'0x2f5',_0x53918d:'YcHk',_0x3cdf30:'0x1af',_0x17c3a0:'Kwr8',_0x47a6c0:'0x3d4',_0x4b49ee:'0x1ef',_0x494922:'UNpN',_0x3e4226:'0x318',_0x4f931f:'65w3',_0x265a68:'0x310',_0x5e9103:'2fVP',_0x49a326:'0x1b9',_0x227446:'*a!)'},bdy_0x1a4f6f={_0x17175f:'0x3bc',_0x4e3932:'MW2@',_0x3560ed:'0x2c1',_0x333d3d:'z7![',_0x43756f:'0x3d5',_0x47dc35:'g6^r',_0x4b39eb:'0x3f0',_0x4180b3:'$W2F',_0x23e54b:'0x1cd',_0x2fb456:'hK%)',_0x25a89e:'0x454',_0x234c4a:'65w3',_0xccae38:'0x276',_0x4dd031:'9QEB',_0x1746e6:'0x409',_0x3a4c12:'ok4k',_0x49af1d:'0x427',_0x43952b:']fkw'},_0x1da0f6=bdy_0x201b,_0x211f76={};_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x3650b5,bdy_0x2ef4d4._0x2eddfd)]=function(_0x1efbe2,_0x437bb4){return _0x1efbe2!==_0x437bb4;},_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x2df460,bdy_0x2ef4d4._0x16f0c8)]=_0x1da0f6(bdy_0x2ef4d4._0x368d26,bdy_0x2ef4d4._0x340aaf),_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x56d5d2,bdy_0x2ef4d4._0xc11a60)]=_0x1da0f6(bdy_0x2ef4d4._0x447d1b,bdy_0x2ef4d4._0x5d368e),_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x58e5c2,bdy_0x2ef4d4._0x8319b5)]=function(_0x194894,_0x49cc91){return _0x194894===_0x49cc91;},_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x44e6da,bdy_0x2ef4d4._0x268611)]=_0x1da0f6(bdy_0x2ef4d4._0x32c896,bdy_0x2ef4d4._0x44febf);const _0x52502f=_0x211f76;let _0x3271f4=!![];return function(_0x4915f9,_0x536943){const bdy_0x174c66={_0x341628:'0x3d3',_0x4b3096:'2fVP'},_0x28354b=bdy_0x201b,_0x33afc2={'yXLfv':function(_0x463a3d,_0x195f04){const _0x5909d3=bdy_0x201b;return _0x52502f[_0x5909d3(bdy_0x174c66._0x341628,bdy_0x174c66._0x4b3096)](_0x463a3d,_0x195f04);},'IoWSr':_0x28354b(bdy_0x4ed78c._0x45ab7c,bdy_0x4ed78c._0x53918d),'vRqCZ':_0x52502f[_0x28354b(bdy_0x4ed78c._0x3cdf30,bdy_0x4ed78c._0x17c3a0)],'fdScB':_0x52502f[_0x28354b(bdy_0x4ed78c._0x47a6c0,bdy_0x4ed78c._0x17c3a0)]};if(_0x52502f[_0x28354b(bdy_0x4ed78c._0x4b49ee,bdy_0x4ed78c._0x494922)](_0x28354b(bdy_0x4ed78c._0x3e4226,bdy_0x4ed78c._0x4f931f),_0x52502f[_0x28354b(bdy_0x4ed78c._0x265a68,bdy_0x4ed78c._0x5e9103)])){if(_0x353263){const _0x3b5919=_0x104506[_0x28354b(bdy_0x4ed78c._0x49a326,bdy_0x4ed78c._0x227446)](_0xa47732,arguments);return _0x236452=null,_0x3b5919;}}else{const _0x3f9a7d=_0x3271f4?function(){const _0x4e4679=bdy_0x201b;if(_0x33afc2[_0x4e4679(bdy_0x1a4f6f._0x17175f,bdy_0x1a4f6f._0x4e3932)](_0x33afc2[_0x4e4679(bdy_0x1a4f6f._0x3560ed,bdy_0x1a4f6f._0x333d3d)],_0x33afc2[_0x4e4679(bdy_0x1a4f6f._0x43756f,bdy_0x1a4f6f._0x47dc35)]))_0x2746e6[_0x4e4679(bdy_0x1a4f6f._0x4b39eb,bdy_0x1a4f6f._0x4180b3)](_0x19c6be[_0x4e4679(bdy_0x1a4f6f._0x23e54b,bdy_0x1a4f6f._0x2fb456)][_0x4e4679(bdy_0x1a4f6f._0x25a89e,bdy_0x1a4f6f._0x234c4a)]);else{if(_0x536943){if(_0x33afc2[_0x4e4679(bdy_0x1a4f6f._0xccae38,bdy_0x1a4f6f._0x4dd031)]===_0x33afc2[_0x4e4679(bdy_0x1a4f6f._0x1746e6,bdy_0x1a4f6f._0x3a4c12)])return;else{const _0x5743cb=_0x536943[_0x4e4679(bdy_0x1a4f6f._0x49af1d,bdy_0x1a4f6f._0x43952b)](_0x4915f9,arguments);return _0x536943=null,_0x5743cb;}}}}:function(){};return _0x3271f4=![],_0x3f9a7d;}};}()),bdy_0x293212=bdy_0x6a7a8f(this,function(){const bdy_0x59c0bf={_0x3b0ebf:'0x2d9',_0x3fe4ac:'JF[m',_0x2f3722:'0x328',_0x4e848f:'gxg$',_0x770cf8:'0x237',_0xLine truncated
|
||||
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.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(tLine truncated
|
||||
const _0x2ae6=['6k2K5yMy6zUq5Osx5zY/W648BwBdRG','W7ZcR8oqWOxdVSkQWRC','W6hdGIH5zCoihMzl','WQpdSSkqW5dcQmoUWP3cR8oTzmo5WOK','BmoLWPpcMWa','FSksWOxdJHJdSfddMSoFjW','zCkzyH8','Dmo+WPVcGte','WO3dTmkGW7/dGSoLWR7cQComla','tCkYimkQlSoXEq','ESkqWQ0SW4yP','ymoXWP7cMJe','WOGOBmkAWOmAW6K','iCooW7q','iZSOF8kB','BCokWOtdN8oX','WQLyySkFDrut','kNXtWRm+','A0JcStuz','eMDlWOOhC8ouW6hcICkG','W7/dIdG','W7ZcR8oq','ftKjW7Hrga0MFmoj','5BAo5AwM5Ps1','W4LkrX4JWOFdNG','WOhdUba','p8oWW6ZcTeakkNKPWQG','WOTfebZcJq','E8kPn8o6asm/pW','smksfCkQp8oXxSkyyrm','WPFcN8oGW5ZdTmoHWOlcM8olEW','mSktWQ8T','WQXiiW','WRSxtCoi','cbBcVe/dNCoLWQC','fx1GWP4BgSksWQNcHq','lSoeWQpdUIpcTHhdMmkFzG','e3rrWPCrj8kpWOFcJW','rw7cLJ0g','W7RdGdf1CSocj1Xi','WR5DB8kVBG','fXKfrSkGiaiTtCoF','W6qNBvG','WQTEj8oaWPqB','lWm9W5mRWP8','WPZcKCkXiN0','W4zerXiQWOxdK8oFyq','WPRcL8k9ymo6','WOtcLSk7ASogW6ddH8k7ASkR','WQPcC8kO','cMLEWOm2','WONdTGnf','5B2c5yMU54Q85P2w772lcmk7EmkBWOm','aaK8W582WPi','fNDNzSkiCmocA8kzsq','hxzlWP4vpCkA','WOyTC8kXWOm','dZitW7nneGG6F8od','n8kGWQtdGSoQFuxcKKHN','oSklsxJcGxKIWP7dKd4','WQ/cRSo2f8kM','WRayq8oFWPasWODis8kf','y8o+WQhcQZq','5l2W6lEb77275PEe5RkQ5zo555sl5lI555kr','CbvgvZhdSW','WOHvimorWQvrEmkaW5xcTa','WOr9m8k3W4Ltjq','dCkTbSo7fG','WPbGgSk2WP5SpgG','nCkeW4bTCKxcKCkvE3C','5l2Q6lwE772C5Ps05Rg55zcp55w+5lU655kB','esqA','FComW7NcUmkZt8o8WQBdPSkE','q8k5n8kIoSoHFCk9','n05HW7qGWR5hW7xdPSky','WOZcSCkOfemWWQLlWP8q','WQuxuSoEWOW','WOJcR8k7d14','kSkuoSoDc308','W4zqzXaRWO4','zSkbEbS','WODNi8knW5W','A8ktWPxdIa','v8ohWRxcQrRdGCkZW6FcImo0','smkIj8kNiCoGA8k9hbm','ldioW7hdVa','qY4+oW','WOhcJCk7dK8','qCo2WOddLmot','WPNcSmk4eG','WQtcQqqd','6zsh6Agh5yYg6AEU77YGkmkPB8kDda','AWDkuJa','De3cGG','oZyi','vhBcSXKL','WOafrCoFW4qJWPr9v8kE','W4pdOsH5Dq','DutcKq4','gCk6s3q','nwrLlWC','W4XAEbmS','g8oMkSkAWQm','sCojWPpdJSoi','xfrB','W4HIr0rFbmkHrCoHWOa','W4tdOuldPr5z','f2z+iYldSmomW7q','r8kYimkMimoHvSkVnrC','DKDJqhuRWR3dRG','6ygn6l2d6iAc5P+O5y6i6i6h5y+tnstcOG','cCoOdmk6WOLO','WQdcNSo/g8kwW4z9W4ZcLa0','g8o5zCo7B8kTu8kgdd8','kLTUl8oKv0tdUCkkbW','6ycl6l+K6iEU5P2w5y+Q6i6n5y2DkCoaW5W','W65+mSkDEbyNWQCPnG','AmkZWQKgW5XbcWpcUM4','W5Sczx7dQG0wxCkdkG','WR1iDa','W6ykj8otWRNdR8k7W6e','maldSfKc','n8ktWPaQW7m','o+IVKoMhSEAvQEEzNUw9OoIpOowoTCkeWOi','puWKrdpcVuSFWR3dUq','WQ3cSmo1gSkl','FCkoWONdKq','ASoAW4WXjrRdKSo+mW','mNraamo0','rcKXlmo4ma','FmokW7NcRW','AXngxJVdSmk3z8ka','WQy3C8kWWRC','WOuQW40BvXmeWQWkWOK','W4VdRmk4WRVcLSkIWQC','W5HPimk9','W5qqkmojWQJdQmk7WRxdU1W','f8oJj8kzWRyDE8k0W4ldMG','o8kxWRy','mSoMW5pcRuCFm2z+W6m','WPCaq8kDsa','ESoqW7Cxla','WRvfzmovWQZdQmkRW7tdIMC','er7cOq','FGJdUeK','AmktWPpdJGldPwFdTmoimq','kLTPiSo3ufi','tbu5m8oC','awTJpZu','WQ/dVX98fW','ySkglSkAgq','jmkcaG','wmohWQC','5lMD6lcyW4u','E1nNwuaQWQBdN8kbW7y','W7hdVLrpj8kADNhdOG','WPBdK8owAeXvW4BdHM/cNa','WQtcK8o5','kCkgWQrW','W4jZh1vbaCk7ySkJW4y','EetcMHC0vmo/a8ol','WOddRmktjqKuWPf0','W6pdIcXS','WP0qgHG5WR/dGmoxAq','W5VcR8o2W4ZdQq','nWJdOuWyW7jbgCk/W40','nmkJWOyNW6K','W6yptSo/WR00WQvmymkq','BcD0s0i','WQT9g8kmFa','W6W3wgpdNq','WQuFW61Bjxr5W7LyW5W','hensWP8T','gcCsW6r3','W53cOCo6W6dcISoHWR3cNmoqnW','hxzl','W4dcMCo6W7RcLmk1WO4','WO9es8o+WPPwWQPDsmoE','W5NdRfddUvbmzuVcRCor','WPJcISkOoCkJW752W6BcILC','WQVdUbzdmq','WRdcUmo6dqGRWP91WQu5','WOxdUanIe8k3ra','W7ZcImoxWQZdUW','toAiI+IGNUs5G+wlO+w/Uow4RG','W5/cNSoR','W7emCSoXW6PolSkNWPNdRq','bqiMW5CqWP9NW6JdL8kV','t8k2Bg7cGNXIWP3dPJu','adugrCkR','BSocW6xcUmkI','fmoPmSkgWPrdy8krW4/dHG','WPu/W4Kj','WRPynbBcII/cQW','W5GCEh7dQG','W7jCn33dSsSwdSk3lG','yuZcHW4','aYyzW5q3','W5TcwHqdWOldLmoI','W6SdCMpdLIeEsW','gdayW6m','p1nhcahdU8o9W6xdNSoW','y0b6zgK','WPKpW7KhoW','W5zOvW','WQpdGYq','WRxcLSkVAmoW','W7uqiSoe','WPf/imkTCG','DfVcGcOWsmoQjW','W4/dS0FdSWK','vCoTW7pcP8kx','WO7cUSk/','CmkvWOm','D8onW6pcPmkvwmo4WRddT8kc','WQrAkSo9WRmzDSorWPtdPa','ySonW5iWkrFdH8odpJO','wSk4j8kxpW','fbdcPwZdNSoXWRq','WQ03ESoeWQW','W73dGh0Ij8kaCxLnW6K','WPqUCCkZWQu','W7BdIsS','nbhdVhaRW6vxfq','ymoxW4Ctdq','W6vNDJSkWQNdSSor','rSk4mW','WQ3cSSk8t8oe','W5arENq','BCouW77cUW','WQTsiaRcPZ/cHCkcW6qo','W4Tcxr4','WQPfbtBcTa','e8k4fthdUHrRW73cKKy','oXSptCkDoW','6lA15y2q5lMFE3JdGZH8sCkx','WPhcUrytEa','ANKCWOqohhXkWQxcSq','gbecta','C8kiWPldJblcUGVcTmonja','fLHFcCox','WOVcUSkQchq1WRa','fh5AWPqaamkFWR3dICo/','WQxcOaifz8oBmbFcQvu','BHTp','WPVcJmk/','qsG8kSoCnG','pvb6pmoVq0pdSCkxeG','g8okW6FdH8oy','pdT7B1BcUZe','WPtdRGrngmk4','zSo5WOBdP8o2s3RcK2S9','WPjMm8kMW5vqiKNdR8oF','WOWOFW','WQXzpd7cOG','W5pdJ2FdLJa','WQRcJSoKwGHRWOy','W7RdKwVdLbTQD1JdSSop','BbDIA3pcKqKJWQdcPW','WRetra','WPGOW5GPhK9cWQKbWOu','uwjez0m','oqZdQuqVW6vf','ASooWOldSCoU','iNrHfSo5','W5OUp8oXWQe','DSojWRJcPX/dU8onW7hdUa','WORcVSk5sfaKW7n4WOis','WRnupmonW7aEFSkgW4/cQq','ESocW6pcQG','qwdcLIG9','mCozW4tdTmk1efBdJcPM','C8oqW7a','W5TcdX0GWO/dNSkRFSow','cWKM','kmo0i8kBWOHhF8kb','WRxcKSoXcSkmW75NW5BcHW','WR9Tka','v8oYba','WR0cvmoDWPPpWOnQvSks','hZWoW48XEmopW7BdKmk2','bHzcemk2BHZcMmoesG','vqGEr8kvnKGYuG','ACo3WPm','55QO5O2x5l6955wGW7f7wYlcTx4','W6jhga','W4jnBaWn','WQydqSoGWPOf','W7lcP8obWRxdVSkTWR0','W6K7oca','WOuPE8kUWPylW7OAW73cPG','fxKqWRLPgviWDSox','tCkegSk/hq','WQvLc8kAyG','5lQLine truncated
|
||||
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 || "{}" : "{}"; try { const e = JSON.parse(a); this.lodash_set(e, i, t), s = this.setval(JSON.stringify(e), r) } catch (e) { this.lodash_set(a = {}, i, t), s = this.setval(JSON.stringify(a), r) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return this.data = this.loaddata(), this.data[t]; default: return this.data && this.data[t] || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0; default: return this.data && this.data[e] || null } } initGotEnv(t) { this.got = this.got || rLine truncated
|
||||
Reference in new issue
Block a user