mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
17 lines
190 KiB
JavaScript
17 lines
190 KiB
JavaScript
|
/*
|
|||
|
东东农场日常任务 jd_fruit_task.js
|
|||
|
|
|||
|
活动入口:京东APP我的-更多工具-东东农场
|
|||
|
|
|||
|
cron "5 6-18/6 * * *" script-path=jd_fruit_task.js,tag=东东农场日常任务
|
|||
|
|
|||
|
默认浇水,不浇水设置变量 export jd_fruit_Water="true"
|
|||
|
默认在完成每日任务后再次浇水,若保留水滴请设置变量 export DO_TEN_WATER_AGAIN="false"
|
|||
|
默认通知,不发送通知请设置变量 export FRUIT_NOTIFY_CONTROL="false"
|
|||
|
|
|||
|
*/
|
|||
|
const $ = new Env('东东农场日常任务')
|
|||
|
function D94SBEY(){}var LUyOe0=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],cVRe9ct,xsvmKS2,zcnaODs,QABTMs,DVOdPHv,bfORmhQ,cQGBaX,JKlZ0T,bEeJ8q,hiUybeo,Rklalmh,K2AE2CM,PeIhV8E,pXCyogU,bAK3U7,uJCiQG,KrDBVl,pCvMt79;function LeIK9Zh(D94SBEY){return cVRe9ct[D94SBEY<0x152?D94SBEY>0x152?D94SBEY-0x3e:D94SBEY>0x152?D94SBEY+0x1f:D94SBEY+0x58:D94SBEY+0x35]}cVRe9ct=pvovmj();function r0uG1x(D94SBEY,LUyOe0){var zcnaODs=RUeLvNQ(D94SBEY=>{return cVRe9ct[D94SBEY<0x44?D94SBEY-0x30:D94SBEY-0x45]},0x1);xsvmKS2(D94SBEY,zcnaODs(0x8b),{value:LUyOe0,configurable:!0x0});return D94SBEY}D94SBEY(xsvmKS2=Object.defineProperty,zcnaODs=RUeLvNQ((D94SBEY,LUyOe0)=>{return LUyOe0(D94SBEY())},0x2)(F2Klwy,eQ_uKzu));var oicELup=[],wZQpLjs=['E)q=|,(N',Ay5sc48(0x0),Ay5sc48(LeIK9Zh(-0xe)),Ay5sc48(LeIK9Zh(-0xc)),Ay5sc48(LeIK9Zh(-0x10)),Ay5sc48(0x4),Ay5sc48(LeIK9Zh(-0x11)),'\x3d\x79\x3a\x49\x7c',Ay5sc48(0x6),Ay5sc48(0x7),Ay5sc48(LeIK9Zh(0xa)),Ay5sc48(LeIK9Zh(0x5)),Ay5sc48(0xa),Ay5sc48(0xb),Ay5sc48(0xc),Ay5sc48(LeIK9Zh(0x8)),Ay5sc48(0xe),Ay5sc48(0xf),'\u004d\u007c\u0045\u0031\u0068\u007e\u0042\u005a',Ay5sc48(0x10),'pAg+3K|Z',Ay5sc48(LeIK9Zh(-0x5)),Ay5sc48(LeIK9Zh(0x24)),Ay5sc48(LeIK9Zh(0x28)),'df7nQm[n2)8h|rkFpG',Ay5sc48(0x12),Ay5sc48(0x13),Ay5sc48(0x14),Ay5sc48(0x15),Ay5sc48(0x16),Ay5sc48(0x17),Ay5sc48(0x18),Ay5sc48(0x19),Ay5sc48(0x1a),Ay5sc48(0x1b),Ay5sc48(LeIK9Zh(0x0)),Ay5sc48(LeIK9Zh(0xbe)),Ay5sc48(LeIK9Zh(0x15)),Ay5sc48(0x1f),Ay5sc48(0x20),'m%R|LwoG',Ay5sc48(LeIK9Zh(-0x56)),Ay5sc48(LeIK9Zh(-0x58)),'\u0054\u005a\u0029\u0028\u0058\u006f\u0052\u0044\u0035\u003d\u0070\u0056\u0036\u0058\u007e\u004b\u0028\u0021\u0071\u0044\u0035\u002c\u006d\u0036\u0069\u002b\u0068\u005f\u0028\u0052\u0029\u0029\u003a\u003a\u0070\u0058\u007a\u0039\u0021\u006c\u0046\u0024\u003a\u0033\u004e\u0049\u0078\u0054\u007c\u0032\u003d\u002b\u0066\u0048\u004f\u0043\u0028\u0024\u0035\u0039\u0053\u002b\u005b\u0043\u0074\u0075\u0077\u0075\u0071\u0022\u0032\u004c\u0052\u005b\u0029\u006d\u0070\u0022\u0077\u004b\u0060\u0066\u0031\u0029\u0051\u0026\u0050\u0056\u0052\u0030\u0052\u0062\u0043\u0062\u0066\u0045\u004d\u0078\u002f\u006d\u0045\u007e\u0036\u0037\u0031','l(>IsKk$|tnz0~4XnM{1(hz`_b/EbAHd^n~cC+*mya48|:`*?|9?;',Ay5sc48(LeIK9Zh(-0x57)),Ay5sc48(0x24),Ay5sc48(0x25),Ay5sc48(LeIK9Zh(-0x45)),Ay5sc48(LeIK9Zh(0x20)),'\x45\x7c\x70\x63\x3a\x7d\x69\x6a\x6a\x73',Ay5sc48(0x28),Ay5sc48(0x21),Ay5sc48(LeIK9Zh(-0x58)),Ay5sc48(LeIK9Zh(-0x57)),'l(>IsKk$|tnz0~4XnM{1(hz`_b/EbAHd^n~cC+*mya48|:`*?|9?;',Ay5sc48(0x29),'?|B&{',Ay5sc48(LeIK9Zh(0x47)),Ay5sc48(0x2b),Ay5sc48(LeIK9Zh(-0x2d)),Ay5sc48(0x2c),Ay5sc48(0x2d),Ay5sc48(0x29),'?|B&{',Ay5sc48(LeIK9Zh(-0x58)),Ay5sc48(LeIK9Zh(0x31)),Ay5sc48(0x22),'M|[hgcGn/',Ay5sc48(0x2f),Ay5sc48(LeIK9Zh(0x16)),LeIK9Zh(-0x47),Ay5sc48(0x24),Ay5sc48(0x31),Ay5sc48(0x32),Ay5sc48(LeIK9Zh(0x2c)),Ay5sc48(0x34),Ay5sc48(LeIK9Zh(-0x58)),Ay5sc48(0x35),Ay5sc48(LeIK9Zh(0x30)),Ay5sc48(LeIK9Zh(0xfe)),Ay5sc48(LeIK9Zh(-0x57)),Ay5sc48(LeIK9Zh(-0x56)),'EB+i|3M6',Ay5sc48(0x38),Ay5sc48(0x39),'vxWT$8g|>u',Ay5sc48(LeIK9Zh(0x3)),Ay5sc48(0x38),Ay5sc48(LeIK9Zh(0x32)),Ay5sc48(0x3c),'Z%D(U]qED=Hzsa]KbN~Dd,],~cb$q9hzOWVA>0(|o',Ay5sc48(LeIK9Zh(-0x54)),Ay5sc48(LeIK9Zh(0x33)),Ay5sc48(0x3f),'Mtx|s_`pv',Ay5sc48(0x2c),Ay5sc48(0x40),Ay5sc48(0x41),Ay5sc48(LeIK9Zh(0x95)),Ay5sc48(0x31),Ay5sc48(0x43),'LPb1|3DZ',Ay5sc48(LeIK9Zh(-0x1f)),'\u007c\u0032\u007b\u0026\u0069',Ay5sc48(0x45),Ay5sc48(0x46),Ay5sc48(LeIK9Zh(-0x44)),Ay5sc48(0x48),Ay5sc48(0x49),Ay5sc48(LeIK9Zh(-0x52)),Ay5sc48(0x4b),Ay5sc48(0x4c),Ay5sc48(LeIK9Zh(0x11)),Ay5sc48(LeIK9Zh(0x12)),'B|oh8Ke',Ay5sc48(0x4f),Ay5sc48(0x50),Ay5sc48(LeIK9Zh(0x36)),Ay5sc48(LeIK9Zh(0x2)),Ay5sc48(0x52),Ay5sc48(LeIK9Zh(0x37)),Ay5sc48(0x54),'|2{&i',')R=+WK2:5)3%6|(F&yE14',Ay5sc48(LeIK9Zh(0x8d)),Ay5sc48(0x56),Ay5sc48(0x57),Ay5sc48(LeIK9Zh(-0x50)),Ay5sc48(0x59),Ay5sc48(LeIK9Zh(-0x43)),Ay5sc48(LeIK9Zh(-0x53)),Ay5sc48(0x4a),'{2>I*9C{caDz|rHiE|>I',Ay5sc48(0x5c),LeIK9Zh(-0x55),Ay5sc48(0x58),Ay5sc48(0x5b),Ay5sc48(0x5d),'\u0073\u0074\u002b\u003c\u0046\u002a\u0021\u006c\u0062\u007c\u006b\u0043\u0061\u0052\u006f\u004b\u0067\u0064\u0069\u0067\u002b\u0041\u0
|
|||
|
// 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
|