KR/jd_plantBean.js

30 lines
117 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
种豆得豆 脚本更新地址jd_plantBean.js
更新时间2021-08-20
活动入口京东APP我的-更多工具-种豆得豆
已支持IOS京东多账号,云端多京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
会自动关注任务中的店铺跟商品介意者勿使用
互助码shareCode请先手动运行脚本查看打印可看到
每个京东账号每天只能帮助3个人多出的助力码将会助力失败
=====================================Quantumult X=================================
[task_local]
1 7-21/2 * * * https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true
=====================================Loon================================
[Script]
cron "1 7-21/2 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js,tag=京东种豆得豆
======================================Surge==========================
京东种豆得豆 = type=cron,cronexp="1 7-21/2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js
====================================小火箭=============================
京东种豆得豆 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js, cronexpr="1 7-21/2 * * *", timeout=3600, enable=true
*/
const $ = new Env('种豆得豆');
var version_='jsjiami.com.v7';const liIiIl=iii1II;(function(Il1Iii,Ii1iI,Il1Iil,ilI,iIIlI,i1li1l,l11I1){return Il1Iii=Il1Iii>>0x5,i1li1l='hs',l11I1='hs',function(iiIli1,il11i1,iII1i1,l11II,ili){const iiIliI=iii1II;l11II='tfi',i1li1l=l11II+i1li1l,ili='up',l11I1+=ili,i1li1l=iII1i1(i1li1l),l11I1=iII1i1(l11I1),iII1i1=0x0;const iIIl1=iiIli1();while(!![]&&--ilI+il11i1){try{l11II=-parseInt(iiIliI(0x55c,'K)dh'))/0x1*(parseInt(iiIliI(0x1f7,'LjRj'))/0x2)+-parseInt(iiIliI(0x320,'fhrZ'))/0x3*(-parseInt(iiIliI(0x52a,'Y7u$'))/0x4)+parseInt(iiIliI(0x3c6,'ldY('))/0x5*(parseInt(iiIliI(0x472,'H%sh'))/0x6)+parseInt(iiIliI(0x267,'fhrZ'))/0x7+parseInt(iiIliI(0x164,'exm&'))/0x8+parseInt(iiIliI(0x27d,'t[1n'))/0x9*(-parseInt(iiIliI(0x1ab,'WC9s'))/0xa)+-parseInt(iiIliI(0x3c4,'4OO0'))/0xb;}catch(ill){l11II=iII1i1;}finally{ili=iIIl1[i1li1l]();if(Il1Iii<=ilI)iII1i1?iIIlI?l11II=ili:iIIlI=ili:iII1i1=ili;else{if(iII1i1==iIIlI['replace'](/[VRfMYGxEWHdQebUkCu=]/g,'')){if(l11II===il11i1){iIIl1['un'+i1li1l](ili);break;}iIIl1[l11I1](ili);}}}}}(Il1Iil,Ii1iI,function(lIli,ilii1I,Ii1i1,lIll,iiiIi,ilii11,iiiIl){return ilii1I='\x73\x70\x6c\x69\x74',lIli=arguments[0x0],lIli=lIli[ilii1I](''),Ii1i1='\x72\x65\x76\x65\x72\x73\x65',lIli=lIli[Ii1i1]('\x76'),lIll='\x6a\x6f\x69\x6e',(0x134030,lIli[lIll](''));});}(0x18e0,0xe74b5,Iii11l,0xc9),Iii11l)&&(version_=Iii11l);let jdNotify=!![],cookiesArr=[],cookie='',jdPlantBeanShareArr=[],isBox=![],notify,newShareCodes,option,message,subTitle;const cryptoJS=require('crypto-js'),base64_mod_charset=liIiIl(0x10a,'944h'),getToken=require('./function/krgetToken'),JD_API_HOST=liIiIl(0x2f5,'[((D');let shareCodes=[],allMessage='',currentRoundId=null,lastRoundId=null,roundList=[],awardState='',randomCount=$[liIiIl(0x52b,'exm&')]()?0x14:0x5,num;$['newShareCode']=[];let NowHour=new Date()[liIiIl(0x2d8,'&mTW')](),lnrun=0x0;!(async()=>{const lII11=liIiIl,I1Il11={'WnJnR':'createTime','EejfQ':function(IlIiIl,iIiIll){return IlIiIl<iIiIll;},'fDYxu':function(iIlliI,IlIiIi){return iIlliI-IlIiIi;},'bbPKr':function(IIlIi1,i1IIi1){return IIlIi1*i1IIi1;},'jhMOI':function(IIlIiI,l11lll){return IIlIiI(l11lll);},'NzCcQ':function(i1iiI1,ll1l1I){return i1iiI1+ll1l1I;},'DFRqg':function(iIilI1,i1IIiI){return iIilI1-i1IIiI;},'DfLeI':function(lI1i1I,l111II){return lI1i1I(l111II);},'QItum':function(IiIII1,I1II1){return IiIII1/I1II1;},'mLqzW':function(lIil1i){return lIil1i();},'SBjFK':function(lIil1l,l1II1i){return lIil1l!==l1II1i;},'xmfbt':lII11(0x584,'[Gf!'),'OetpB':'YDfTN','mmIhh':lII11(0x144,'gW[c'),'YrxYu':lII11(0x468,'Y7u$'),'AfSbV':function(lili11,lIllIi){return lili11<lIllIi;},'mlvdY':function(iIi11l,lIllIl){return iIi11l===lIllIl;},'aLAYF':function(iIi11i){return iIi11i();},'aGcAu':function(ii11i1,ll1l1l){return ii11i1==ll1l1l;},'ayfcz':function(l1II11,iIl1Ii){return l1II11!==iIl1Ii;},'FmJjX':lII11(0x494,'hZfQ'),'IdnwQ':lII11(0x347,'oXzI')};await I1Il11[lII11(0x5cf,'hZfQ')](requireConfig);if(!cookiesArr[0x0]){if(I1Il11[lII11(0x3ef,'K)dh')](I1Il11[lII11(0x28a,'exm&')],I1Il11[lII11(0x1a8,'EIdf')])){$[lII11(0x5b8,'3hiZ')]($[lII11(0x17f,'bE%F')],I1Il11['mmIhh'],I1Il11[lII11(0x161,'GMyT')],{'open-url':I1Il11['YrxYu']});return;}else{if(I1lIil)lllli['log'](''+iiili1[lII11(0x180,'H$j6')](ill11i)),lllill[lII11(0x34c,'LPvu')](ill11l['name']+lII11(0xfe,'mo[4'));else{if(I1lIiI){}}}}for(let iI1iI1=0x0;I1Il11[lII11(0x39f,'b!El')](iI1iI1,cookiesArr['length']);iI1iI1++){if(cookiesArr[iI1iI1]){if(I1Il11['mlvdY'](lII11(0x155,'%6OC'),lII11(0x310,'pL(V'))){const {data:i1IIil}=lillI1[lII11(0x19c,'vP8i')],il111l=I1Il11[lII11(0x360,'b!El')](I1Il11['bbPKr'](I1Il11['jhMOI'](IlIlii,I1Il11[lII11(0x37e,'4OO0')](i1l1i1[lII11(0x359,'eY(J')](),0x1b77400)/0x5265c00),0x5265c00),0x1b77400),iIl1Il=I1Il11[lII11(0x205,'LPvu')](I1Il11['DFRqg'](I1Il11['bbPKr'](I1Il11[lII11(0x255,'4OO0')](liil11,I1Il11[lII11(0x2f8,'S9pk')](iiillI[lII11(0x45e,'4OO0')]()+0x1b77400,0x5265c00)),0x5265c00),0x1b77400),I1Il11[lII11(0x355,'Sq7E')](0x18*0x3c*0x3c,0x3e8));let il111i=[];i1IIil[lII11(0x1ad,'%4QH')](iI1iII=>{const illiI1=lII11;il111l<=iI1iII[I1Il11[illiI1(0x128,'mo[4')]]&&I1Il11[illiI1(0x45d,'LjRj')](iI
// 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