2023-07-27 16:14:01 +08:00
|
|
|
|
/*
|
|
|
|
|
东东水果:脚本更新地址 jd_fruit_task.js
|
|
|
|
|
更新时间:2021-5-18
|
|
|
|
|
活动入口:京东APP我的-更多工具-东东农场
|
|
|
|
|
==========================Quantumultx=========================
|
|
|
|
|
[task_local]
|
2023-08-25 03:43:26 +08:00
|
|
|
|
#东东农场日常任务
|
2023-07-27 16:14:01 +08:00
|
|
|
|
5 6-18/6 * * * jd_fruit_task.js, tag=东东农场日常任务, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdnc.png, enabled=true
|
|
|
|
|
=========================Loon=============================
|
|
|
|
|
[Script]
|
|
|
|
|
cron "5 6-18/6 * * *" script-path=jd_fruit_task.js,tag=东东农场日常任务
|
|
|
|
|
|
|
|
|
|
=========================Surge============================
|
|
|
|
|
东东农场日常任务 = type=cron,cronexp="5 6-18/6 * * *",wake-system=1,timeout=3600,script-path=jd_fruit_task.js
|
|
|
|
|
|
|
|
|
|
=========================小火箭===========================
|
|
|
|
|
东东农场日常任务 = type=cron,script-path=jd_fruit_task.js, cronexpr="5 6-18/6 * * *", timeout=3600, enable=true
|
|
|
|
|
|
2023-08-25 11:05:55 +08:00
|
|
|
|
默认浇水,不浇水设置变量export jd_fruit_Water='true'
|
|
|
|
|
export DO_TEN_WATER_AGAIN="" 默认再次浇水
|
|
|
|
|
|
2023-08-25 23:03:50 +08:00
|
|
|
|
需要关闭通知 在第39行 false 改成 true
|
|
|
|
|
|
2023-07-27 16:14:01 +08:00
|
|
|
|
*/
|
|
|
|
|
const $ = new Env('东东农场日常任务');
|
2023-08-25 23:03:50 +08:00
|
|
|
|
let cookiesArr = [],
|
|
|
|
|
cookie = '',
|
|
|
|
|
jdFruitShareArr = [],
|
|
|
|
|
isBox = false,
|
|
|
|
|
notify,
|
|
|
|
|
newShareCodes,
|
|
|
|
|
allMessage = '';
|
|
|
|
|
let shareCodes = [];
|
|
|
|
|
let message = '',
|
|
|
|
|
subTitle = '',
|
|
|
|
|
option = {},
|
|
|
|
|
isFruitFinished = false;
|
|
|
|
|
const retainWater = $.isNode() ? (process.env.retainWater ? process.env.retainWater : 100) : $.getdata('retainWater') ? $.getdata('retainWater') : 100; //保留水滴大于多少g,默认100g;
|
|
|
|
|
let jdNotify = false; //是否关闭通知,false打开通知推送,true关闭通知推送
|
|
|
|
|
let jdFruitBeanCard = false; //农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),true表示换豆(不浇水),false表示不换豆(继续浇水),脚本默认是浇水
|
|
|
|
|
let randomCount = $.isNode() ? 20 : 5;
|
2023-08-28 13:29:15 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const IiII11i=liil1iIi;(function(Iiii1111,I11IiIll,i1IIl1lI,lI1liili,IIiIIlli,II11liIl,iIlIlI1){return Iiii1111=Iiii1111>>0x2,II11liIl='hs',iIlIlI1='hs',function(IlilIi,llIIlIIl,I1I1llIl,iIlii1ll,IlIillii){const lilI1i11=liil1iIi;iIlii1ll='tfi',II11liIl=iIlii1ll+II11liIl,IlIillii='up',iIlIlI1+=IlIillii,II11liIl=I1I1llIl(II11liIl),iIlIlI1=I1I1llIl(iIlIlI1),I1I1llIl=0x0;const ii11i11=IlilIi();while(!![]&&--lI1liili+llIIlIIl){try{iIlii1ll=-parseInt(lilI1i11(0x80e,'Wx3C'))/0x1+-parseInt(lilI1i11(0x2b1,'U6Vc'))/0x2+-parseInt(lilI1i11(0x8bf,'StB@'))/0x3*(parseInt(lilI1i11(0x5a7,'CyTO'))/0x4)+-parseInt(lilI1i11(0x88d,'8Eay'))/0x5+-parseInt(lilI1i11(0x872,'6My$'))/0x6+-parseInt(lilI1i11(0x558,'4J6M'))/0x7+parseInt(lilI1i11(0x5cc,'J#t)'))/0x8;}catch(iIl1l1l){iIlii1ll=I1I1llIl;}finally{IlIillii=ii11i11[II11liIl]();if(Iiii1111<=lI1liili)I1I1llIl?IIiIIlli?iIlii1ll=IlIillii:IIiIIlli=IlIillii:I1I1llIl=IlIillii;else{if(I1I1llIl==IIiIIlli['replace'](/[IhMBUGTxVktlbNYrJH=]/g,'')){if(iIlii1ll===llIIlIIl){ii11i11['un'+II11liIl](IlIillii);break;}ii11i11[iIlIlI1](IlIillii);}}}}}(i1IIl1lI,I11IiIll,function(IIII1i11,I1IiiiII,i111IIi,lI1iIil1,I11I1lI,I11lliI1,IIIIiiIi){return I1IiiiII='\x73\x70\x6c\x69\x74',IIII1i11=arguments[0x0],IIII1i11=IIII1i11[I1IiiiII](''),i111IIi=`\x72\x65\x76\x65\x72\x73\x65`,IIII1i11=IIII1i11[i111IIi]('\x76'),lI1iIil1=`\x6a\x6f\x69\x6e`,(0x13b7cc,IIII1i11[lI1iIil1](''));});}(0x320,0xa4cae,i1II1iIi,0xca),i1II1iIi)&&(version_=i1II1iIi);let i1i1liii=process['env'][IiII11i(0x593,'l#6P')]===IiII11i(0x8d8,'4QYw')?!![]:![];const illi1ilI='https://api.m.jd.com/client.action',II1Il11=IiII11i(0x87b,'StB@'),i1lliII=require(IiII11i(0x3cf,'RQLl')),llIlIl1=require(IiII11i(0x22f,'hYot')),I1lI11ll=require(IiII11i(0x246,'Nqnr'));let liIl1I=iiiiliIl(0x28),iiiilIl=iiiiliIl(0xa,'123456789'),ll11i1li=iiiiliIl(0x20,IiII11i(0x45b,'(NpO')),iIlliili=iiiiliIl(0x2,IiII11i(0x552,'U6Vc'))+'-'+iiiiliIl(0x4,IiII11i(0x3a0,'6My$'))+'-'+iiiiliIl(0x4,'1234567890')+'-'+iiiiliIl(0x5,IiII11i(0x8de,'i2H0')),llIl11ii=IiII11i(0x93b,'cwPS')+Math[IiII11i(0x3e8,'O)6G')](Math[IiII11i(0x6aa,'#qdi')]()*0x383+0x64),IilIIi1l='29.503'+Math[IiII11i(0x8fb,'7ki%')](Math['random']()*0x383+0x64),IiiIiil1='',i111lIii=0x0;!(async()=>{const l1lI1il1=IiII11i,i1i11i1i={'yiErW':function(lill1iI1,il11IIIl){return lill1iI1<il11IIIl;},'fEZEr':function(li1i1lI1,ll1I111i){return li1i1lI1==ll1I111i;},'cadYo':l1lI1il1(0x90c,'1Xqr'),'ixdkt':function(iiIllliI){return iiIllliI();},'JfuGy':function(Ii1ill11,lllll1II){return Ii1ill11!==lllll1II;},'XuVKi':l1lI1il1(0x628,'bmWA'),'JWlHJ':'https://bean.m.jd.com/bean/signIndex.action','WlBHk':function(Iii111li,Ili1I1II){return Iii111li===Ili1I1II;},'PpEjt':l1lI1il1(0x8a9,'7ki%'),'jUhpN':l1lI1il1(0x361,'c0])'),'BucZG':function(I1IllIli,IiIiliI1){return I1IllIli(IiIiliI1);},'EeUjl':function(ll1iiili,ilII1i1I){return ll1iiili+ilII1i1I;},'uyxZO':function(ll1i1l1l,I11ll1i){return ll1i1l1l!==I11ll1i;},'LdlWD':'VnHmG','Hlfvf':'wCQao','NaNDm':function(il1Iiill){return il1Iiill();},'GIoms':function(llIlII,l1II11I){return llIlII*l1II11I;},'jMRWo':l1lI1il1(0x51c,'rX1B')};await i1i11i1i[l1lI1il1(0x667,'1Xqr')](IliiIll);if(!cookiesArr[0x0]){if(i1i11i1i[l1lI1il1(0x58d,'7ki%')](i1i11i1i[l1lI1il1(0x81d,'%oui')],i1i11i1i[l1lI1il1(0x3f8,'nAxC')])){let Ii1IllIi='';for(let IIiill1=0x0;i1i11i1i[l1lI1il1(0x267,'i2H0')](IIiill1,iiI1iII1);IIiill1++){Ii1IllIi+=iiiIi1lI[i1iI1Iii['floor'](I1Ililii[l1lI1il1(0x4ea,'*7Fx')]()*il11lII1['length'])];}return Ii1IllIi;}else{$[l1lI1il1(0x69b,'s)WY')]($[l1lI1il1(0x690,'O)6G')],l1lI1il1(0x666,'$Ou!'),'https://bean.m.jd.com/bean/signIndex.action',{'open-url':i1i11i1i[l1lI1il1(0x1f7,'4QYw')]});return;}}console[l1lI1il1(0x917,'(NpO')]('\x0a【若多次提示403,务必更换IP运行.....】\x0a');for(let iliiIIIl=0x0;iliiIIIl<cookiesArr[l1lI1il1(0x268,'prEj')];iliiIIIl++){if(i1i11i1i['WlBHk'](l1lI1il1(0x437,'j[[t'),l1lI1il1(0x554,'StB@'))){if(cookiesArr[iliiIIIl]){if(i1i11i1i[l1lI1il1(0x75f,'(NpO')](i1i11i1i['PpEjt'],i1i11i1i[l1lI1il1(0x417,'F3^x')]))I1i11Ii['log'](l1lI1il1(0x627,'SQ4]'));else{cookie=coo
|
2023-07-27 16:14:01 +08:00
|
|
|
|
// prettier-ignore
|
2023-08-25 03:43:26 +08:00
|
|
|
|
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
|