jdpro/jd_wanyiwan.js

7 lines
105 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
23 5,10 * * * jd_wanyiwan.js
*/
const $ = new Env('玩一玩_任务');
2024-06-28 16:09:46 +00:00
const bdy_0x58af36=bdy_0x3271;(function(_0x5418da,_0x320f14){const bdy_0x17397e={_0x49eaa9:'^fqA',_0x45bb03:'Xp#M',_0x3127ec:'Q4xt',_0x2e882e:'Xbv&'},_0x57e174=bdy_0x3271,_0x25d39a=_0x5418da();while(!![]){try{const _0x433bc8=parseInt(_0x57e174('0x2a5',bdy_0x17397e._0x49eaa9))/(-0x6b*-0x26+0x2*0xc1c+-0x2819)+parseInt(_0x57e174('0x4f1','T&XM'))/(-0x1ca8+0x115b+0xb4f)+-parseInt(_0x57e174('0x3f4',bdy_0x17397e._0x45bb03))/(-0x6dd*0x4+0x1*-0x13b7+0x2f2e)*(parseInt(_0x57e174('0x455','&t2O'))/(0xfd1*-0x2+-0x174d+-0x36f3*-0x1))+parseInt(_0x57e174('0x2b1',bdy_0x17397e._0x3127ec))/(-0x1f*0x67+-0x1*-0x110e+-0x490)+parseInt(_0x57e174('0x53b',bdy_0x17397e._0x2e882e))/(-0x2*-0x1361+-0xe5e+-0x185e)+-parseInt(_0x57e174('0x500','Uh3h'))/(-0xcd9+0x3c+-0xca4*-0x1)+-parseInt(_0x57e174('0x275','uoCf'))/(0x15b*0x4+0x2*-0xf1d+0x11*0x176);if(_0x433bc8===_0x320f14)break;else _0x25d39a['push'](_0x25d39a['shift']());}catch(_0x3cc918){_0x25d39a['push'](_0x25d39a['shift']());}}}(bdy_0x111f,-0xd7eab+-0x2b2a2+0x1cf5fc));const bdy_0xde9a54=(function(){const bdy_0x1064da={_0x57093d:'0x439'};let _0x3a21de=!![];return function(_0x54c19f,_0x1fc20d){const bdy_0x2bbd84={_0x2d1602:'&t2O',_0x34db8c:'0x38e',_0x1ae5f9:'Q*wd',_0x40d2a8:'0x28f'},_0x3830c0=bdy_0x3271;if(_0x3830c0(bdy_0x1064da._0x57093d,'[w*f')!==_0x3830c0('0x298','(dVk')){const _0x16dcf2=_0x3a21de?function(){const _0x385ce1=bdy_0x3271;if(_0x385ce1('0x343',bdy_0x2bbd84._0x2d1602)!==_0x385ce1(bdy_0x2bbd84._0x34db8c,')H$l'))_0x244c55[_0x385ce1('0x53e','S!NF')](_0x385ce1('0x23a','%K2M')),_0x1b1d6e[_0x385ce1('0x4e0','&87b')]=_0x3d96fe[_0x385ce1('0x417',bdy_0x2bbd84._0x1ae5f9)],_0x536a95[_0x385ce1('0x4aa','Yc8(')]=_0x54e978[_0x385ce1('0x3bb','oU^t')];else{if(_0x1fc20d){const _0x30e382=_0x1fc20d[_0x385ce1(bdy_0x2bbd84._0x40d2a8,'9RAM')](_0x54c19f,arguments);return _0x1fc20d=null,_0x30e382;}}}:function(){};return _0x3a21de=![],_0x16dcf2;}else return;};}()),bdy_0xf3ec92=bdy_0xde9a54(this,function(){const bdy_0x389dac={_0x76a2ac:'0x392',_0x41469c:'Toc1',_0x4553e7:'S2YI',_0x1a9eae:'0x209',_0x1ae9a2:'Lr6W'},_0x481f0a=bdy_0x3271;return bdy_0xf3ec92[_0x481f0a('0x56a','$zVg')]()[_0x481f0a(bdy_0x389dac._0x76a2ac,'9RAM')](_0x481f0a('0x44a',bdy_0x389dac._0x41469c))[_0x481f0a('0x4b8','qs%Z')]()[_0x481f0a('0x3b2',bdy_0x389dac._0x4553e7)](bdy_0xf3ec92)[_0x481f0a(bdy_0x389dac._0x1a9eae,bdy_0x389dac._0x1ae9a2)](_0x481f0a('0x2bc','S2YI'));});bdy_0xf3ec92();const bdy_0x4bfc30=(function(){const bdy_0x47c38d={_0x1304c1:'0x54c',_0x55bd20:'9RAM',_0x4af56e:'0x279',_0x50bbd2:'x9w0'};let _0x4b39ec=!![];return function(_0x459e58,_0x34e8ca){const _0x445a39=_0x4b39ec?function(){const _0x3037a4=bdy_0x3271;if(_0x34e8ca){if(_0x3037a4(bdy_0x47c38d._0x1304c1,'0P9P')===_0x3037a4('0x54b',bdy_0x47c38d._0x55bd20)){const _0x80ae88=_0x34e8ca[_0x3037a4(bdy_0x47c38d._0x4af56e,bdy_0x47c38d._0x50bbd2)](_0x459e58,arguments);return _0x34e8ca=null,_0x80ae88;}else _0x2e50cd[_0x3037a4('0x44d','^7VZ')](_0x30c886);}}:function(){};return _0x4b39ec=![],_0x445a39;};}());(function(){const bdy_0x5c5384={_0x292a8e:'0x293'},bdy_0x17a377={_0x1422d9:'r6wv',_0x17efb5:'S!NF'},_0x59164d=bdy_0x3271,_0x532b14={'RueNZ':function(_0x551704,_0x515053){return _0x551704(_0x515053);},'FbpVg':function(_0x105447,_0xfe6fd2,_0x1bbfd6){return _0x105447(_0xfe6fd2,_0x1bbfd6);}};_0x532b14[_0x59164d(bdy_0x5c5384._0x292a8e,'%K2M')](bdy_0x4bfc30,this,function(){const _0x245b7f=bdy_0x3271,_0xe793ab=new RegExp(_0x245b7f('0x3d4',bdy_0x17a377._0x1422d9)),_0x2a2917=new RegExp(_0x245b7f('0x482','&t2O'),'i'),_0x4723b6=_0x532b14[_0x245b7f('0x3cd','bhBn')](bdy_0x27ec03,_0x245b7f('0x3c1',')zFl'));!_0xe793ab[_0x245b7f('0x2aa','!!QB')](_0x4723b6+_0x245b7f('0x300','oSab'))||!_0x2a2917[_0x245b7f('0x26a',bdy_0x17a377._0x17efb5)](_0x4723b6+_0x245b7f('0x372','Xbv&'))?_0x4723b6('0'):bdy_0x27ec03();})();}());const bdy_0x5760c4=$[bdy_0x58af36('0x345','Q4xt')]()?require(bdy_0x58af36('0x529','T&XM')):'',bdy_0x417a72=$[bdy_0x58af36('0x308','Xp#M')]()?require(bdy_0x58af36('0x2da','0P9P')):'',bdy_0x3b5d57=require(bdy_0x58af36('0x390','zp@^')),bdy_0xf08cdf=require(bdy_0x58af36('0x43f','SFDy')),bdy_0x8266c5=proc
2024-06-28 07:47:44 +00:00
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 || "{}" : "{}"; tr