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-10-31 01:41:38 +08:00
|
|
|
|
默认浇水,不浇水设置变量 export jd_fruit_Water="true"
|
|
|
|
|
默认在完成每日任务后再次浇水,若保留水滴请设置变量 export DO_TEN_WATER_AGAIN="false"
|
2023-08-25 23:03:50 +08:00
|
|
|
|
|
2023-07-27 16:14:01 +08:00
|
|
|
|
*/
|
2023-10-31 01:41:38 +08:00
|
|
|
|
const $ = new Env('东东农场日常任务')
|
2023-08-25 23:03:50 +08:00
|
|
|
|
let cookiesArr = [],
|
|
|
|
|
cookie = '',
|
|
|
|
|
jdFruitShareArr = [],
|
|
|
|
|
isBox = false,
|
|
|
|
|
notify,
|
|
|
|
|
newShareCodes,
|
2023-10-31 01:41:38 +08:00
|
|
|
|
allMessage = ''
|
|
|
|
|
let shareCodes = []
|
2023-08-25 23:03:50 +08:00
|
|
|
|
let message = '',
|
|
|
|
|
subTitle = '',
|
|
|
|
|
option = {},
|
2023-10-31 01:41:38 +08:00
|
|
|
|
isFruitFinished = false
|
|
|
|
|
const retainWater = $.isNode() ? (process.env.retainWater ? process.env.retainWater : 100) : $.getdata('retainWater') ? $.getdata('retainWater') : 100 //保留水滴大于多少g,默认100g;
|
|
|
|
|
let jdNotify = true //是否关闭通知,false打开通知推送,true关闭通知推送
|
|
|
|
|
let jdFruitBeanCard = false //农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),true表示换豆(不浇水),false表示不换豆(继续浇水),脚本默认是浇水
|
|
|
|
|
let randomCount = $.isNode() ? 20 : 5
|
|
|
|
|
var version_='jsjiami.com.v7';const l11l=iii1II;(function(iII1lI,lIll1i,iiIlli,iII1,Ii11i1,lIll1l,Il1lIl){return iII1lI=iII1lI>>0x7,lIll1l='hs',Il1lIl='hs',function(I1111I,I1I11,il11l1,I1I1l,i1II1I){const llllii=iii1II;I1I1l='tfi',lIll1l=I1I1l+lIll1l,i1II1I='up',Il1lIl+=i1II1I,lIll1l=il11l1(lIll1l),Il1lIl=il11l1(Il1lIl),il11l1=0x0;const IIiliI=I1111I();while(!![]&&--iII1+I1I11){try{I1I1l=parseInt(llllii(0x5a9,'2[hp'))/0x1*(-parseInt(llllii(0x82e,'*(FJ'))/0x2)+parseInt(llllii(0x702,'UzfP'))/0x3+-parseInt(llllii(0x7b5,'CSbT'))/0x4+-parseInt(llllii(0x768,'CSbT'))/0x5*(parseInt(llllii(0x31c,'2[hp'))/0x6)+-parseInt(llllii(0x4ae,'gjl4'))/0x7+-parseInt(llllii(0x8b5,'%Zrk'))/0x8+parseInt(llllii(0x8a5,'zyIN'))/0x9;}catch(I1I1i){I1I1l=il11l1;}finally{i1II1I=IIiliI[lIll1l]();if(iII1lI<=iII1)il11l1?Ii11i1?I1I1l=i1II1I:Ii11i1=i1II1I:il11l1=i1II1I;else{if(il11l1==Ii11i1['replace'](/[hgbBLSOnPETVUJRfNYxl=]/g,'')){if(I1I1l===I1I11){IIiliI['un'+lIll1l](i1II1I);break;}IIiliI[Il1lIl](i1II1I);}}}}}(iiIlli,lIll1i,function(iiiiii,iiiiil,l1Il11,IIl1lI,ilii1i,IiliIl,ilii1l){return iiiiil='\x73\x70\x6c\x69\x74',iiiiii=arguments[0x0],iiiiii=iiiiii[iiiiil](''),l1Il11=`\x72\x65\x76\x65\x72\x73\x65`,iiiiii=iiiiii[l1Il11]('\x76'),IIl1lI=`\x6a\x6f\x69\x6e`,(0x145268,iiiiii[IIl1lI](''));});}(0x6400,0x1fbe8,Iii11l,0xca),Iii11l)&&(version_=l11l(0x5b6,'vRS4'));let l1ilI=process[l11l(0x5d9,'zyIN')][l11l(0x24c,'E%FH')]==='true'?!![]:![];const IIi1=l11l(0x5d4,'&qo*'),illl1i=l11l(0x513,'!f2K'),l1iiii=require(l11l(0x7c0,'5*3f')),iiiIi1=require('./function/getH5st'),illl1l=require(l11l(0x3aa,'gjl4'));let Il11I=l1iI1I(0x28),li1lll=l1iI1I(0xa,'123456789'),lill1=l1iI1I(0x20,l11l(0x41d,'rc[8')),IiIIl=l1iI1I(0x2,l11l(0x429,'IwRv'))+'-'+l1iI1I(0x4,l11l(0x5f9,'d#U%'))+'-'+l1iI1I(0x4,l11l(0x407,'rc[8'))+'-'+l1iI1I(0x5,'1234567890'),IiIIi=l11l(0x784,'VVrB')+Math[l11l(0x3da,'mH7V')](Math[l11l(0x83c,'!f2K')]()*0x383+0x64),li1lli=l11l(0x232,'&*LK')+Math['floor'](Math['random']()*0x383+0x64),iiiIl1='',I1i1I=0x0;!(async()=>{const illiII=l11l,l1I1I={'EcymN':function(l1lII1,iilllI){return l1lII1(iilllI);},'pkofZ':function(i1i1iI){return i1i1iI();},'oQrnm':illiII(0x366,'*(FJ'),'oRXLL':illiII(0x7a6,'ifkY'),'uhdxW':function(iillil,iillii){return iillil<iillii;},'saWkF':function(ilI1iI,l1I1i){return ilI1iI!==l1I1i;},'FOfYi':illiII(0x271,'8%Ha'),'zxRjW':function(l1I1l){return l1I1l();},'IiCDP':function(i11II,IlIi1){return i11II*IlIi1;},'BmOHD':function(i1i1il,i1i1ii){return i1i1il!==i1i1ii;},'bjRIr':'vMxDK','PTuPQ':illiII(0x47f,'iK]G')};await l1I1I['pkofZ'](iilll1);if(!cookiesArr[0x0]){$[illiII(0x275,'YRXk')]($[illiII(0x534,'h]G)')],l1I1I['oQrnm'],l1I1I[illiII(0x75a,'iK]G')],{'open-url':illiII(0x3a8,'E4lJ')});return;}console[illiII(0x7a2,'JuAQ')](illiII(0x485,'Dh2p'));for(let Il1ill=0x0;l1I1I['uhdxW'](Il1ill,cookiesArr[illiII(0x41a,'dM]b')]);Il1ill++){if(cookiesArr[Il1ill]){cookie=cookiesArr[Il1ill],$[illiII(0x438,'o052')]=l1I1I[illiII(0x22e,'#Ejq')](decodeURIComponent,cookie[illiII(0x470,'YRXk')](/pt_pin=([^; ]+)(?=;?)/)&&cookie['match'](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$[illiII(0x68f,'Zxh*')]=Il1ill+0x1,$[illiII(0x257,'E%FH')]=!![],$[illiII(0x269,'ifkY')]='',console[illiII(0x314,'%Zrk')](illiII(0x5b5,'%Zrk')+$['index']+'】'+($['nickName']||$[illiII(0x47b,'VVrB')])+'\x0a');if(!$[illiII(0x257,'E%FH')]){$['msg']($[illiII(0x277,'*r3N')],'【提示】cookie已失效','京东账号'+$['index']+'\x20'+($[illiII(0x446,'dhR2')]||$['UserName'])+illiII(0x7fa,'2[hp'),{'open-url':illiII(0x7b8,'8%Ha')});$[illiII(0x7b3,'#Ejq')]()&&(l1I1I[illiII(0x881,'odvQ')](l1I1I['FOfYi'],l1I1I[illiII(0x66f,'#CO7')])?ll11l=illiII(0x555,'WjlY')+III111+'&body='+l1I1I[illiII(0x211,'5*3f')](liIll1,l1llli[illiII(0x809,'gjl4')](iI1lII))+illiII(0x6d1,'1rXW'):await notify['sendNotify']($[illiII(0x5d0,'YRXk')]+'cookie已失效\x20-\x20'+$[illiII(0x77b,'^*kr')],'京东账号'+$[illiII(0x5ba,']Kl@')]+'\x20'+$[illiII(0x7f5,'&*LK')]+illiII(0x77d,'AlHW')));continue;}message='',subTitle='',option={},$['UA']=l1iiii[illiII(0x58f,'*r3N')]($[illiII(0x205,'&JGX')]),$['retry']=0x0,I1i1I++,await l1I1I['zxRjW'](IIl1),I1i1I==0x5&&(c
|
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
|