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-29 15:38:30 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const lIIllIi=i1111I1;(function(Ill1IlII,i11lI1iI,llliIlII,liIIilll,l11I1i,Ii1ili11,iIiiii1i){return Ill1IlII=Ill1IlII>>0x8,Ii1ili11='hs',iIiiii1i='hs',function(l1Illi1I,I1lIll1,ii1111I1,IliIIIil,ii1liiI1){const lIl1lIIi=i1111I1;IliIIIil='tfi',Ii1ili11=IliIIIil+Ii1ili11,ii1liiI1='up',iIiiii1i+=ii1liiI1,Ii1ili11=ii1111I1(Ii1ili11),iIiiii1i=ii1111I1(iIiiii1i),ii1111I1=0x0;const liIii1iI=l1Illi1I();while(!![]&&--liIIilll+I1lIll1){try{IliIIIil=parseInt(lIl1lIIi(0x47d,'hpOF'))/0x1+parseInt(lIl1lIIi(0x894,'OtT%'))/0x2+-parseInt(lIl1lIIi(0x7b8,'EP)]'))/0x3+parseInt(lIl1lIIi(0x1d7,'dHvC'))/0x4+parseInt(lIl1lIIi(0x269,'QMUX'))/0x5*(-parseInt(lIl1lIIi(0x161,'Zyo('))/0x6)+parseInt(lIl1lIIi(0x1e3,'5DAp'))/0x7+parseInt(lIl1lIIi(0x192,']iKv'))/0x8*(-parseInt(lIl1lIIi(0x381,'2@2y'))/0x9);}catch(iII1ii11){IliIIIil=ii1111I1;}finally{ii1liiI1=liIii1iI[Ii1ili11]();if(Ill1IlII<=liIIilll)ii1111I1?l11I1i?IliIIIil=ii1liiI1:l11I1i=ii1liiI1:ii1111I1=ii1liiI1;else{if(ii1111I1==l11I1i['replace'](/[KkVIFOGTCrxfhLWXeYUgQ=]/g,'')){if(IliIIIil===I1lIll1){liIii1iI['un'+Ii1ili11](ii1liiI1);break;}liIii1iI[iIiiii1i](ii1liiI1);}}}}}(llliIlII,i11lI1iI,function(lIIl1i,IIiliII,iIlilIil,I11l11ll,IiI1I1l,i1IlIl1I,il1lliil){return IIiliII='\x73\x70\x6c\x69\x74',lIIl1i=arguments[0x0],lIIl1i=lIIl1i[IIiliII](''),iIlilIil=`\x72\x65\x76\x65\x72\x73\x65`,lIIl1i=lIIl1i[iIlilIil]('\x76'),I11l11ll=`\x6a\x6f\x69\x6e`,(0x13ba3c,lIIl1i[I11l11ll](''));});}(0xc900,0xee02a,lIiI1lIl,0xcb),lIiI1lIl)&&(version_=lIiI1lIl);let iilii1l=process[lIIllIi(0x267,'9mh4')][lIIllIi(0x39b,'%Wra')]===lIIllIi(0x326,'EP)]')?!![]:![];const Il1iIlll=lIIllIi(0x34a,'gdBj'),Ill1IIii='openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html%22%20%7D',I1l11iI1=require('./function/krgetToken'),IIiii1iI=require(lIIllIi(0x272,'nus2')),lIIillII=require(lIIllIi(0x320,'*tRK'));let lllI1i1=l1liii(0x28),lIiIIi1l=l1liii(0xa,'123456789'),I1ll1liI=l1liii(0x20,lIIllIi(0x3e2,']g*C')),iIlIllIi=l1liii(0x2,'1234567890')+'-'+l1liii(0x4,'1234567890')+'-'+l1liii(0x4,'1234567890')+'-'+l1liii(0x5,lIIllIi(0x617,'PWmT')),l1iiIii1='106.475'+Math[lIIllIi(0x533,'hGQC')](Math[lIIllIi(0x5ed,'oj#5')]()*0x383+0x64),IlIlIiii=lIIllIi(0x529,']g*C')+Math['floor'](Math['random']()*0x383+0x64),ili1iiII='',iilI1III=0x0;!(async()=>{const i1i11IiI=lIIllIi,lii1iIil={'pnoGD':i1i11IiI(0x895,'EP)]'),'pJUbl':function(lIll1l1l,liiiI1li){return lIll1l1l===liiiI1li;},'ZmOZa':'false','rNjwX':'保留水滴不足,停止继续浇水','VkAUV':function(l1i1IIii){return l1i1IIii();},'mQQRG':function(I1l1llI1,lI1I1llI){return I1l1llI1!==lI1I1llI;},'moHXA':i1i11IiI(0xe2,'hGQC'),'SBCFp':i1i11IiI(0x5c0,'[EVl'),'kVZAZ':i1i11IiI(0x727,'V#V('),'EejOT':i1i11IiI(0x650,'bSPl'),'FVsWG':i1i11IiI(0x752,'ve*T'),'zASUG':function(i1I1IiIi,llIIli1l){return i1I1IiIi!==llIIli1l;},'PYMHY':i1i11IiI(0x845,'bSPl'),'QQmwH':function(Iiili11I,i1l11ii1){return Iiili11I===i1l11ii1;},'TCBTd':i1i11IiI(0x10d,'*Quv'),'ewHoy':function(illlIi1,I11li1il){return illlIi1===I11li1il;},'rxpBf':i1i11IiI(0x48c,'DIR6'),'ecVoC':function(llIlIiII,Iil1I1Il){return llIlIiII==Iil1I1Il;},'TDmyC':function(i1IliiiI,l111111){return i1IliiiI*l111111;},'ttfgf':function(li1llii,ilii1ll1){return li1llii*ilii1ll1;},'fjXpk':function(Iil1III1,lI1Iiii1){return Iil1III1===lI1Iiii1;},'BnYAq':'CSLZX','qCGUa':'csuxV'};await lii1iIil[i1i11IiI(0x489,'EP)]')](ll1I11l1);if(!cookiesArr[0x0]){if(lii1iIil[i1i11IiI(0x6c9,'9mh4')](lii1iIil[i1i11IiI(0x155,'hpOF')],lii1iIil['SBCFp'])){$[i1i11IiI(0x4ae,'bSPl')]($[i1i11IiI(0x418,'ybt7')],lii1iIil[i1i11IiI(0x456,'gdBj')],lii1iIil[i1i11IiI(0x7d7,'2@2y')],{'open-url':lii1iIil['EejOT']});return;}else i11illii+=illI1I1['name']+'个,';}console[i1i11IiI(0x26e,'Aax^')](i1i11IiI(0x361,'5bgI'));for(let Iilli1=0x0;Iilli1<cookiesArr['length'];Iilli1++){if(lii1iIil[i1i11IiI(0x370,'I#uK')]!==lii1iIil[i1i11IiI(0x75f,'1OM[')])I111l1ll[i1i11IiI(0x133,'P5(4')](lii1iIil[i1i11IiI(0x7db,'EP)]')]),IIiiIlIi+='【额外奖励】领取失败,原因:<EFBFBD><EFBFBD>
|
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
|