faker3/jd_fruit_task.js

17 lines
206 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
东东农场日常任务 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('东东农场日常任务')
2024-10-10 13:24:08 +08:00
function GhicuM(){}var uQGE4Sz=Object['defineProperty'],xBuasgD,xsHr14c,_ejMgx,OSZUxCQ,SfaR4B5,ckEJk7,lR3qWfB,hE7XVOu,Yoegayi,dFoAvh,sPFSKtk,iHDfl4,OxznrW,wcMg_XO,eQcAZ68,hnZhhGu,F9DLg0S,lyq9gg2,MvPTUy,yLu27Vx,DTfGEt,MT5gtq,W4cZov,XgHy3bR,la7AOa,mKdLnNO;function h6Fbzw(GhicuM){return xBuasgD[GhicuM>0x210?GhicuM-0x23:GhicuM<0x210?GhicuM-0x55:GhicuM+0x59]}xBuasgD=Ts3iEyn();function lxPTM4u(GhicuM,uQGE4Sz){return xsHr14c.call(null,GhicuM,'length',{value:uQGE4Sz,configurable:!0x0})}GhicuM(xsHr14c=Object.defineProperty,_ejMgx=lxPTM4u(bw4Mu_w((...uQGE4Sz)=>{var xsHr14c=bw4Mu_w(uQGE4Sz=>{return xBuasgD[uQGE4Sz>0x61?uQGE4Sz>0x61?uQGE4Sz<0x61?uQGE4Sz-0x1c:uQGE4Sz-0x62:uQGE4Sz-0x60:uQGE4Sz-0x2d]},0x1);GhicuM(uQGE4Sz[xsHr14c(0xcf)]=xsHr14c(0x63),uQGE4Sz[h6Fbzw(0x55)]=xsHr14c(0x6e));if(uQGE4Sz[xsHr14c(0x62)]>xsHr14c(0x7a)){var _ejMgx=bw4Mu_w(uQGE4Sz=>{return xBuasgD[uQGE4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z(h6Fbzw(0xfe)),yrfUyz(0x39),yrfUyz(0x53),'BNn{1p|V',yrfUyz(h6Fbzw(0x5d)),'\x4e\x4e\x4c\x7b\x31\x64\x6a\x64\x4e\x2f\x39\x7c\x6d\x72\x63\x22\x46\x4b\x75\x67\x6d\x77\x49\x6b\x39\x23',yrfUyz(0x54),yrfUyz(0x55),yrfUyz(0x50),yrfUyz(0x56),yrfUyz(0x57),yrfUyz(h6Fbzw(0x5f)),yrfUyz(h6Fbzw(0x62)),yrfUyz(0x5a),yrfUyz(h6Fbzw(0xcf)),yrfUyz(0x5c),'k~rn/c"RT/2z@.z_=6|F`','|x_[R9M',yrfUyz(h6Fbzw(0x102)),yrfUyz(h6Fbzw(0x137)),yrfUyz(0x5f),yrfUyz(0x60),yrfUyz(0x61),yrfUyz(h6Fbzw(0xf5)),yrfUyz(h6Fbzw(0x5e)),yrfUyz(0x63),yrfUyz(0x64),yrfUyz(0x65),yrfUyz(0x65),yrfUyz(0x66),yrfUyz(0x67),yrfUyz(0x68),yrfUyz(h6Fbzw(0x109)),yrfUyz(h6Fbzw(0x5e)),yrfUyz(0x64),yrfUyz(h6Fbzw(0x66)),yrfUyz(0x6b),yrfUyz(0x6c),yrfUyz(0x6d),yrfUyz(h6Fbzw(0x10c)),yrfUyz(h6Fbzw(0x14d)),yrfUyz(0x70),yrfUyz(0x70),yrfUyz(0x59),yrfUyz(h6Fbzw(0x91)),yrfUyz(0x72),yrfUyz(0x73),yrfUyz(0x74),yrfUyz(h6Fbzw(0x110)),yrfUyz(0x76),yrfUyz(h6Fbzw(0x5e)),yrfUyz(h6Fbzw(0xa2)),yrfUyz(h6Fbzw(0x63)),yrfUyz(0x53),yrfUyz(0x79),'z(4QY`|V',yrfUyz(0x7a),yrfUyz(h6Fbzw(0x112)),yrfUyz(0x75),yrfUyz(0x7c
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