mirror of https://github.com/6dylan6/jdpro.git
12 lines
92 KiB
JavaScript
12 lines
92 KiB
JavaScript
|
/*
|
|||
|
东东农场助力
|
|||
|
20 2,6,11 * * * jd_farm_help.js
|
|||
|
updatetime:2023/10/29
|
|||
|
变量
|
|||
|
epxort FRUIT_DELAY='1000',设置等待时间(毫秒),默认请求5次接口等待5秒(5000)
|
|||
|
export FRUITCODES='xxx&xxx' 指定助力码助力,多个用&分割,不指定则自动搜集任务助力码
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('东东农场-助力');
|
|||
|
var _0xod3='jsjiami.com.v7';const _0x1b39c0=_0x4177;(function(_0x4b51bb,_0x393042,_0x5043a2,_0x3cff4e,_0x8059cb,_0x22b876,_0x51aac5){return _0x4b51bb=_0x4b51bb>>0x6,_0x22b876='hs',_0x51aac5='hs',function(_0x21bf0b,_0x2db2dc,_0x3dd88a,_0x5f5db3,_0x2fc9f3){const _0x10ab74=_0x4177;_0x5f5db3='tfi',_0x22b876=_0x5f5db3+_0x22b876,_0x2fc9f3='up',_0x51aac5+=_0x2fc9f3,_0x22b876=_0x3dd88a(_0x22b876),_0x51aac5=_0x3dd88a(_0x51aac5),_0x3dd88a=0x0;const _0x1dbaa2=_0x21bf0b();while(!![]&&--_0x3cff4e+_0x2db2dc){try{_0x5f5db3=-parseInt(_0x10ab74(0x34d,'dFRP'))/0x1*(parseInt(_0x10ab74(0x343,'h8QM'))/0x2)+parseInt(_0x10ab74(0x27b,'D&5s'))/0x3+-parseInt(_0x10ab74(0x3b3,'pOc8'))/0x4+-parseInt(_0x10ab74(0x459,'Er)c'))/0x5+parseInt(_0x10ab74(0x2b5,'!&QU'))/0x6+-parseInt(_0x10ab74(0x4e9,'@Adj'))/0x7+parseInt(_0x10ab74(0x36c,'Tbd6'))/0x8;}catch(_0x3cf6b3){_0x5f5db3=_0x3dd88a;}finally{_0x2fc9f3=_0x1dbaa2[_0x22b876]();if(_0x4b51bb<=_0x3cff4e)_0x3dd88a?_0x8059cb?_0x5f5db3=_0x2fc9f3:_0x8059cb=_0x2fc9f3:_0x3dd88a=_0x2fc9f3;else{if(_0x3dd88a==_0x8059cb['replace'](/[qxMLNVDnfutgECWrwkARO=]/g,'')){if(_0x5f5db3===_0x2db2dc){_0x1dbaa2['un'+_0x22b876](_0x2fc9f3);break;}_0x1dbaa2[_0x51aac5](_0x2fc9f3);}}}}}(_0x5043a2,_0x393042,function(_0x147d87,_0x53a0ff,_0x459672,_0x1025d7,_0x5038e7,_0xb74077,_0xc2274d){return _0x53a0ff='\x73\x70\x6c\x69\x74',_0x147d87=arguments[0x0],_0x147d87=_0x147d87[_0x53a0ff](''),_0x459672=`\x72\x65\x76\x65\x72\x73\x65`,_0x147d87=_0x147d87[_0x459672]('\x76'),_0x1025d7=`\x6a\x6f\x69\x6e`,(0x14b556,_0x147d87[_0x1025d7](''));});}(0x31c0,0x62085,_0x561e,0xc9),_0x561e)&&(_0xod3=0xc9);const _0x48233a=(function(){const _0x57876f=_0x4177,_0x196439={'hhgaZ':_0x57876f(0x45d,'qNI#'),'fgEfB':function(_0x4bf396,_0x32d8d1){return _0x4bf396!==_0x32d8d1;},'lyvnH':_0x57876f(0x318,'h8QM'),'ddPxF':_0x57876f(0x1de,']m3H'),'vEWdy':function(_0x51b880,_0x2d4acb){return _0x51b880===_0x2d4acb;},'Lggqo':_0x57876f(0x301,'p@yc'),'FOHtG':_0x57876f(0x351,'GvK9'),'AUxfL':function(_0x5d3fa6,_0x56cbbc){return _0x5d3fa6!=_0x56cbbc;}};let _0x34a71c=!![];return function(_0x12a962,_0x3553d0){const _0x42daf6={'KExWQ':function(_0x1e460d,_0x17978a){const _0x515e62=_0x4177;return _0x196439[_0x515e62(0x41c,'@dnw')](_0x1e460d,_0x17978a);}},_0x5e5a7a=_0x34a71c?function(){const _0x47928a=_0x4177,_0x38f218={'UkmSE':_0x196439[_0x47928a(0x3e2,'NGO7')]};if(_0x196439[_0x47928a(0x406,'@dnw')](_0x196439[_0x47928a(0x368,'j@iH')],_0x196439[_0x47928a(0xf7,'%LpR')])){if(_0x3553d0){if(_0x196439[_0x47928a(0x422,']SDX')](_0x196439[_0x47928a(0x39a,'x^#s')],_0x196439[_0x47928a(0x24a,'qNI#')])){_0x22f10c=_0x374df7[_0x47928a(0x2a5,'!&QU')](_0x4d92b0);if(_0x42daf6[_0x47928a(0x12b,']SDX')](_0x5e99c5[_0x47928a(0x12a,'p@yc')],'0')){}_0x5838b9&&(_0x33aded[_0x47928a(0x4ba,'Wr])')]=_0xa9d97f);}else{const _0x3b5281=_0x3553d0[_0x47928a(0x4f8,'ErGs')](_0x12a962,arguments);return _0x3553d0=null,_0x3b5281;}}}else _0x2cd6da[_0x47928a(0x456,'pOc8')](_0x38f218[_0x47928a(0x159,'JJbc')]),_0x2c3e9c[_0x47928a(0x15e,'*r06')](_0x11c124[_0x47928a(0x493,'eSO^')](_0x40320c)),_0x1f8015[_0x47928a(0x33b,'h8QM')](_0x47928a(0x1ed,'h8QM')+_0xc8dda1),_0x3c16af[_0x47928a(0x242,'nL!t')](_0x5dd7a5);}:function(){};return _0x34a71c=![],_0x5e5a7a;};}()),_0x42c703=_0x48233a(this,function(){const _0x42eb93=_0x4177,_0x4aa9e7={'DnRmD':_0x42eb93(0x281,'nL!t')};return _0x42c703[_0x42eb93(0x1b4,'(%SI')]()[_0x42eb93(0x1e4,'0$la')](_0x4aa9e7[_0x42eb93(0x141,'p@yc')])[_0x42eb93(0x362,'NGO7')]()[_0x42eb93(0x499,'D&5s')](_0x42c703)[_0x42eb93(0x21a,'em&V')](_0x4aa9e7[_0x42eb93(0x51d,'[PlC')]);});_0x42c703();let _0x482d11=[],_0x3cccdb='',_0x408778,_0x267004=[],_0x3c259d=[],_0x209196='',_0x25b674='',_0x13d8fc='',_0x302b2c=[],_0xfb66ce={},_0x36827b=0x0,_0x5924ab=![];const _0x468a37=require('fs'),_0xc68654=_0x1b39c0(0x198,'dLC)'),_0x363043=process[_0x1b39c0(0x19d,'x^#s')][_0x1b39c0(0x366,'D&5s')]?process[_0x1b39c0(0x1d3,'($4S')][_0x1b39c0(0x317,'%LpR')]*0x1:0x1388,_0x581d1e=require(_0x1b39c0(0x203,'GvK9'));$[_0x1b39c0(0x40f,'Wr])')]=0x1,!(async()=>{const _0x7bb86e=_0x1b39c0,_0x5ee30b={'pxlvM':function(_0x24d1c2){return _0x24d1c2();},'KJYSN':_0x7bb8
|
|||
|
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
|