jdpro/jd_water_new.js

8 lines
129 KiB
JavaScript
Raw Normal View History

2024-10-10 08:27:13 +00:00
/*
15 1 29 2 * jd_water_new.js
*/
const $ = new Env('新农场浇水');
2024-11-08 14:11:07 +00:00
function P3cGUq(){}var AzTp3P_=Object['defineProperty'],ZwmRFq,NgF2WV,u5mlprr,bQFjRd,Ewh8ZN,ElbE1b1,Kx8Yrf,pR7wBU,ddVQjr,Bt12LaX,xmxqZ5,VEQJ1Q,MdWELLB,jjWdu4,VdF2awR,fmb2Yb,i7SJkEa,O_XN_z,Lcz8Zi,khmILO_,Fbz8jx,F17bIC,yJYLqT,zrvu6WZ,lruiBUL,umQWw2i,_FQCKiB,G7kY1aq,jzKhDj,T_8Lxy;function Z8TqHtR(P3cGUq){return ZwmRFq[P3cGUq>-0x35?P3cGUq+0x34:P3cGUq+0x1b]}ZwmRFq=s7hkVWZ();function ACl0MD(P3cGUq,AzTp3P_){NgF2WV(P3cGUq,Z8TqHtR(-0x2),{value:AzTp3P_,configurable:!0x0});return P3cGUq}P3cGUq(NgF2WV=Object.defineProperty,u5mlprr=ACl0MD(F4lxaG((...AzTp3P_)=>{var NgF2WV=F4lxaG(AzTp3P_=>{return ZwmRFq[AzTp3P_<-0x12?AzTp3P_+0x59:AzTp3P_>-0x12?AzTp3P_>-0x12?AzTp3P_+0x11:AzTp3P_+0x9:AzTp3P_-0x5d]},0x1);P3cGUq(AzTp3P_.length=NgF2WV(-0xf),AzTp3P_[0xe9]=-NgF2WV(-0x10));return AzTp3P_[AzTp3P_[0xe9]-(AzTp3P_[0xe9]-NgF2WV(-0x11))]>AzTp3P_[0xe9]+0x5c?AzTp3P_[-0xe6]:AzTp3P_[AzTp3P_[0xe9]+Z8TqHtR(-0x31)](AzTp3P_[AzTp3P_[NgF2WV(-0x11)]+NgF2WV(-0x10)]())}),0x2)(P1dL4A,ZtbbjVl));var pcb7swc=[],n8ZFuWJ=[NTpMFv(0x0),NTpMFv(0x1),NTpMFv(Z8TqHtR(-0x32)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),NTpMFv(0x2e),NTpMFv(Z8TqHtR(-0x2f)),NTpMFv(Z8TqHtR(0x4a)),NTpMFv(Z8TqHtR(0x42)),NTpMFv(0x6e),NTpMFv(0x5a),NTpMFv(0x6f),NTpMFv(Z8TqHtR(0xa4)),NTpMFv(0x71),NTpMFv(0x72),'4>DM?Ow*|C',NTpMFv(0x73),NTpMFv(0x74),NTpMFv(0x37),NTpMFv(0x75),'p^|fEmVfDeS0E~6Oy5RjrMue];<y~V',NTpMFv(0x76),NTpMFv(0x77),NTpMFv(Z8TqHtR(0x51)),NTpMFv(Z8TqHtR(-0x2d)),NTpMFv(0x5b),NTpMFv(0x79),NTpMFv(0x7a),'4>DM?Ow*|C',NTpMFv(0x7b),NTpMFv(0x7c),NTpMFv(0x7d),NTpMFv(Z8TqHtR(-0x21)),NTpMFv(0x4f),NTpMFv(Z8TqHtR(-0x2d)),NTpMFv(0x37),NTpMFv(Z8TqHtR(0x85)),'p^UWz4F2by}+AjGO}w<6wBtB(2Rql34Of<Kf@!Bq|;<yG:tbX5EmY(oUM47C#L:q{%I?wG^2iS[&dQBOu9cji6!X%!',Z8TqHtR(-0x2c),NTpMFv(0x2f),NTpMFv(Z8TqHtR(-0x2b)),NTpMFv(0x54),NTpMFv(0x44),NTpMFv(Z8TqHtR(0x35)),NTpMFv(Z8TqHtR(-0x2a)),NTpMFv(Z8TqHtR(-0x29)),Z8TqHtR(-0x28),NTpMFv(0x7f),NTpMFv(Z8TqHtR(-0x29)),'&;0_Jsvdm|](xJm',NTpMFv(Z8TqHtR(-0x3)),NTpM
2024-10-10 08:27:13 +00:00
function Env(o, e) { class s { constructor(e) { this.env = e } send(e, t = "GET") { e = "string" == typeof e ? { url: e } : e; let s = this.get; return "POST" === t && (s = this.post), new Promise((i, r) => { s.call(this, e, (e, t, s) => { e ? r(e) : i(t) }) }) } get(e) { return this.send.call(this.env, e) } post(e) { return this.send.call(this.env, e, "POST") } } return new class { constructor(e, t) { this.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", this.name = e, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, t), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(e, t = null) { try { return JSON.parse(e) } catch { return t } } toStr(e, t = null, ...s) { try { return JSON.stringify(e, ...s) } catch { return t } } getjson(e, t) { let s = t; if (this.getdata(e)) try { s = JSON.parse(this.getdata(e)) } catch { } return s } setjson(e, t) { try { return this.setdata(JSON.stringify(e), t) } catch { return !1 } } getScript(e) { return new Promise(i => { this.get({ url: e }, (e, t, s) => i(s)) }) } runScript(a, o) { return new Promise(i => { let e = this.getdata("@chavy_boxjs_userCfgs.httpapi"); e = e && e.replace(/\n/g, "").trim(); var t = (t = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +t : 20, [s, r] = (t = o && o.timeout ? o.timeout : t, e.split("@")); this.post({ url: `http://${r}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: t }, headers: { "X-Key": s, Accept: "*/*" }, timeout: t }, (e, t, s) => i(s)) }).catch(e => this.logErr(e)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var e = this.path.resolve(this.dataFile), t = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(e), i = !s && this.fs.existsSync(t); if (!s && !i) return {}; i = s ? e : t; try { return JSON.parse(this.fs.readFileSync(i)) } catch (e) { return {} } } writedata() { var e, t, s, i, r; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), e = this.path.resolve(this.dataFile), t = this.path.resolve(process.cwd(), this.dataFile), i = !(s = this.fs.existsSync(e)) && this.fs.existsSync(t), r = JSON.stringify(this.data), !s && i ? this.fs.writeFileSync(t, r) : this.fs.writeFileSync(e, r)) } lodash_get(e, t, s) { let i = e; for (const e of t.replace(/\[(\d+)\]/g, ".$1").split(".")) if (i = Object(i)[e], void 0 === i) return s; return i } lodash_set(e, i, t) { return Object(e) === e && ((i = Array.isArray(i) ? i : i.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((e, t, s) => Object(e[t]) === e[t] ? e[t] : e[t] = Math.abs(i[s + 1]) >> 0 == +i[s + 1] ? [] : {}, e)[i[i.length - 1]] = t), e } getdata(e) { let t = this.getval(e); if (/^@/.test(e)) { var [, s, i] = /^@(.*?)\.(.*?)$/.exec(e), s = s ? this.getval(s) : ""; if (s) try { const e = JSON.parse(s); t = e ? this.lodash_get(e, i, "") : t } catch (e) { t = "" } } return t } setdata(e, t) { let s = !1; if (/^@/.test(t)) { var [, i, r] = /^@(.*?)\.(.*?)$/.exec(t), a = this.getval(i), a = i ? "null" === a ? null : a || "{}" : "{}";