2024-06-28 15:38:28 +08:00
|
|
|
|
/*
|
|
|
|
|
东东农场快速浇水
|
|
|
|
|
环境变量:FRUIT_PLANT_LEVEL // 自动种植的作物等级(正整数),默认为2
|
|
|
|
|
FRUIT_WATERING_NOTIFY // 是否推送通知(true/false),默认不推送
|
2024-07-03 16:44:49 +08:00
|
|
|
|
FRUIT_WATERING_PIN // 指定PIN账号浇水,多个用 & 隔开
|
2024-06-28 15:38:28 +08:00
|
|
|
|
|
2024-07-03 16:44:49 +08:00
|
|
|
|
每月或每周只能领2次红包,由于常规浇水太慢,脚本优先使用快速浇水卡
|
2024-06-28 15:38:28 +08:00
|
|
|
|
|
2024-07-03 16:44:49 +08:00
|
|
|
|
cron:1 1 1 1 * jd_fruit_watering.js
|
2024-06-28 15:38:28 +08:00
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const $ = new Env('东东农场快速浇水')
|
2024-07-03 16:44:49 +08:00
|
|
|
|
var iil='jsjiami.com.v7';const liiI1i=iii1II;(function(ii1ill,II1iI,llI1II,lIli1l,lillIi,illIi1,ii1ili){return ii1ill=ii1ill>>0x5,illIi1='hs',ii1ili='hs',function(liil1i,lI1lil,i1l1iI,liil1l,lI1lii){const iIIiiI=iii1II;liil1l='tfi',illIi1=liil1l+illIi1,lI1lii='up',ii1ili+=lI1lii,illIi1=i1l1iI(illIi1),ii1ili=i1l1iI(ii1ili),i1l1iI=0x0;const Iiili1=liil1i();while(!![]&&--lIli1l+lI1lil){try{liil1l=-parseInt(iIIiiI(0x1b1,'gUB['))/0x1+parseInt(iIIiiI(0x159,'B[vv'))/0x2+-parseInt(iIIiiI(0x1dc,'bg(6'))/0x3*(parseInt(iIIiiI(0xf4,'SFB7'))/0x4)+-parseInt(iIIiiI(0x1ce,'S4Ba'))/0x5*(parseInt(iIIiiI(0x103,'Tc0m'))/0x6)+parseInt(iIIiiI(0x164,'SFB7'))/0x7*(-parseInt(iIIiiI(0xe9,'#0!g'))/0x8)+-parseInt(iIIiiI(0x211,'He&s'))/0x9*(-parseInt(iIIiiI(0x288,'I%Vs'))/0xa)+parseInt(iIIiiI(0x1a1,'sT]['))/0xb;}catch(Iil1l1){liil1l=i1l1iI;}finally{lI1lii=Iiili1[illIi1]();if(ii1ill<=lIli1l)i1l1iI?lillIi?liil1l=lI1lii:lillIi=lI1lii:i1l1iI=lI1lii;else{if(i1l1iI==lillIi['replace'](/[QDWNrgOptPuSyUdxnhFYk=]/g,'')){if(liil1l===lI1lil){Iiili1['un'+illIi1](lI1lii);break;}Iiili1[ii1ili](lI1lii);}}}}}(llI1II,II1iI,function(i1i11I,il1iIl,iii1ii,il1iIi,iii1il,II11li,I1l11i){return il1iIl='\x73\x70\x6c\x69\x74',i1i11I=arguments[0x0],i1i11I=i1i11I[il1iIl](''),iii1ii=`\x72\x65\x76\x65\x72\x73\x65`,i1i11I=i1i11I[iii1ii]('\x76'),il1iIi=`\x6a\x6f\x69\x6e`,(0x159f9f,i1i11I[il1iIi](''));});}(0x19a0,0xe164b,Iii11l,0xcf),Iii11l)&&(iil=liiI1i(0x174,'fzI!'));const jdCookie=require(liiI1i(0x242,'He&s')),notify=require(liiI1i(0x17a,'txF@')),common=require(liiI1i(0x1a8,'SFB7')),{H5st}=require(liiI1i(0x1a7,'Ux)#')),FRUIT_PLANT_LEVEL=process[liiI1i(0x276,'k![b')]['FRUIT_PLANT_LEVEL']||'2',isNotify=process['env'][liiI1i(0xea,'SFB7')]===liiI1i(0x224,'KQyc'),PinArr=process[liiI1i(0x21b,'Tc0m')][liiI1i(0x198,'QWFe')]?process['env'][liiI1i(0x1e5,'haP4')]['split']('&'):'';console[liiI1i(0x143,'pOgc')](''),console[liiI1i(0x1bc,'bg(6')](liiI1i(0x22b,'S4Ba')+$[liiI1i(0x134,'IKY3')]+'变量说明=========='),console['log']('FRUIT_PLANT_LEVEL\x20//\x20自动种植的作物等级(正整数)'),console[liiI1i(0x1cf,'BiiY')](liiI1i(0x246,'haP4')),console['log'](liiI1i(0x179,'FAmv')),console[liiI1i(0x275,'cvWH')](liiI1i(0x192,'goqf')+$[liiI1i(0x15e,'zLIJ')]+liiI1i(0x187,'aX3C')),console['log']('');let cookie='';const cookiesArr=Object['keys'](jdCookie)[liiI1i(0x1ae,'haP4')](ll1=>jdCookie[ll1])['filter'](iI1llI=>iI1llI);!cookiesArr[0x0]&&($[liiI1i(0x260,'T!#)')]($['name'],liiI1i(0x22a,'@o2C')),process[liiI1i(0xfc,'C@S!')](0x1));let rs_wait=0x1,waitTimes=parseInt(rs_wait)*0x3e8,uuid=randomString(0x28),addressid=randomString(0xa,'123456789'),sid=randomString(0x20,liiI1i(0x17d,'2O[G')),area=randomString(0x1,'1234567890')+'-'+randomString(0x5,'1234567890')+'-'+randomString(0x5,'1234567890')+'-'+randomString(0x1,liiI1i(0xeb,'9HJc')),lng=liiI1i(0x279,'SFB7')+Math[liiI1i(0x129,'A4yY')](Math['random']()*0x383+0x64),lat=liiI1i(0xff,'!SmT')+Math[liiI1i(0x1e7,'txF@')](Math['random']()*0x383+0x64);function iii1II(_0x3b9331,_0x449ffe){const _0x4405e3=Iii11l();return iii1II=function(_0x3c0639,_0x5d0709){_0x3c0639=_0x3c0639-0xdb;let _0x5ad134=_0x4405e3[_0x3c0639];if(iii1II['EbEPQX']===undefined){var _0x4f29db=function(_0x44788d){const _0x5ac7af='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x38a755='',_0x582bdf='';for(let _0x1bb45f=0x0,_0x195bee,_0x4a0735,_0x242875=0x0;_0x4a0735=_0x44788d['charAt'](_0x242875++);~_0x4a0735&&(_0x195bee=_0x1bb45f%0x4?_0x195bee*0x40+_0x4a0735:_0x4a0735,_0x1bb45f++%0x4)?_0x38a755+=String['fromCharCode'](0xff&_0x195bee>>(-0x2*_0x1bb45f&0x6)):0x0){_0x4a0735=_0x5ac7af['indexOf'](_0x4a0735);}for(let _0xfc13f5=0x0,_0x317f2a=_0x38a755['length'];_0xfc13f5<_0x317f2a;_0xfc13f5++){_0x582bdf+='%'+('00'+_0x38a755['charCodeAt'](_0xfc13f5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x582bdf);};const _0x2ed08c=function(_0x2ebeb6,_0x4e6225){let _0x4907bb=[],_0x5deabc=0x0,_0x4acb55,_0x43f5d2='';_0x2ebeb6=_0x4f29db(_0x2ebeb6);let _0xca0d3e;for(_0xca0d3e=0x0;_0xca0d3e<0x100;_0xca0d3e++){_0x4907bb[_0xca0d3e]=_0xca0d3e;}for(_0xca0d3e=0x0;_0xca0d3
|
2024-06-28 15:38:28 +08:00
|
|
|
|
// 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"])
|