faker2/jd_XinFarm_water.js

19 lines
156 KiB
JavaScript
Raw Normal View History

2024-06-28 07:27:40 +00:00
/*
新东东农场指定浇水
浇水
环境变量
jd_XinFarm_waterpin // 指定浇水的账号填PIN值多个@隔开,不填则全部执行
jd_XinFarm_retainWater // 快速浇水,默认不开启(有水滴门槛,满足要求后开启才会生效)
jd_XinFarm_Notify // 是否推送通知true/false默认不推送
cron: 1 1 1 1 *
*/
const $ = new Env('新东东农场指定浇水')
2024-09-16 19:36:51 +00:00
function hydvuA(){}var mvCn67m=Object['defineProperty'],breDm_,_HDNlD,gl0hbq,j5VzP2S,ahCNyxK,hvHbHc,JkYOMPX,MQpVvDl,WpLWtb,_dCOM3S,v9tZSG,O5u92_8,wJhUqQZ,z7xWTs2,N3nPJJf,btLkNx6,uAA6Ybp,aos4Mir,vVu_dK,jYnuapc;function GdZ1_q(hydvuA){return breDm_[hydvuA<0x20?hydvuA+0x5b:hydvuA-0x21]}breDm_=sVOWFPl();function W5CFDS(hydvuA,mvCn67m){var gl0hbq=dtQSqX(hydvuA=>{return breDm_[hydvuA>0x153?hydvuA-0x3b:hydvuA<-0x3f?hydvuA+0xf:hydvuA<-0x3f?hydvuA+0xc:hydvuA>-0x3f?hydvuA+0x3e:hydvuA-0x44]},0x1);return _HDNlD(hydvuA,gl0hbq(-0xb),{value:mvCn67m,configurable:GdZ1_q(0x9d)})}hydvuA(_HDNlD=Object.defineProperty,gl0hbq=W5CFDS(dtQSqX((...mvCn67m)=>{var _HDNlD=dtQSqX(mvCn67m=>{return breDm_[mvCn67m<-0x37?mvCn67m-0x3e:mvCn67m+0x36]},0x1);hydvuA(mvCn67m.length=0x2,mvCn67m[0x32]=mvCn67m[GdZ1_q(0x21)]);return mvCn67m[_HDNlD(0x1)](mvCn67m[0x32]())}),0x2)(Bm0YFD,beMQNk));var DlILgyq=[],c6rDJG=[In1I0p(GdZ1_q(0x21)),In1I0p(0x1),In1I0p(0x2),In1I0p(GdZ1_q(0x5a)),In1I0p(0x4),In1I0p(0x5),In1I0p(GdZ1_q(0x63)),In1I0p(0x7),In1I0p(0x8),In1I0p(0x9),In1I0p(0xa),In1I0p(GdZ1_q(0x81)),In1I0p(GdZ1_q(0x85)),In1I0p(GdZ1_q(0x82)),In1I0p(GdZ1_q(0x7c)),In1I0p(0xf),In1I0p(0x10),In1I0p(GdZ1_q(0x68)),In1I0p(GdZ1_q(0x66)),In1I0p(0x13),In1I0p(GdZ1_q(0x57)),In1I0p(GdZ1_q(0xbd)),In1I0p(0x16),In1I0p(GdZ1_q(0x2f)),In1I0p(GdZ1_q(0x86)),In1I0p(GdZ1_q(0x80)),In1I0p(0x1a),In1I0p(0x1b),In1I0p(GdZ1_q(0x8e)),In1I0p(0x1d),In1I0p(0x1e),In1I0p(0x1f),In1I0p(0x20),In1I0p(0x21),In1I0p(GdZ1_q(0x22)),In1I0p(0x22),In1I0p(0x22),In1I0p(0x17),'|)8>S',In1I0p(0x23),In1I0p(GdZ1_q(0x92)),In1I0p(0x25),In1I0p(GdZ1_q(0x56)),In1I0p(0x27),In1I0p(0x28),In1I0p(0x21),In1I0p(GdZ1_q(0x22)),In1I0p(0x29),In1I0p(0x2a),In1I0p(0x2b),'b_:wYRK!rl="^n|$b_:wYRK!rl="^n|$b_:wYRK!rl="^n|$4[',In1I0p(GdZ1_q(0x23)),In1I0p(0x2d),In1I0p(0x2e),In1I0p(GdZ1_q(0xbf)),In1I0p(0x30),In1I0p(0x31),In1I0p(0x32),In1I0p(0x33),In1I0p(0x34),In1I0p(0x35),In1I0p(GdZ1_q(0x59)),'sE|nJkHQj',In1I0p(GdZ1_q(0x5d)),In1I0p(0x38),In1I0p(0x39),In1I0p(GdZ1_q(0x55)),'q)>&|Fpt',In1I0p(0x3b),In1I0p(0x3c),In1I0p(GdZ1_q(0x27)),In1I0p(GdZ1_q(0x2e)),In1I0p(GdZ1_q(0x64)),In1I0p(0x40),In1I0p(GdZ1_q(0xcf)),In1I0p(0x22),In1I0p(0x42),In1I0p(GdZ1_q(0x23)),In1I0p(GdZ1_q(0x38)),In1I0p(GdZ1_q(0x26)),In1I0p(0x45),In1I0p(0x46),In1I0p(0x47),In1I0p(0x48),In1I0p(GdZ1_q(0x9e)),In1I0p(GdZ1_q(0x2d)),In1I0p(0x4b),In1I0p(0x22),In1I0p(GdZ1_q(0xa0)),In1I0p(0x4d),In1I0p(GdZ1_q(0x8f)),In1I0p(0x4f),In1I0p(0x50),In1I0p(GdZ1_q(0x90)),In1I0p(GdZ1_q(0x25)),In1I0p(GdZ1_q(0xa4)),In1I0p(0x54),In1I0p(GdZ1_q(0x24)),In1I0p(0x56),In1I0p(GdZ1_q(0xad)),In1I0p(0x53),In1I0p(0x54),In1I0p(GdZ1_q(0x24)),In1I0p(GdZ1_q(0x7b)),In1I0p(GdZ1_q(0x24)),In1I0p(0x33),In1I0p(0x22),In1I0p(GdZ1_q(0xde)),'RQ(o6AB&+(nu|P=FRZ7','RQ(o6Ab:|Ez:[QDFRZ7','RQ(o6AB&T|W}1vLFRZ7',In1I0p(GdZ1_q(0x25)),In1I0p(GdZ1_q(0xa8)),In1I0p(GdZ1_q(0xb6)),In1I0p(0x5c),In1I0p(GdZ1_q(0x4f)),In1I0p(GdZ1_q(0x25)),In1I0p(0x5e),In1I0p(0x5f),In1I0p(0x60),In1I0p(GdZ1_q(0x28)),In1I0p(GdZ1_q(0x26)),In1I0p(GdZ1_q(0x27)),'\u005a\u0073\u002a\u0031\u007c\u0046\u0070\u0074',In1I0p(0x62),In1I0p(0x3d),In1I0p(GdZ1_q(0x29)),'Zs*1|FcQk3a#h7',In1I0p(0x3d),In1I0p(0x63),In1I0p(GdZ1_q(0x25)),In1I0p(GdZ1_q(0xb3)),In1I0p(0x44),In1I0p(0x60),In1I0p(GdZ1_q(0x28)),In1I0p(0x65),In1I0p(GdZ1_q(0x2c)),GdZ1_q(0x2a),In1I0p(0x22),'Zs*1|Fpt',In1I0p(0x62),In1I0p(0x22),In1I0p(0x66),In1I0p(0x67),In1I0p(0x68),In1I0p(0x60),In1I0p(GdZ1_q(0x28)),In1I0p(GdZ1_q(0x27)),In1I0p(0x22),In1I0p(0x69),In1I0p(GdZ1_q(0x23)),In1I0p(0x4f),In1I0p(0x6a),'\x5a\x73\x2a\x31\x7c\x46\x70\x74',In1I0p(0x62),In1I0p(GdZ1_q(0x29)),In1I0p(0x2c),In1I0p(0x4f),In1I0p(GdZ1_q(0x2b)),GdZ1_q(0x2a),In1I0p(GdZ1_q(0x29)),In1I0p(0x2c),In1I0p(GdZ1_q(0xa1)),In1I0p(GdZ1_q(0x2b)),In1I0p(0x6c),In1I0p(0x6d),In1I0p(0x60),In1I0p(GdZ1_q(0x28)),In1I0p(GdZ1_q(0x2c)),In1I0p(0x6e),In1I0p(GdZ1_q(0x83)),In1I0p(GdZ1_q(0x6b)),In1I0p(0x71),In1I0p(0x72),In1I0p(GdZ1_q(0x2d)),In1I0p(GdZ1_q(0xb9)),'x^I|8',In1I0p(GdZ1_q(0x48)),'|)8>S',In1I0p(0x22),In1I0p(GdZ1_q(0x29)),In1I0p(GdZ1_q(0x2e)),In1I0p(0x75),'0>|c<LhQ',In1I0p(GdZ1_q(0xc1)),In1I0p(GdZ1_q(0x2f)),In1I0p(0x26),In1I0p(0x2e),In1I0p(0x77),In1I0p(GdZ1_q(0xc2)),In1I0p(0x79),In1I0p(GdZ1_q
2024-06-28 07:27:40 +00: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.d