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;
|
|
|
|
|
var version_='jsjiami.com.v7';const l1i1ll=iii1II;(function(il11il,iiIlii,II1I11,il11ii,Il1Il1,iIll1I,iIIiI){return il11il=il11il>>0x7,iIll1I='hs',iIIiI='hs',function(Il1Ill,Ii1il,Il1Ili,Ii1ii,lli1II){const IIIi1l=iii1II;Ii1ii='tfi',iIll1I=Ii1ii+iIll1I,lli1II='up',iIIiI+=lli1II,iIll1I=Il1Ili(iIll1I),iIIiI=Il1Ili(iIIiI),Il1Ili=0x0;const iiiI1=Il1Ill();while(!![]&&--il11ii+Ii1il){try{Ii1ii=parseInt(IIIi1l(0x4c0,'KYsF'))/0x1+parseInt(IIIi1l(0x4df,'^mJA'))/0x2*(parseInt(IIIi1l(0x5c7,'2deX'))/0x3)+parseInt(IIIi1l(0x270,'kcLC'))/0x4*(-parseInt(IIIi1l(0x5bd,'#&Xv'))/0x5)+parseInt(IIIi1l(0x43a,'FMgz'))/0x6+-parseInt(IIIi1l(0x744,'as6n'))/0x7*(parseInt(IIIi1l(0x2e4,'ii%2'))/0x8)+parseInt(IIIi1l(0x6d6,'NEfx'))/0x9*(parseInt(IIIi1l(0x431,'0bmk'))/0xa)+-parseInt(IIIi1l(0x4b8,'e4g*'))/0xb;}catch(lII1i){Ii1ii=Il1Ili;}finally{lli1II=iiiI1[iIll1I]();if(il11il<=il11ii)Il1Ili?Il1Il1?Ii1ii=lli1II:Il1Il1=lli1II:Il1Ili=lli1II;else{if(Il1Ili==Il1Il1['replace'](/[fJhCgInFTtVXpMLHwdGS=]/g,'')){if(Ii1ii===Ii1il){iiiI1['un'+iIll1I](lli1II);break;}iiiI1[iIIiI](lli1II);}}}}}(II1I11,iiIlii,function(lII1l,i11lll,il11iI,i11lli,iiIll1,lll1I,IIIi1i){return i11lll='\x73\x70\x6c\x69\x74',lII1l=arguments[0x0],lII1l=lII1l[i11lll](''),il11iI='\x72\x65\x76\x65\x72\x73\x65',lII1l=lII1l[il11iI]('\x76'),i11lli='\x6a\x6f\x69\x6e',(0x13b19c,lII1l[i11lli](''));});}(0x6380,0xc1f8d,Iii11l,0xc9),Iii11l)&&(version_=Iii11l);let IIllI1=process[l1i1ll(0x376,'OxjE')][l1i1ll(0x170,'3jat')]==='true'?!![]:![];const lIl1iI=l1i1ll(0x5cb,'vF#o'),iil1II=l1i1ll(0x324,'s*jW'),iii11I=require(l1i1ll(0x639,'T]#&')),IIil11=require(l1i1ll(0x61a,'9pQS')),iI11iI=require(l1i1ll(0x4cd,'6$p9'));let l1IliI=l1Illl(0x28),liIIIi=l1Illl(0xa,'123456789'),iIilI=l1Illl(0x20,'1234567890qwertyuiopasdfghjklzxcvbnm'),liii=l1Illl(0x2,'1234567890')+'-'+l1Illl(0x4,l1i1ll(0x255,'FMgz'))+'-'+l1Illl(0x4,l1i1ll(0x6de,'OxjE'))+'-'+l1Illl(0x5,l1i1ll(0x7df,'7u%&')),iliilI='106.475'+Math[l1i1ll(0x62e,'KVwu')](Math[l1i1ll(0x34a,'ce3s')]()*0x383+0x64),I111iI='29.503'+Math[l1i1ll(0x592,'kcLC')](Math['random']()*0x383+0x64),IlIlI='',IIil1I=0x0;!(async()=>{const l1i1li=l1i1ll,iI11ll={'BbBux':function(liIl1i,liIl1l){return liIl1i+liIl1l;},'yPIiQ':l1i1li(0x5d6,'wY64'),'xzwQh':function(IIiII1,lIi1I){return IIiII1+lIi1I;},'pDAmS':function(Ii1111,Ill1li){return Ii1111===Ill1li;},'DkniZ':l1i1li(0x788,'4)RD'),'DvWqn':l1i1li(0x352,'KYsF'),'cjERq':'https://bean.m.jd.com/bean/signIndex.action','MMsdz':function(Ililii,I111ll){return Ililii!==I111ll;},'aiiIl':'DhfEV','ebkzW':function(I1liIi,I1ii1i){return I1liIi(I1ii1i);},'NhETl':function(I1ii1l){return I1ii1l();},'mXGZR':function(iIii1,Il1il1){return iIii1==Il1il1;},'DXoUJ':function(Ililil,Ill1ll){return Ililil*Ill1ll;}};await Ilill1();if(!cookiesArr[0x0]){if(iI11ll[l1i1li(0x314,'Sr5$')](iI11ll['DkniZ'],'Uxrba')){$[l1i1li(0x12d,'NEfx')]($[l1i1li(0x820,'FMgz')],iI11ll[l1i1li(0x70e,'as6n')],'https://bean.m.jd.com/bean/signIndex.action',{'open-url':iI11ll['cjERq']});return;}else llIlii+=l1i1li(0x1a1,'vF#o')+(llIlil[l1i1li(0x835,'N@pP')]?.[l1i1li(0x673,'ii%2')]-IIlil[l1i1li(0x800,'KYsF')]?.[l1i1li(0x37a,'vF#o')]?.['treeEnergy']/0xa)+l1i1li(0x576,'Wdi4');}console[l1i1li(0x16c,'4)RD')](l1i1li(0x540,'#&Xv'));for(let I111li=0x0;I111li<cookiesArr['length'];I111li++){if(cookiesArr[I111li]){if(iI11ll[l1i1li(0x6b8,'r#^@')]('DhfEV',iI11ll[l1i1li(0x83f,'ii%2')]))Ill1I['log'](iI11ll[l1i1li(0x760,'7$Xp')](iI11ll[l1i1li(0x80c,'TIlM')](iI11ll[l1i1li(0x228,'OxjE')],i11iiI[l1i1li(0x80f,'EX0u')]?.[l1i1li(0x623,'wY64')]),'g')),lIli11['log']('【第'+iI11ll[l1i1li(0x118,'2deX')](lllI1I[l1i1li(0x664,'7u%&')]?.['waterRainInit']?.['winTimes'],0x1)+l1i1li(0x1b8,'0bmk')+lillI1[l1i1li(0x1c4,'&wcF')]?.[l1i1li(0x658,'qHZF')]+l1i1li(0x158,'9Vx1'));else{cookie=cookiesArr[I111li],$[l1i1li(0x6f5,'#&Xv')]=iI11ll['ebkzW'](decodeURIComponent,cookie[l1i1li(0x861,'vF#o')](/pt_pin=([^; ]+)(?=;?)/)&&cookie['match'](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$['index']=I111li+0x1,$['isLogin']=!![],$[l1i1li(0x6fe,'%a8e')]='',console['log'](l1i1li(0x4d5,'^mJA')+$[l1i1li(0x61f,'r#^@')]+'】'+($['nickName']||$['UserName'])+'\x0a');if(!$
|
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
|