jdpro/jx_joypark_task.js

6 lines
98 KiB
JavaScript
Raw Normal View History

2024-01-02 12:59:48 +00:00
/*
12 12 * * * jx_joypark_task.js
*/
const $ = new Env('牛牛乐园任务');
const _0x3a5bb1=_0x30fb;function _0x30fb(_0x28df8e,_0x5d9267){const _0x81f609=_0x3e53();return _0x30fb=function(_0x412019,_0x431995){_0x412019=_0x412019-(0x55*0x19+0x1ebb+-0x25a2);let _0x296191=_0x81f609[_0x412019];if(_0x30fb['SbicXN']===undefined){var _0x421af9=function(_0x88c3f6){const _0x156c04='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x591675='',_0x4f16a0='',_0x31245d=_0x591675+_0x421af9;for(let _0x52764f=0x1*0x262e+-0xe1f*0x2+-0x13e*0x8,_0x3261e5,_0x5216a1,_0x2f9c32=0x92e*0x2+0x1faa+0x1903*-0x2;_0x5216a1=_0x88c3f6['charAt'](_0x2f9c32++);~_0x5216a1&&(_0x3261e5=_0x52764f%(-0xb40+-0x4*-0x2d3+-0x4*0x2)?_0x3261e5*(0x2278+-0x120a*-0x1+-0x3442)+_0x5216a1:_0x5216a1,_0x52764f++%(-0x2*0x3a4+-0x38*0x7c+0x226c))?_0x591675+=_0x31245d['charCodeAt'](_0x2f9c32+(0x678*0x4+0x1*-0x11d6+-0x800))-(-0x5*-0x394+-0xdfa*0x1+-0x3e0)!==-0x1*-0x2115+-0x779+-0x199c?String['fromCharCode'](0x1*-0x727+-0x2*-0xd33+-0x1240&_0x3261e5>>(-(-0xa*0x35d+-0x3*0xc15+0x45e3)*_0x52764f&-0x58b+-0xf07+0x2*0xa4c)):_0x52764f:0x148d*-0x1+0xe*-0xe1+0x20db){_0x5216a1=_0x156c04['indexOf'](_0x5216a1);}for(let _0x3ff421=0x1d55+-0xbb5+-0x11a0,_0x53d478=_0x591675['length'];_0x3ff421<_0x53d478;_0x3ff421++){_0x4f16a0+='%'+('00'+_0x591675['charCodeAt'](_0x3ff421)['toString'](-0x9b1+0x1d91+-0x13d0*0x1))['slice'](-(-0x121*0xd+-0x187*-0x2+0xba1));}return decodeURIComponent(_0x4f16a0);};const _0x4d2f44=function(_0x3856bd,_0x3e5ea5){let _0xc335a2=[],_0x1af052=-0x21c0+0x1*-0x147a+0x363a,_0x55a024,_0xde598f='';_0x3856bd=_0x421af9(_0x3856bd);let _0x2fde69;for(_0x2fde69=0x3*0x9e4+-0x16d4+-0x6d8;_0x2fde69<-0x2f2+0xe19+-0xa27;_0x2fde69++){_0xc335a2[_0x2fde69]=_0x2fde69;}for(_0x2fde69=0x7e*-0x1f+-0x86f+0x17b1*0x1;_0x2fde69<0x1e80+-0x750+-0x1630;_0x2fde69++){_0x1af052=(_0x1af052+_0xc335a2[_0x2fde69]+_0x3e5ea5['charCodeAt'](_0x2fde69%_0x3e5ea5['length']))%(-0x15*0x7a+-0xe54+-0x2*-0xcab),_0x55a024=_0xc335a2[_0x2fde69],_0xc335a2[_0x2fde69]=_0xc335a2[_0x1af052],_0xc335a2[_0x1af052]=_0x55a024;}_0x2fde69=-0x405+-0xf2*-0x28+-0x21cb,_0x1af052=-0x3e8*0x1+0x97f+-0x597;for(let _0x4e6825=-0x9f9+-0xfc0+0xf*0x1b7;_0x4e6825<_0x3856bd['length'];_0x4e6825++){_0x2fde69=(_0x2fde69+(0xd5c+-0xa24+-0x337))%(-0x24ee+-0x1bd*0x5+0x1*0x2e9f),_0x1af052=(_0x1af052+_0xc335a2[_0x2fde69])%(0xcac+-0xd98+0x1ec),_0x55a024=_0xc335a2[_0x2fde69],_0xc335a2[_0x2fde69]=_0xc335a2[_0x1af052],_0xc335a2[_0x1af052]=_0x55a024,_0xde598f+=String['fromCharCode'](_0x3856bd['charCodeAt'](_0x4e6825)^_0xc335a2[(_0xc335a2[_0x2fde69]+_0xc335a2[_0x1af052])%(-0x1*-0x114a+0x241f+-0x3469)]);}return _0xde598f;};_0x30fb['mpPUBW']=_0x4d2f44,_0x28df8e=arguments,_0x30fb['SbicXN']=!![];}const _0x342209=_0x81f609[-0xa9*0x27+-0x2594+0x22f*0x1d],_0x171a72=_0x412019+_0x342209,_0x1942a0=_0x28df8e[_0x171a72];if(!_0x1942a0){if(_0x30fb['fBodYu']===undefined){const _0x25fbd7=function(_0x14481d){this['RXmglM']=_0x14481d,this['fkfzpO']=[0x2581+0x7*-0x436+-0x806,-0xb*-0x103+0x25*-0xe9+0x168c,0x1*0x1a11+-0x956+-0x10bb],this['GeeWyz']=function(){return'newState';},this['bFtsYR']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['psfvKL']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x25fbd7['prototype']['QzLSwk']=function(){const _0x5980b1=new RegExp(this['bFtsYR']+this['psfvKL']),_0x48d35d=_0x5980b1['test'](this['GeeWyz']['toString']())?--this['fkfzpO'][0xe07+-0x87d+0xd*-0x6d]:--this['fkfzpO'][0x1*0x3fd+-0x3*0x107+0x4*-0x3a];return this['ARHQKC'](_0x48d35d);},_0x25fbd7['prototype']['ARHQKC']=function(_0x28688e){if(!Boolean(~_0x28688e))return _0x28688e;return this['hQyiVY'](this['RXmglM']);},_0x25fbd7['prototype']['hQyiVY']=function(_0x2ff5fd){for(let _0x4efff1=-0x2e8+0x2*-0x692+-0x13c*-0xd,_0xaf8252=this['fkfzpO']['length'];_0x4efff1<_0xaf8252;_0x4efff1++){this['fkfzpO']['push'](Math['round'](Math['random']())),_0xaf8252=this['fkfzpO']['length'];}return _0x2ff5fd(this['fkfzpO'][0x17f4+0x3c*-0x89+0x828]);},new _0x25fbd7(_0x30fb)['QzLSwk'](),_0x30fb['fBodYu']=!![];}_0x296191=_0x30fb['mpPUBW'](_0x296191,_0x431995),_0x28df8e[_0x171a72]=_0x296191;}else _0x296191=_0x1942a0;return _0x296191;},_0x30fb(_0x28df8e,_0x5d9267);}(function(_0x31f5ec,_0x18b
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