faker3/jd_plantBean_help.js

24 lines
60 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
种豆得豆 脚本更新地址jd_plantBean_help.js
活动入口京东APP我的-更多工具-种豆得豆
=====================================Quantumult X=================================
[task_local]
40 4,17 * * * jd_plantBean_help.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true
=====================================Loon================================
[Script]
cron "40 4,17 * * *" script-path=jd_plantBean_help.js,tag=京东种豆得豆
======================================Surge==========================
京东种豆得豆 = type=cron,cronexp="40 4,17 * * *",wake-system=1,timeout=3600,script-path=jd_plantBean_help.js
====================================小火箭=============================
京东种豆得豆 = type=cron,script-path=jd_plantBean_help.js, cronexpr="40 4,17 * * *", timeout=3600, enable=true
*/
const $ = new Env('种豆得豆内部互助');
var il='jsjiami.com.v7';const l1111=iii1II;(function(IIlilI,Illlll,Illlli,llli1l,lI1ii1,llli1i,iiI1l1){return IIlilI=IIlilI>>0x3,llli1i='hs',iiI1l1='hs',function(i11lI1,liliiI,ilIIiI,lIl1ii,lIl1il){const ilIIii=iii1II;lIl1ii='tfi',llli1i=lIl1ii+llli1i,lIl1il='up',iiI1l1+=lIl1il,llli1i=ilIIiI(llli1i),iiI1l1=ilIIiI(iiI1l1),ilIIiI=0x0;const Ii1l11=i11lI1();while(!![]&&--llli1l+liliiI){try{lIl1ii=parseInt(ilIIii(0x313,'^%q@'))/0x1+-parseInt(ilIIii(0x340,'2Eu!'))/0x2+parseInt(ilIIii(0x191,'@x#v'))/0x3+-parseInt(ilIIii(0x2c9,']hth'))/0x4+-parseInt(ilIIii(0x360,'#aAO'))/0x5+parseInt(ilIIii(0x19b,'E4Ur'))/0x6+parseInt(ilIIii(0x18f,']hth'))/0x7*(-parseInt(ilIIii(0x2cd,'^&R9'))/0x8);}catch(IIlii1){lIl1ii=ilIIiI;}finally{lIl1il=Ii1l11[llli1i]();if(IIlilI<=llli1l)ilIIiI?lI1ii1?lIl1ii=lIl1il:lI1ii1=lIl1il:ilIIiI=lIl1il;else{if(ilIIiI==lI1ii1['replace'](/[LFpuXflEnTUetIONBwH=]/g,'')){if(lIl1ii===liliiI){Ii1l11['un'+llli1i](lIl1il);break;}Ii1l11[iiI1l1](lIl1il);}}}}}(Illlli,Illlll,function(iiI1lI,IliIlI,IIliiI,i1111l,i1111i,iliiI1,Illli1){return IliIlI='\x73\x70\x6c\x69\x74',iiI1lI=arguments[0x0],iiI1lI=iiI1lI[IliIlI](''),IIliiI=`\x72\x65\x76\x65\x72\x73\x65`,iiI1lI=iiI1lI[IIliiI]('\x76'),i1111l=`\x6a\x6f\x69\x6e`,(0x159fa7,iiI1lI[i1111l](''));});}(0x630,0x2fb3b,Iii11l,0xc8),Iii11l)&&(il=0x7a2);let jdNotify=!![],cookiesArr=[],cookie='',jdPlantBeanShareArr=[],isBox=![],notify,newShareCodes,option,message,subTitle;const common=require('./utils/Rebels_jdCommon'),{H5st}=require('./utils/Rebels_H'),JD_API_HOST=l1111(0x28a,'2Eu!');let shareCodes=[],allMessage='',currentRoundId=null,lastRoundId=null,roundList=[],awardState='',randomCount=$[l1111(0x1a0,'#aAO')]()?0x14:0x5,num;$[l1111(0x208,'or65')]=[];let llerror=![],lnrun=0x0,lnruns=0x0;!(async()=>{const lIl1l1=l1111,IllIil={'yIOQJ':function(ill1Ii,llIIl1){return ill1Ii(llIIl1);},'FNCeI':function(ill1Il,i1lll1){return ill1Il===i1lll1;},'zNJVo':lIl1l1(0x380,'[&LK'),'XrOSd':lIl1l1(0x325,'*YEw'),'JfjII':function(Ii1I1I,l1i1Ii){return Ii1I1I!==l1i1Ii;},'HELmf':lIl1l1(0x25e,'usO^'),'eZAsy':lIl1l1(0x1d5,'Q87Z'),'rcdyK':lIl1l1(0x34b,'2Yw2'),'FdrMY':'VaNCj','zwTcZ':function(l1iI1){return l1iI1();},'TfbWf':function(lliiI1,IiiI1){return lliiI1*IiiI1;}};await requireConfig();if(!cookiesArr[0x0]){if(IllIil['FNCeI'](lIl1l1(0x2f4,'Naqq'),'oeWcE')){$[lIl1l1(0x371,'2Eu!')]($['name'],IllIil[lIl1l1(0x1e2,'Z5C)')],'https://bean.m.jd.com/bean/signIndex.action',{'open-url':lIl1l1(0x295,'sOCq')});return;}else IlI1I[lIl1l1(0x15f,'9iuE')]();}for(let IIIiI=0x0;IIIiI<cookiesArr[lIl1l1(0x155,'@$nv')];IIIiI++){if(IllIil[lIl1l1(0x227,'Q87Z')]('SElCt',IllIil[lIl1l1(0x14b,'Q87Z')]))ii1lI[lIl1l1(0x1b1,'bB(@')](I1ilIl)['forEach'](IllIll=>{const li1i=lIl1l1;llIlli[IllIll]&&Iiii1['shareCodesArr'][li1i(0x25d,'&*AK')](lIIili[IllIll]);});else{if(cookiesArr[IIIiI]){cookie=cookiesArr[IIIiI],$[lIl1l1(0x15b,'Ah[7')]=decodeURIComponent(cookie[lIl1l1(0x271,'Y4[]')](/pt_pin=([^; ]+)(?=;?)/)&&cookie['match'](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$['index']=IIIiI+0x1,$['isLogin']=!![],$[lIl1l1(0x18a,'Z5C)')]='',$[lIl1l1(0x22d,'&*AK')]=![],console[lIl1l1(0x20d,'#aAO')]('\x0a开始【京东账号'+$['index']+'】'+($[lIl1l1(0x1d0,'3E2B')]||$[lIl1l1(0x21b,'TP9d')])+'\x0a');if(!$[lIl1l1(0x362,'bB(@')]){if(IllIil[lIl1l1(0x1b0,'pMPB')](IllIil[lIl1l1(0x258,'or65')],IllIil[lIl1l1(0x1a5,'Y4[]')]))lii=IllI1i+'?functionId='+i11I1l+'&body='+IllIil['yIOQJ'](lil,IllI1l[lIl1l1(0x19e,'cVou')](i11I1i))+lIl1l1(0x323,'yvjC');else{$[lIl1l1(0x29e,'sOCq')]($['name'],'【提示】cookie已失效','京东账号'+$[lIl1l1(0x1dd,'vnBc')]+'\x20'+($[lIl1l1(0x1c7,'^&R9')]||$['UserName'])+'\x0a请重新登录获取\x0ahttps://bean.m.jd.com/bean/signIndex.action',{'open-url':IllIil[lIl1l1(0x1c4,'*YEw')]});$[lIl1l1(0x1cc,'9iuE')]()&&(IllIil[lIl1l1(0x18c,'kI!&')](IllIil[lIl1l1(0x2c0,'TKem')],IllIil[lIl1l1(0x345,'72vV')])?(Iiill['outFlag']=!![],l11i1i['message']&&IiI1[lIl1l1(0x328,'@x#v')][lIl1l1(0x1ab,'@x#v')](liI)):await notify[lIl1l1(0x2b4,'Mk6T')]($[lIl1l1(0x35a,'Naqq')]+'cookie已失效\x20-\x20'+$[lIl1l1(0x18b,'f2wU')],'京东账号'+$['index']+'\x20'+$[lIl1l1(0x284
// 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