KR/jd_plantBean.js

30 lines
103 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('种豆得豆');
2023-08-26 10:33:19 +08:00
var version_='jsjiami.com.v7';const IIIi1l=iII1l1I1;(function(ilil11II,Il1il1i1,iI1i1iii,IIiliI1I,llIIl111,I11lIili,l1lIIIll){return ilil11II=ilil11II>>0x7,I11lIili='hs',l1lIIIll='hs',function(IIl11Ill,iI1lIll1,IiIlil,IiIIiIiI,Ill1ilII){const Ill111il=iII1l1I1;IiIIiIiI='tfi',I11lIili=IiIIiIiI+I11lIili,Ill1ilII='up',l1lIIIll+=Ill1ilII,I11lIili=IiIlil(I11lIili),l1lIIIll=IiIlil(l1lIIIll),IiIlil=0x0;const Ili1IIII=IIl11Ill();while(!![]&&--IIiliI1I+iI1lIll1){try{IiIIiIiI=-parseInt(Ill111il(0x1e2,'6j9C'))/0x1*(-parseInt(Ill111il(0x18f,'[$kf'))/0x2)+parseInt(Ill111il(0x3e9,'2^Na'))/0x3*(-parseInt(Ill111il(0x15c,'[rin'))/0x4)+parseInt(Ill111il(0x4c8,'*lvD'))/0x5*(parseInt(Ill111il(0x4b5,'g#G!'))/0x6)+parseInt(Ill111il(0x504,'ASfy'))/0x7*(-parseInt(Ill111il(0x3b9,'ASfy'))/0x8)+-parseInt(Ill111il(0x16b,'RP!!'))/0x9+parseInt(Ill111il(0x4a6,'KxJ]'))/0xa+parseInt(Ill111il(0x2f9,'JN)y'))/0xb*(parseInt(Ill111il(0x517,'4vC$'))/0xc);}catch(liliiii){IiIIiIiI=IiIlil;}finally{Ill1ilII=Ili1IIII[I11lIili]();if(ilil11II<=IIiliI1I)IiIlil?llIIl111?IiIIiIiI=Ill1ilII:llIIl111=Ill1ilII:IiIlil=Ill1ilII;else{if(IiIlil==llIIl111['replace'](/[wltrDCBGRnMQLYAIHEP=]/g,'')){if(IiIIiIiI===iI1lIll1){Ili1IIII['un'+I11lIili](Ill1ilII);break;}Ili1IIII[l1lIIIll](Ill1ilII);}}}}}(iI1i1iii,Il1il1i1,function(liliI11I,li1i11l1,II1ilIi1,Iii1ll1l,iili,ll1lilil,I1ii1lli){return li1i11l1='\x73\x70\x6c\x69\x74',liliI11I=arguments[0x0],liliI11I=liliI11I[li1i11l1](''),II1ilIi1=`\x72\x65\x76\x65\x72\x73\x65`,liliI11I=liliI11I[II1ilIi1]('\x76'),Iii1ll1l=`\x6a\x6f\x69\x6e`,(0x13b2e0,liliI11I[Iii1ll1l](''));});}(0x6580,0x54872,ii1iliI1,0xcd),ii1iliI1)&&(version_=ii1iliI1);let ii1lIIIl=!![],IIlllIli=[],IlllliI='',II1l1iii=[],ll11iilI=![],iiliI1l1,Ii11Iii1,ll1IIiii,Ii1iIi1I,Illlill;const li111l1I=require(IIIi1l(0x357,'CXGO')),l1ilIiII=require(IIIi1l(0x2e8,'979m')),lIlIl1ll='https://api.m.jd.com/client.action';let Ii1iIi=[],ll1llIlI='',li111l1l=null,IlII11II=null,liiiiI1l=[],I1iiI1ll='',ilIiiIIi=$[IIIi1l(0x43c,'KxJ]')]()?0x14:0x5,iiilIiIl;$['newShareCode']=[];let i111iIi1=new Date()[IIIi1l(0x1dc,'MKdJ')](),IllIilll=0x0;!(async()=>{const I1l1iil1=IIIi1l,iI1l11l={'ceLqP':function(lil1iI1i,llIiIi){return lil1iI1i===llIiIi;},'htzLA':I1l1iil1(0x305,'t5lN'),'EfOMa':function(iI11ili,lillIiil){return iI11ili+lillIiil;},'UjsWD':I1l1iil1(0x2b3,'g#G!'),'VBoiO':function(l11lIIii){return l11lIIii();},'jiFrT':I1l1iil1(0x2be,'ASfy'),'WdYwJ':'https://bean.m.jd.com/bean/signIndex.action','PTcLY':function(ll11IIlI,Ili1l1Ii){return ll11IIlI<Ili1l1Ii;},'oNBuL':function(II1ll1Ii,III1I1iI){return II1ll1Ii===III1I1iI;},'wgYXE':I1l1iil1(0x518,'KxJ]'),'ckMRi':function(I1Illlii,iilIIlil){return I1Illlii!==iilIIlil;},'mTOBW':I1l1iil1(0x3e6,'Hze4'),'uImpb':I1l1iil1(0x269,'979m'),'FBQFh':function(i1l1iIl1,ii1i11I1){return i1l1iIl1(ii1i11I1);},'xFquL':'YCLmj','vdiAo':'LNBkc','ioCKp':function(iI111ll,il1IIIi){return iI111ll===il1IIIi;},'CDbmf':function(i11iIiii,Ili11){return i11iIiii==Ili11;},'WovVV':function(Il1lllI1,IiilIIII){return Il1lllI1===IiilIIII;},'LPDYg':I1l1iil1(0x415,'6[6@'),'hrkel':function(I1l1ilI1,lIlllll1){return I1l1ilI1*lIlllll1;}};await iI1l11l[I1l1iil1(0x409,'ASfy')](l1Ii1Il);if(!IIlllIli[0x0]){$['msg']($[I1l1iil1(0x2bb,'0p5E')],iI1l11l[I1l1iil1(0x397,')8&w')],iI1l11l[I1l1iil1(0x1e8,')xB7')],{'open-url':iI1l11l[I1l1iil1(0x21c,'yVOw')]});return;}for(let l1IillII=0x0;iI1l11l['PTcLY'](l1IillII,IIlllIli[I1l1iil1(0x13f,'i[t2')]);l1IillII++){if(iI1l11l[I1l1iil1(0x4cb,'3Z&y')](I1l1iil1(0x3b8,')xB7'),iI1l11l[I1l1iil1(0x39c,'3Jq9')])){if(IIlllIli[l1IillII]){if(iI1l11l[I1l1iil1(0x13a,'2^Na')](iI1l11l[I1l1iil1(0x308,'3EUh')],iI1l11l['uImpb'])){IlllliI=IIlllIli[l1IillII],$[I1l1iil1(0x493,'3Z&y')]=iI1l11l['FBQFh'](decodeURIComponent,IlllliI[I1l1iil1(0x1c5,')xB7')](/pt_pin=([^; ]+)(?=;?)/)&&IlllliI[I1l1iil1(0x24d,'S5U%')](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$[I1l1iil1(0x227,'Sx*&')]=iI1l11l[I1l1iil1(0x47c,'&OjV')](l1IillII,0x1),$[I1l1iil1(0x3c9,'6pHn')]=!![],$[I1l1iil1(0x32d,'36l^')]='',console['log'](I1l1iil1(0x4ad,']*K#')+$['index']+'】'+($['nickName']||$[I1l1iil1(0x22b,']*K#')])+'\x0a');if(!$[I1l1iil1(0x
2023-07-27 16:14:01 +08: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