faker2/jd_dongDongFarm_help1.js

28 lines
89 KiB
JavaScript
Raw Normal View History

2024-06-28 07:27:40 +00:00
/*
新东东农场助力
助力领取助力奖励 20240703
2024-06-28 07:27:40 +00:00
环境变量
jd_XinFarm_Notify // 是否推送通知true/false默认不推送
cron:45 6,16 * * *
============Quantumultx===============
[task_local]
#新东东农场助力
45 6,16 * * * jd_XinFarm_help.js, tag=新东东农场助力, enabled=true
*/
const $ = new Env('新东东农场助力')
var _0xodw='jsjiami.com.v7';const _0x362e1e=_0x39a0;if(function(_0x5e9bca,_0x3e6db3,_0x3672b6,_0x4ac9ff,_0x2d20d4,_0x37f8db,_0xf3445d){return _0x5e9bca=_0x5e9bca>>0x7,_0x37f8db='hs',_0xf3445d='hs',function(_0x419fcb,_0x55a924,_0x49b1ed,_0x139e9c,_0x5b0d08){const _0x2f08fe=_0x39a0;_0x139e9c='tfi',_0x37f8db=_0x139e9c+_0x37f8db,_0x5b0d08='up',_0xf3445d+=_0x5b0d08,_0x37f8db=_0x49b1ed(_0x37f8db),_0xf3445d=_0x49b1ed(_0xf3445d),_0x49b1ed=0x0;const _0x47b7a1=_0x419fcb();while(!![]&&--_0x4ac9ff+_0x55a924){try{_0x139e9c=parseInt(_0x2f08fe(0x26f,'a*4!'))/0x1+parseInt(_0x2f08fe(0x15c,'*Uq('))/0x2*(-parseInt(_0x2f08fe(0x3b8,'E7@P'))/0x3)+parseInt(_0x2f08fe(0x354,'Jfqk'))/0x4*(-parseInt(_0x2f08fe(0x37e,'71^0'))/0x5)+-parseInt(_0x2f08fe(0x23e,'v)KD'))/0x6*(-parseInt(_0x2f08fe(0x356,'Abdc'))/0x7)+-parseInt(_0x2f08fe(0x219,'s6N9'))/0x8+-parseInt(_0x2f08fe(0x1e5,'VinP'))/0x9*(parseInt(_0x2f08fe(0x357,'Lq&R'))/0xa)+parseInt(_0x2f08fe(0x13f,'M!T%'))/0xb;}catch(_0x315413){_0x139e9c=_0x49b1ed;}finally{_0x5b0d08=_0x47b7a1[_0x37f8db]();if(_0x5e9bca<=_0x4ac9ff)_0x49b1ed?_0x2d20d4?_0x139e9c=_0x5b0d08:_0x2d20d4=_0x5b0d08:_0x49b1ed=_0x5b0d08;else{if(_0x49b1ed==_0x2d20d4['replace'](/[BREfylCMOtYJgPrkxuqXUGh=]/g,'')){if(_0x139e9c===_0x55a924){_0x47b7a1['un'+_0x37f8db](_0x5b0d08);break;}_0x47b7a1[_0xf3445d](_0x5b0d08);}}}}}(_0x3672b6,_0x3e6db3,function(_0x15cc49,_0x195375,_0x12568e,_0x2e5d30,_0x5769f1,_0x2726db,_0x103ccf){return _0x195375='\x73\x70\x6c\x69\x74',_0x15cc49=arguments[0x0],_0x15cc49=_0x15cc49[_0x195375](''),_0x12568e='\x72\x65\x76\x65\x72\x73\x65',_0x15cc49=_0x15cc49[_0x12568e]('\x76'),_0x2e5d30='\x6a\x6f\x69\x6e',(0x1754d4,_0x15cc49[_0x2e5d30](''));});}(0x6200,0x6537b,_0x1321,0xc6),_0x1321){}const crypto=require('crypto'),jdCookie=require(_0x362e1e(0x1e1,'Lq&R')),notify=require(_0x362e1e(0x1ce,'Lq&R')),common=require(_0x362e1e(0x3e0,'RGrJ')),{H5st}=require(_0x362e1e(0x19b,'IbIF')),fs=require('fs');let codeType=0x8;const CryptoJS=require(_0x362e1e(0x488,'q$]W')),querystring=require(_0x362e1e(0x319,'E7@P')),isNotify=process[_0x362e1e(0x30e,'tFx%')]['jd_XinFarm_Notify']===_0x362e1e(0x254,'JisZ'),JD_ZLC_URL=process[_0x362e1e(0x2dd,'Ui$9')][_0x362e1e(0x3b6,'F9zx')]?process[_0x362e1e(0x360,'I#J$')][_0x362e1e(0x484,'Lq&R')]:'https://zlc1.chaoyi996.site',ShareCodesCacheFile=_0x362e1e(0x414,'@63O');let ShareCodesCacheData=[],needUpdateShareCodesCache=![];fs['existsSync'](ShareCodesCacheFile)&&(ShareCodesCacheData=fs[_0x362e1e(0x22c,'#Ns]')](ShareCodesCacheFile,_0x362e1e(0x386,'N!y%')),ShareCodesCacheData&&(ShareCodesCacheData=ShareCodesCacheData[_0x362e1e(0x2a8,'q$]W')](),ShareCodesCacheData=JSON[_0x362e1e(0x17d,'ak33')](ShareCodesCacheData),console['log'](_0x362e1e(0x377,'E#9e'))));let ShareCodes=[],ShareCodesMap=new Map(),cookie='';const cookiesArr=Object[_0x362e1e(0x1e7,'ak33')](jdCookie)[_0x362e1e(0x2d3,'JisZ')](_0x1f83d5=>jdCookie[_0x1f83d5])[_0x362e1e(0x2dc,'5JRw')](_0x3087a0=>_0x3087a0);!cookiesArr[0x0]&&($[_0x362e1e(0x152,'ENh8')]($['name'],_0x362e1e(0x482,'wUCo')),process['exit'](0x1));!(async()=>{const _0x539791=_0x362e1e,_0x271308={'KeYBj':_0x539791(0x131,'oaq1'),'nHXny':_0x539791(0x243,'RGrJ'),'EPaxC':_0x539791(0x1a3,'Jfqk'),'CGwYT':function(_0x36b3ca,_0xa6829a){return _0x36b3ca>_0xa6829a;},'QFQeR':function(_0x370718,_0x53af0a){return _0x370718!==_0x53af0a;},'mGZNg':'AsbRT','sYezg':'\x0a【缓存文件XinFarm_ShareCache.json更新失败!】\x0a','YiVOZ':function(_0x188493,_0x2ab887){return _0x188493!==_0x2ab887;},'ICsqM':'PBnYd','uCBCC':_0x539791(0x3cf,'a*4!'),'tvQmA':function(_0x448ded,_0x2e963d){return _0x448ded<_0x2e963d;},'nXOtP':_0x539791(0x2e6,'Z!ov'),'uwzqY':function(_0x4ef875,_0x4c569b){return _0x4ef875+_0x4c569b;},'DMJKm':function(_0x312387,_0xfea384){return _0x312387(_0xfea384);},'ltlTk':_0x539791(0x148,'VM)Z'),'hFEYq':_0x539791(0x2ec,'s6N9')};notify['config']({'title':$[_0x539791(0x317,'a*4!')]}),console[_0x539791(0x1d2,'I#J$')](_0x539791(0x249,'Xene'));for(let _0x295340=0x0;_0x271308[_0x539791(0x36a,'Z!ov')](_0x295340,cookiesArr[_0x539791(0x40d,'tFx%')]);_0x295340++){if(_0x271308['nXOtP']===_0x271308[_0x539791(0x28f,'M!T%
2024-06-28 07:27:40 +00:00
// prettier-ignore
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