jdpro/jd_plantBean_help.js

30 lines
89 KiB
JavaScript
Raw Normal View History

2024-01-02 12:59:48 +00:00
/*
种豆得豆 脚本更新地址jd_plantBean_help.js
更新时间2021-08-20
活动入口京东APP我的-更多工具-种豆得豆
已支持IOS京东多账号,云端多京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
会自动关注任务中的店铺跟商品介意者勿使用
互助码shareCode请先手动运行脚本查看打印可看到
每个京东账号每天只能帮助3个人多出的助力码将会助力失败
=====================================Quantumult X=================================
[task_local]
33 3,15 * * * https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean_help.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true
=====================================Loon================================
[Script]
cron "33 3,15 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean_help.js,tag=京东种豆得豆
======================================Surge==========================
京东种豆得豆 = type=cron,cronexp="33 3,15 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean_help.js
====================================小火箭=============================
京东种豆得豆 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean_help.js, cronexpr="33 3,15 * * *", timeout=3600, enable=true
*/
const $ = new Env('种豆得豆内部互助');
var version_='jsjiami.com.v7';const iI1II=iii1II;(function(iI1iIl,lili1i,iI1Ii,IiIIIl,IiIIIi,lI11l,iI1Il){return iI1iIl=iI1iIl>>0x8,lI11l='hs',iI1Il='hs',function(i111il,i111ii,lI11i,ilI11,li1llI){const li1ll1=iii1II;ilI11='tfi',lI11l=ilI11+lI11l,li1llI='up',iI1Il+=li1llI,lI11l=lI11i(lI11l),iI1Il=lI11i(iI1Il),lI11i=0x0;const lIil11=i111il();while(!![]&&--IiIIIl+i111ii){try{ilI11=-parseInt(li1ll1(0xe2,'^Acz'))/0x1+-parseInt(li1ll1(0x267,'XyeI'))/0x2*(-parseInt(li1ll1(0x30a,'PXAG'))/0x3)+-parseInt(li1ll1(0x24f,'$f*H'))/0x4+-parseInt(li1ll1(0x302,'T&CL'))/0x5*(parseInt(li1ll1(0x31d,'gPHH'))/0x6)+-parseInt(li1ll1(0x31a,'qbs*'))/0x7+-parseInt(li1ll1(0x2bc,'q)Cs'))/0x8*(parseInt(li1ll1(0x328,'LkKR'))/0x9)+-parseInt(li1ll1(0x1f1,')(qz'))/0xa*(-parseInt(li1ll1(0xf5,'XCXy'))/0xb);}catch(iIilII){ilI11=lI11i;}finally{li1llI=lIil11[lI11l]();if(iI1iIl<=IiIIIl)lI11i?IiIIIi?ilI11=li1llI:IiIIIi=li1llI:lI11i=li1llI;else{if(lI11i==IiIIIi['replace'](/[SNOXrGhBqfpTDFRCntu=]/g,'')){if(ilI11===i111ii){lIil11['un'+lI11l](li1llI);break;}lIil11[iI1Il](li1llI);}}}}}(iI1Ii,lili1i,function(lIlI1,lIllI1,Ill1,lI1i1i,il1IiI,il1Ii1,lI1i1l){return lIllI1='\x73\x70\x6c\x69\x74',lIlI1=arguments[0x0],lIlI1=lIlI1[lIllI1](''),Ill1='\x72\x65\x76\x65\x72\x73\x65',lIlI1=lIlI1[Ill1]('\x76'),lI1i1i='\x6a\x6f\x69\x6e',(0x133586,lIlI1[lI1i1i](''));});}(0xc700,0x81502,Iii11l,0xc9),Iii11l)&&(version_=Iii11l);let jdNotify=!![],cookiesArr=[],cookie='',jdPlantBeanShareArr=[],isBox=![],notify,newShareCodes,option,message,subTitle;const cryptoJS=require(iI1II(0x303,'HtFx')),base64_mod_charset=iI1II(0x1d3,'HtFx'),getToken=require(iI1II(0x35a,'qbs*')),JD_API_HOST=iI1II(0x2a6,'%yBs');let shareCodes=[],allMessage='',currentRoundId=null,lastRoundId=null,roundList=[],awardState='',randomCount=$[iI1II(0x114,'mMUh')]()?0x14:0x5,num;$[iI1II(0x2fd,'tC7o')]=[];let llerror=![],lnrun=0x0,lnruns=0x0;!(async()=>{const lIil1I=iI1II,Ii1lIl={'yBpYu':function(iIIIiI,li1iI){return iIIIiI*li1iI;},'lWBGt':function(I1IIi1,ll1lI1){return I1IIi1+ll1lI1;},'RPPnv':function(II1ll,liii11){return II1ll!==liii11;},'HUAmW':lIil1I(0x3e1,'8zf6'),'Chhoc':lIil1I(0x19f,'PXAG'),'bRhWm':function(lIiIii,i1Ill){return lIiIii===i1Ill;},'JeUME':'NUtNK','lnyTF':function(Il1I11,lIl1II){return Il1I11!==lIl1II;},'ykYOD':'xaRjj','yqaZy':function(Ii1Ili){return Ii1Ili();},'ViVDG':lIil1I(0x192,'qSn*')};await requireConfig();if(!cookiesArr[0x0]){if(Ii1lIl[lIil1I(0x246,'$f*H')](Ii1lIl['HUAmW'],Ii1lIl[lIil1I(0xc4,'8zf6')]))lIli1l=lillIi[lIil1I(0x35b,'qbs*')](illIi1);else{$['msg']($[lIil1I(0x371,'LmzE')],'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取',Ii1lIl['Chhoc'],{'open-url':'https://bean.m.jd.com/bean/signIndex.action'});return;}}for(let Ii1Ill=0x0;Ii1Ill<cookiesArr['length'];Ii1Ill++){if(cookiesArr[Ii1Ill]){if(Ii1lIl['bRhWm'](lIil1I(0x401,'!(1T'),Ii1lIl[lIil1I(0x95,'HV7a')]))ii1lI[lIil1I(0x423,'Rh[k')](I1ilIl)[lIil1I(0xe3,'Q(f$')](IIlII1=>{const IiIIII=lIil1I;llIlli[IIlII1]&&Iiii1['shareCodesArr'][IiIIII(0x1cd,'s0#r')](lIIili[IIlII1]);});else{cookie=cookiesArr[Ii1Ill],$[lIil1I(0x2d8,'qbs*')]=decodeURIComponent(cookie[lIil1I(0xc3,'6@Ey')](/pt_pin=([^; ]+)(?=;?)/)&&cookie['match'](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$[lIil1I(0x18d,'sj6t')]=Ii1lIl[lIil1I(0x3ef,'T[Zz')](Ii1Ill,0x1),$[lIil1I(0x17c,'xQ]3')]=!![],$[lIil1I(0xc9,'7k8J')]='',$['hotFlag']=![],console['log']('\x0a开始【京东账号'+$[lIil1I(0x1a4,'wNFs')]+'】'+($['nickName']||$['UserName'])+'\x0a');if(!$['isLogin']){if(Ii1lIl[lIil1I(0x159,'xQ]3')](Ii1lIl[lIil1I(0x285,'T3cD')],lIil1I(0x339,'Rh[k')))return Ii1ii1[Ilil11['floor'](Ii1lIl['yBpYu'](i1ii1[lIil1I(0x2e0,'JY*w')](),il1ii['length']))];else{$[lIil1I(0x2f8,'ZZrG')]($[lIil1I(0x17b,'HV7a')],lIil1I(0x326,'8zf6'),lIil1I(0x15b,'sj6t')+$[lIil1I(0x210,'s0#r')]+'\x20'+($['nickName']||$[lIil1I(0x355,'iXZ3')])+'\x0a请重新登录获取\x0ahttps://bean.m.jd.com/bean/signIndex.action',{'open-url':Ii1lIl[lIil1I(0x19e,'HV7a')]});$['isNode']()&&await notify[lIil1I(0x28b,'h5vV')]($[lIil1I(0x2f0,'#pxD')]+'cookie已失效\x20-\x20'+$['UserName'],lIil1I(0x377,'!(1T')+$[lIil1I(0x3a2,'Q
// 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