KR/jd_fruit_watering.js

11 lines
66 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
东东农场快速浇水
默认使用快速浇水卡成熟了自动收取红包和种植新的水果
11 11 11 11 * jd_fruit_watering.js, tag=东东农场快速浇水, enabled=true
*/
const $ = new Env('东东农场快速浇水');
var version_='jsjiami.com.v7';const iII11i=iii1II;(function(lIllil,iilIi1,I111,I1I11l,I1I11i,l1iI1l,III1ll){return lIllil=lIllil>>0x3,l1iI1l='hs',III1ll='hs',function(l1lIIi,iII11I,IiIii1,l1lIIl,i1lIl){const l1lIII=iii1II;l1lIIl='tfi',l1iI1l=l1lIIl+l1iI1l,i1lIl='up',III1ll+=i1lIl,l1iI1l=IiIii1(l1iI1l),III1ll=IiIii1(III1ll),IiIii1=0x0;const i1lIi=l1lIIi();while(!![]&&--I1I11l+iII11I){try{l1lIIl=-parseInt(l1lIII(0x26d,'JbJ0'))/0x1*(parseInt(l1lIII(0x1d2,'tWkY'))/0x2)+parseInt(l1lIII(0x252,'IfB*'))/0x3*(-parseInt(l1lIII(0x3f7,'l[bV'))/0x4)+parseInt(l1lIII(0x212,'9q[4'))/0x5+parseInt(l1lIII(0x234,'u4Qs'))/0x6+-parseInt(l1lIII(0x38a,'e3Kv'))/0x7+parseInt(l1lIII(0x25e,'@90O'))/0x8*(-parseInt(l1lIII(0x1d6,'Dy4h'))/0x9)+parseInt(l1lIII(0x277,'xwUM'))/0xa;}catch(iilIiI){l1lIIl=IiIii1;}finally{i1lIl=i1lIi[l1iI1l]();if(lIllil<=I1I11l)IiIii1?I1I11i?l1lIIl=i1lIl:I1I11i=i1lIl:IiIii1=i1lIl;else{if(IiIii1==I1I11i['replace'](/[ONGxRVebhrLdqQwWICXt=]/g,'')){if(l1lIIl===iII11I){i1lIi['un'+l1iI1l](i1lIl);break;}i1lIi[III1ll](i1lIl);}}}}}(I111,iilIi1,function(III1li,Ili1iI,lIlll1,Ili1i1,I1I11I,iII11l,i1IiI1){return Ili1iI='\x73\x70\x6c\x69\x74',III1li=arguments[0x0],III1li=III1li[Ili1iI](''),lIlll1='\x72\x65\x76\x65\x72\x73\x65',III1li=III1li[lIlll1]('\x76'),Ili1i1='\x6a\x6f\x69\x6e',(0x13215f,III1li[Ili1i1](''));});}(0x638,0xc130a,Iii11l,0xc9),Iii11l)&&(version_=Iii11l);let cookiesArr=[],cookie='',notify,allMessage='',message='',subTitle='',option={},isFruitFinished=![],jdNotify=![];const FRUIT_PLANT_LEVEL=process[iII11i(0x1c4,'&dC4')][iII11i(0x3a2,'IK57')]?process[iII11i(0x30f,'u4Qs')]['FRUIT_PLANT_LEVEL']:'2',getToken=require(iII11i(0x2d1,'e3Kv')),cryptoJS=require('crypto-js'),base64_mod_charset=iII11i(0x3a1,'cXCB'),JD_API_HOST=iII11i(0x3a3,'Vrp('),urlSchema='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';!(async()=>{const l1iI1i=iII11i,lilI1l={'fuDuC':function(l1liiI){return l1liiI();},'dZAtn':function(I1iI1,lilI1i){return I1iI1===lilI1i;},'WjTNh':l1iI1i(0x213,'e3Kv'),'zpckj':'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取','xHRkX':l1iI1i(0x2d7,'@90O'),'bKtWq':l1iI1i(0x459,'4Jq('),'liNSX':function(Il1Ii,Ii11l){return Il1Ii!==Ii11l;},'bihzj':l1iI1i(0x26a,'l[bV'),'UsAbL':l1iI1i(0x2bb,'IK57'),'AAell':function(liI1I1,Ii11i){return liI1I1(Ii11i);},'YOYMo':function(i1llI,iIIli1){return i1llI+iIIli1;},'SQZom':function(Ii1l1i,l1lIl){return Ii1l1i+l1lIl;},'PTRdI':function(Ii1l1l,i1Iiil){return Ii1l1l+i1Iiil;},'Akeph':l1iI1i(0x1db,'zGEu'),'CAkMh':function(i1Iiii,l1lIi,l1lili){return i1Iiii(l1lIi,l1lili);},'IGyuS':function(IIlI1l,lI1I11){return IIlI1l+lI1I11;}};await lilI1l[l1iI1i(0x2a3,'5xuF')](requireConfig);if(!cookiesArr[0x0]){if(lilI1l['dZAtn'](l1iI1i(0x3d6,'*5]n'),lilI1l['WjTNh']))lI1IiI[l1iI1i(0x206,'IK57')](l1iI1i(0x44d,'Nk5^')),i1lI[l1iI1i(0x442,'V%d(')]('尝试自动种植'+IlI1l[l1iI1i(0x3ff,'tWkY')]+l1iI1i(0x28e,'zGEu'));else{$['msg']($[l1iI1i(0x1e0,'yP8*')],lilI1l[l1iI1i(0x28d,'Dy4h')],lilI1l[l1iI1i(0x1df,'cXCB')],{'open-url':lilI1l[l1iI1i(0x334,'BeZt')]});return;}}console[l1iI1i(0x269,'ZWq1')](lilI1l[l1iI1i(0x276,'FWSI')]);for(let IilIi=0x0;IilIi<cookiesArr[l1iI1i(0x218,'J2u@')];IilIi++){if(cookiesArr[IilIi]){if(lilI1l[l1iI1i(0x29d,'cXCB')](lilI1l[l1iI1i(0x288,'1WIw')],lilI1l[l1iI1i(0x3ed,'TN5f')])){cookie=cookiesArr[IilIi],$[l1iI1i(0x251,'ZWq1')]=lilI1l[l1iI1i(0x3d2,'9y)q')](decodeURIComponent,cookie['match'](/pt_pin=([^; ]+)(?=;?)/)&&cookie[l1iI1i(0x3c8,'V%d(')](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$[l1iI1i(0x1d8,'InIJ')]=lilI1l['YOYMo'](IilIi,0x1),$[l1iI1i(0x223,'IfB*')]=!![],$['nickName']='',console['log'](lilI1l[l1iI1i(0x41e,'Dy4h')](lilI1l['SQZom'](lilI1l[l1iI1i(0x350,'4Jq(')](l1iI1i(0x306,'30zw')+$[l1iI1i(0x20e,'l[bV')],'】'),$['nickName']||$[l1iI1i(0x1d7,'e3Kv')]),lilI1l['Akeph']));if(!$[l1iI1i(0x3a7,'Nk5^')]){$[l1iI1i(0x273,'yP8*')]($['name'],l1iI1i(0x1da,'@90O'),l1iI1i(0x2a5,'cXCB')+$['index']+'\x20'+($[l1iI1i(0x3ec,'bpUO')]||$[l1iI1i(0x408,'5TS[')])+
// 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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])