mirror of https://github.com/6dylan6/jdpro.git
6 lines
63 KiB
JavaScript
6 lines
63 KiB
JavaScript
|
/*
|
||
|
13 13 * * * jd_wwpark_task.js
|
||
|
*/
|
||
|
const $ = new Env('汪汪乐园任务');
|
||
|
var version_='jsjiami.com.v7';const _0x4030c3=_0x1aea;function _0x1aea(_0x4ef36b,_0x3b3db9){const _0x1a45b8=_0x32ef();return _0x1aea=function(_0x47cbaf,_0x327273){_0x47cbaf=_0x47cbaf-0x89;let _0x32efdc=_0x1a45b8[_0x47cbaf];if(_0x1aea['gZZjHL']===undefined){var _0x1aea13=function(_0xd0df0a){const _0x207dd9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x40161c='',_0x6574a3='',_0x1efdca=_0x40161c+_0x1aea13;for(let _0x540dfe=0x0,_0x230ea2,_0x33b14e,_0xb01cda=0x0;_0x33b14e=_0xd0df0a['charAt'](_0xb01cda++);~_0x33b14e&&(_0x230ea2=_0x540dfe%0x4?_0x230ea2*0x40+_0x33b14e:_0x33b14e,_0x540dfe++%0x4)?_0x40161c+=_0x1efdca['charCodeAt'](_0xb01cda+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x230ea2>>(-0x2*_0x540dfe&0x6)):_0x540dfe:0x0){_0x33b14e=_0x207dd9['indexOf'](_0x33b14e);}for(let _0x59fc9e=0x0,_0x30bea1=_0x40161c['length'];_0x59fc9e<_0x30bea1;_0x59fc9e++){_0x6574a3+='%'+('00'+_0x40161c['charCodeAt'](_0x59fc9e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6574a3);};const _0x26fd08=function(_0x18318f,_0x2688a1){let _0x24bfc8=[],_0x10b226=0x0,_0x2501d6,_0x246d2a='';_0x18318f=_0x1aea13(_0x18318f);let _0x51f79d;for(_0x51f79d=0x0;_0x51f79d<0x100;_0x51f79d++){_0x24bfc8[_0x51f79d]=_0x51f79d;}for(_0x51f79d=0x0;_0x51f79d<0x100;_0x51f79d++){_0x10b226=(_0x10b226+_0x24bfc8[_0x51f79d]+_0x2688a1['charCodeAt'](_0x51f79d%_0x2688a1['length']))%0x100,_0x2501d6=_0x24bfc8[_0x51f79d],_0x24bfc8[_0x51f79d]=_0x24bfc8[_0x10b226],_0x24bfc8[_0x10b226]=_0x2501d6;}_0x51f79d=0x0,_0x10b226=0x0;for(let _0xe54b74=0x0;_0xe54b74<_0x18318f['length'];_0xe54b74++){_0x51f79d=(_0x51f79d+0x1)%0x100,_0x10b226=(_0x10b226+_0x24bfc8[_0x51f79d])%0x100,_0x2501d6=_0x24bfc8[_0x51f79d],_0x24bfc8[_0x51f79d]=_0x24bfc8[_0x10b226],_0x24bfc8[_0x10b226]=_0x2501d6,_0x246d2a+=String['fromCharCode'](_0x18318f['charCodeAt'](_0xe54b74)^_0x24bfc8[(_0x24bfc8[_0x51f79d]+_0x24bfc8[_0x10b226])%0x100]);}return _0x246d2a;};_0x1aea['Okkksv']=_0x26fd08,_0x4ef36b=arguments,_0x1aea['gZZjHL']=!![];}const _0x363ba3=_0x1a45b8[0x0],_0x293472=_0x47cbaf+_0x363ba3,_0x56f184=_0x4ef36b[_0x293472];if(!_0x56f184){if(_0x1aea['LcvcRV']===undefined){const _0x5476f4=function(_0x3c9757){this['KryZWq']=_0x3c9757,this['QDQqXK']=[0x1,0x0,0x0],this['vfxzFm']=function(){return'newState';},this['EFknfy']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['HnUeFS']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5476f4['prototype']['qqcCWI']=function(){const _0x561634=new RegExp(this['EFknfy']+this['HnUeFS']),_0xdf08e1=_0x561634['test'](this['vfxzFm']['toString']())?--this['QDQqXK'][0x1]:--this['QDQqXK'][0x0];return this['AlJHUZ'](_0xdf08e1);},_0x5476f4['prototype']['AlJHUZ']=function(_0x3335e1){if(!Boolean(~_0x3335e1))return _0x3335e1;return this['Naekir'](this['KryZWq']);},_0x5476f4['prototype']['Naekir']=function(_0x24d550){for(let _0x36ac51=0x0,_0x8428d4=this['QDQqXK']['length'];_0x36ac51<_0x8428d4;_0x36ac51++){this['QDQqXK']['push'](Math['round'](Math['random']())),_0x8428d4=this['QDQqXK']['length'];}return _0x24d550(this['QDQqXK'][0x0]);},new _0x5476f4(_0x1aea)['qqcCWI'](),_0x1aea['LcvcRV']=!![];}_0x32efdc=_0x1aea['Okkksv'](_0x32efdc,_0x327273),_0x4ef36b[_0x293472]=_0x32efdc;}else _0x32efdc=_0x56f184;return _0x32efdc;},_0x1aea(_0x4ef36b,_0x3b3db9);}(function(_0x2a815e,_0x5c9d0d,_0x561bcc,_0x52fa39,_0x4cea05,_0x26a6e7,_0xc1e005){return _0x2a815e=_0x2a815e>>0x7,_0x26a6e7='hs',_0xc1e005='hs',function(_0x3d717b,_0x529525,_0x1d9e93,_0x294481,_0x1b96fd){const _0x22afb3=_0x1aea;_0x294481='tfi',_0x26a6e7=_0x294481+_0x26a6e7,_0x1b96fd='up',_0xc1e005+=_0x1b96fd,_0x26a6e7=_0x1d9e93(_0x26a6e7),_0xc1e005=_0x1d9e93(_0xc1e005),_0x1d9e93=0x0;const _0x39453d=_0x3d717b();while(!![]&&--_0x52fa39+_0x529525){try{_0x294481=-parseInt(_0x22afb3(0x31b,'L[x#'))/0x1*(-parseInt(_0x22afb3(0x321,'VOuz'))/0x2)+parseInt(_0x22afb3(0x157,'5C%R'))/0x3*(-parseInt(_0x22afb3(0x168,'VOuz'))/0x4)+parseInt(_0x22afb3(0x279,'Ya%n'))/0x5*(parseInt(_0x22afb3(0x24b,'5w*M'))/0x6)+parseInt(_0x22afb3(0xe2,'fu0E'))/0x7*(-parseInt(_0x22afb3(0x1a3,'f]re'))/0x8)+-parseInt(_0x22afb3(0x1bb,'UM2t'))/0x9+parseInt(_0x22afb3(0x11b,'ILg2'))/0
|
||
|
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
|