faker3/jd_XinFarm_water.js

19 lines
60 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
新东东农场指定浇水
浇水
环境变量
jd_XinFarm_waterpin // 指定浇水的账号填PIN值多个@隔开,不填则全部执行
jd_XinFarm_retainWater // 快速浇水,默认不开启(有水滴门槛,满足要求后开启才会生效)
jd_XinFarm_Notify // 是否推送通知true/false默认不推送
cron: 1 1 1 1 *
*/
const $ = new Env('新东东农场指定浇水')
2024-07-28 00:58:58 +08:00
const _0x24584c=_0x593a;(function(_0x308a09,_0x199954){const _0x3438ba=_0x593a,_0x1e4a36=_0x308a09();while(!![]){try{const _0x33b27f=-parseInt(_0x3438ba(0x25a,'vrWi'))/0x1*(-parseInt(_0x3438ba(0x1f1,'sdb8'))/0x2)+parseInt(_0x3438ba(0x2f9,'RtKD'))/0x3*(-parseInt(_0x3438ba(0x3cf,'iu8h'))/0x4)+parseInt(_0x3438ba(0x2d7,'8s5s'))/0x5+parseInt(_0x3438ba(0x26b,'AdD%'))/0x6*(parseInt(_0x3438ba(0x1f8,'y0M('))/0x7)+-parseInt(_0x3438ba(0x2f4,'AdD%'))/0x8+parseInt(_0x3438ba(0x20d,'tl%r'))/0x9*(parseInt(_0x3438ba(0x309,'w^gv'))/0xa)+parseInt(_0x3438ba(0x278,'w^gv'))/0xb*(-parseInt(_0x3438ba(0x20e,'iu8h'))/0xc);if(_0x33b27f===_0x199954)break;else _0x1e4a36['push'](_0x1e4a36['shift']());}catch(_0x11d17e){_0x1e4a36['push'](_0x1e4a36['shift']());}}}(_0x13c5,0x36b3e));const jdCookie=require(_0x24584c(0x379,'&uol')),notify=require(_0x24584c(0x35b,'nrxS')),common=require('./utils/Rebels_jdCommon'),{H5st}=require('./utils/Rebels_H'),CryptoJS=require(_0x24584c(0x2ec,'g]cY')),querystring=require('querystring'),pinFilterGoods=(process[_0x24584c(0x27b,'&uol')][_0x24584c(0x298,'z9yY')]||'')[_0x24584c(0x2aa,'hO2f')]('@')[_0x24584c(0x346,'8s5s')](_0x115cd7=>_0x115cd7),retainWater=process[_0x24584c(0x216,'XXmD')][_0x24584c(0x23f,'Mws!')]==='true',isNotify=process[_0x24584c(0x439,'ZUtX')][_0x24584c(0x24c,'vV2l')]==='true',sign_linkId=_0x24584c(0x23b,'XXmD'),draw_linkId='VssYBUKJOen7HZXpC8dRFA';let pinMsg='';const award_map={0x1:'水滴',0x2:'水滴'};let cookie='';function _0x13c5(){const _0x27796f=['WR3cVtOZgmkJW7ldMSkgvcbst8kCna','W4yRW70pWPfCWRi','wJxdGCkNjCk3W5raha','DNWGWQ7cIJi','hwhcMYDfzW','l8keg1NcRCoiWQvDW6DfWR09W7ddLSksEcRdP8kOW4riWR99WPygze7cUuVcP8oPxYhdVq','5B6N5yMR5BES57I/6k+z57Y45B2v6yc15Rsv5RoD776N5y6g5BYG6yoy5RAz5Rg9lG','s8orWQtdNSkDW4tcMCoEb3SwWR43','z3ZcHCklpY3dTCoigSkk','z3pdGCo0WQuTuSkOW73cOI4','xINdLSkRj8kJW7fjesjOWRzj','W5DsWPq','8jYjT0e','W5JcIUETLUwiK+wNI+I0JGe','W6ldMSoUW6/dOaS','oq7dPCk/','rs7dLa','W6ldR2VdGra','wCo0WQlcMq','77Yj6l+q6z2b5RAD','W4rFWOq2w8kKWPmHWQpdGWFcNYq','fXhcPby','W55XyCkj','WPfiAa','W4m6W7OmWOmbW7JcMKhcJwFcLdniBJGgEda','W6RdLmo9W4S','W5m2WOnwjSk7','o3GwWQ9FsK8lpIL3W5hcPq','WQz4lCkzW7mIW4dcTcu','WPhcJSoyta','y33dH8oTWPy8zmk6W6lcMdGtWQ3cQJnn','W6FcUY7dINNcQInWWOD+qdH8zmk7xX8jtNG','W5pdIrCWia9VEq','rJ3cIaZdPuNcIq','pSkqjG','lfVcLCkn','W7z/W4ddHJadwq','6lEy56AZ57Qs5P2g6lYN5P2i','hmkX5lU75yIW5AwT6lseWPe','W7LaWPSRWObhW6WEArG','77YT6l6a6z+M5RsE','W7pdR+MJLEwoN+AjREwjVW','sI7dL8kR','44oI5lMn5lQG6lsp5yYq','fHjdW7mjza7cKcrbouO','WR5VjCkhW7mEW5i','p8kuWRu5WOKxW4/cR8o1W77dVfdcI0O','W41CB3K','W6FcKSoHmG','buS0W79p','W7S9kvxcHmo6','y33dH8oTWPy8zmk6W6lcMdaFWQRcVW','dmoSnexdRJbJjIWRomkWWR7dHe1RWQVcKh0','W4Og5lUL5yMr5A+R5OMg','77YQ54IN5Ocb56kq','WPqDW5b0d8okW4uoWOZdRa','pCohd1tdVL4','W6HaWOygWOPhW5y','qfqu','WPylW59rcSoOW4eqWPddPXC','ACk9fvG','ee0zW6buba','W4O+W704WP9VWRBdHKi','abxcPdtcOSkdcazd','ymkVbG','yCkZbG','W709WQn0jCoFW7u','5OUI54w+6ykM55+m','WQzRnSkcW7SFW6xcUdtdJW','ANj+nCkjW5ea','imklWQ0KWPG','owKiWP1qwMKwotn1','mmkuWQuO','W6JdLmo7W4FdJqVcSYldTcuDwSk4gu8+BSorhmkG','W6K5WQf1g8oiW7hdIHLfnwzTWOfNWOOHW7VcOGLFW78U','W6FcUY7dINNcRYnTWOXt','bmk7W7RdIZTiF8oUsGC','WRD45OUN5yIq5lMU56U05RgT','eCkCWQ0','WRddR2xcLrpdRIrJWOrTztG','W6ZcVY/dLeFcVYC','cdBcUM3cMajq','CCkyo8kdW4NdRvpcKCodn8kNWOWlASoxumkL','FSkxoSklW6tdUa','WR9Kj8kpW6miW4tcQG','W69BWO4iWPze','W4Hnt3NdMrb/W5/cUK0','hhdcIszCya','fHjdW7mjCGdcPJ5/oeqMxXbE','W6ZcQtS','B8k1g3RdHNzX','W5PnWObbWQDObmofW7m','yg7dH8onWROV','fmkwW7i','W5C+WOT2cSk9FSoGW7ufdrZcHSkgW6a4W5zreSoaWQhdPbhdRSk1','WRdcLEs5SUwiI+wMO+I1NmoY','W4P2ymkjWQagfeFdJmoMnmoAFq','bSk2cfa','bJlcQwtcOHHmWOfO','WPDjESkv','W4DEWOa/wCkOWPyJWPFdVYBcNc8','wfOaW4CUDa','qCo+zmo0','W7HiWPiHWOPo','frhcOHRcKSkEaGziWOfFW6NdS8on','dfyH','frhcOHRcKSkEaGziWOfDW6FdOCogW4vjWR91eCoH','WQNcRICO','pmkBqN/cUW','juNcHG','gSkeW7VcSmooWOtdJSoTagmN','WPLvEq','qv4aW58gD8kZ','bLG0W71IaSoektG','bdlcR2G','e2NdKw3cQbpdMmo8d8omWRLwAq','WPmlW4nRnmoOW5yhWPZdLHlcUWqxW5O','W6GQ5lQ/5yMc5AYA5OM8','d3BcJJPgFu3cOSkwkWDjWONcPc/cGKCcEa','WRfVmmkVW7CyW4tcQJtdRYFcSmkfWQXSpLqeW6hcMJVcPGlcIG','iCkEWRySWP4bW6lcLCoTW7O','imkvg2hdQ8kbW74','W7ddIH7cGmorW7b2lSk
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.d