faker3/jd_healthy_task.js

12 lines
91 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称京东健康能量任务
cron:27 4,16 * * *
*/
const $ = new Env('京东健康能量任务')
2024-12-13 11:18:19 +08:00
function s2xY4u(){}var myJvSDn=Object['defineProperty'],N0fURa,jFn40G,r5KEGA,TILSyh,Bw4M9uq,ndtpPnt,ROAJGQX,EqZUL81,jW8DTv4,VyKyMSF,kyypEBC,kkjQbF,AhFtwu,vushpvY;function R6W7hgd(s2xY4u){return N0fURa[s2xY4u>-0x2?s2xY4u>-0x2?s2xY4u+0x1:s2xY4u-0x2e:s2xY4u-0x37]}s2xY4u(N0fURa=MH2YotC(),jFn40G=mY7uGVa((s2xY4u,myJvSDn)=>{return myJvSDn(s2xY4u())},0x2)(p9GE0bC,VxlHVp));var oCdFOR=[],UiBp4A=['&fsEM9CfA','\x26\x33\x36\x39\x25\x69\x62\x6b',FlX64in(0x0),'\u0026\u003a\u0070\u0037\u0043','EIw!',FlX64in(R6W7hgd(0x14)),'\u0077\u0062\u0041\u0021\u0044\u0076\u0064\u0070\u0051\u0048\u0064\u003d\u0074\u0059\u0052\u007e\u0043\u0048\u003b\u006e\u0053\u0049\u0079\u0073\u004f\u0041\u002f\u002b\u006b\u0063\u0074\u0068\u0040\u0035','\x53\x7c\x7e\x30\x6b','\u0035\u007b\u0047\u0044',FlX64in(0x2),'r:xD',FlX64in(R6W7hgd(-0x1)),'\u0045\u0079\u0048\u0062\u0063\u0069\u0050\u0066\u003c\u006b\u0051\u0065\u005d\u0063\u002f\u002c\u0062\u002b\u0075\u0066\u003c\u004d\u0047\u005d\u0032\u004a\u004f\u0053\u0031\u0049\u0069\u0064\u007c\u004f\u0060\u004e\u0032',FlX64in(R6W7hgd(0x1a)),FlX64in(R6W7hgd(0x0)),'\x43\x6d\x48\x3a\x69\x37\x42\x79','\u003a\u0043\u0041\u0021\u005a\u002f\u0029',FlX64in(R6W7hgd(-0x1)),'Q|jJ0,Cy','\u0071\u0049\u005a\u004e\u005b\u0038\u0029',FlX64in(R6W7hgd(0xe)),FlX64in(R6W7hgd(0x10)),'`M%ARco>dS0sgdgK@J',FlX64in(0x8),'\x23\x7c\x40\x4f\x5f\x45\x29',R6W7hgd(0x1),'\u002b\u0050\u004c\u004e\u004a\u002c\u006a\u0079','\x3b\x43\x51\x3f\x34\x3d\x32\x25\x25\x7e',FlX64in(0x9),FlX64in(0xa),'i{BDz','\x23\x7c\x61\x4f\x53\x2f\x77\x40\x34\x55\x3d\x3e\x35','\x7a\x7c\x47\x44\x6f\x54\x6b\x5a\x36','\x2e\x4d\x33\x34\x70\x53\x29',FlX64in(0xb),FlX64in(0xc),FlX64in(R6W7hgd(0x19)),'IC@Oj?5}V',FlX64in(0xe),R6W7hgd(0x4),'\x7a\x57\x38\x7d\x24\x47\x59\x5a\x78\x6a\x61\x2b\x79\x4d','\x23\x7c\x41\x21\x32\x30\x58\x3e\x4c\x2a\x3a\x6c\x43\x71\x6e\x76\x42\x35','2mYDZ/XG6','^mxD','\u0023\u007c\u0054\u004a\u007b\u0037\u004d\u0032\u0069\u0055\u0021\u005b\u002e\u0047\u0072\u007e\u003d\u0029','\u007a\u007c\u0072\u004f\u0032\u003f\u0065\u0079','\x3b\x62\x50\x78\x3d\x58\x3b\x79',R6W7hgd(0x3),'\u0067\u0057\u0041\u0021\u005e\u0030\u0038\u0042\u006f\u0023\u003b\u0055\u0076\u007b',FlX64in(R6W7hgd(0x0)),FlX64in(0xf),'\x67\x62\x7a\x6a\x59\x26\x71\x6b\x59\x44','\x73\x44\x61\x4f\x32\x5d\x37\x42\x74\x2b\x46\x50\x35',FlX64in(0x10),FlX64in(0x11),'\x77\x73\x2b\x30\x61\x37\x24\x26\x46\x51\x2c\x3c\x3b\x6f\x4e\x60\x57\x6d\x35\x5a\x33','\u006d\u006c\u0046\u004a\u0025\u0049\u007d\u0026\u0065\u007b\u004c',FlX64in(0x12),'%Ms(msd]z?m"v','\x3b\x24\x25\x50','\u0035\u007b\u0032\u003a\u0031\u0072\u0037\u0042\u0056\u002a\u0065',FlX64in(R6W7hgd(0x1e)),FlX64in(R6W7hgd(0x1f)),FlX64in(0x15),'\u004c\u0022\u0075\u003f\u005d\u003f\u0038\u005f\u0022\u0055\u0067\u0050\u0058\u0071\u006a\u0031\u0040\u004f\u0059\u006c\u007a','\u0022\u0057\u004c\u0062\u0061',FlX64in(0x16),'\x29\x50\x45\x4a\x3e\x6a\x62\x70\x79\x71\x34\x6c\x76','\x67\x57\x79\x63\x6a\x49\x47\x50',FlX64in(R6W7hgd(0x1d)),':MpPw','i{BDz',FlX64in(0x18),'^mxD',FlX64in(R6W7hgd(0x1c)),'\u0023\u007c\u0054\u004a\u007b\u0037\u004d\u0032\u0069\u0055\u0021\u005b\u002e\u0047\u0072\u007e\u003d\u0029',R6W7hgd(0x1),'\u005e\u006d\u0078\u0044',R6W7hgd(0x2),FlX64in(0x5),'\u003d\u0045\u007a\u007b','\x5e\x6d\x78\x44',FlX64in(0x1a),FlX64in(R6W7hgd(0x0)),FlX64in(0x1b),FlX64in(0x1c),'\x23\x7c\x54\x4a\x7b\x37\x4d\x32\x69\x55\x21\x5b\x2e\x47\x72\x7e\x3d\x29',FlX64in(0x1d),'#j<t.)m1w','\x5a\x4f\x7d\x36',FlX64in(R6W7hgd(0x22)),R6W7hgd(0x8),'\x4c\x22\x4e\x6b\x45\x54\x4c\x79','\x72\x25\x63\x7c\x44\x5e\x4f\x28\x40\x74\x60','\x5b\x73\x69\x35\x6c\x4a\x70\x45\x7b\x4e\x24\x6f\x21\x2b',FlX64in(R6W7hgd(0xd)),FlX64in(0x20),'\x5a\x4f\x7d\x36',R6W7hgd(0x2),'\x5e\x6d\x78\x44','\x31\x3c\x50\x71',FlX64in(R6W7hgd(0x24)),'\u0067\u0025\u002a\u007c\u0024\u0078\u0056\u0038\u0074\u004e\u0067\u0041\u0051\u0066\u0046\u003b\u0048\u0022\u003d\u0034\u0054\u0065\u0075\u002f\u0035\u0031\u003f\u004d\u0060',R6W7hgd(0x5),'\u0045\u0053\u003e\u0079\u0050\u0079\u0038\u0038\u0025',R6W7hgd(0x3),R6W7hgd(0x2),R6W7hgd(0x4),FlX64in(R6W7hgd(0x6)),'\u0061\u0062\u003e\u0049\u006e\u0029\u003b\u0041\u0060\u0063\u0062\u0074\u0
2024-11-12 11:17:55 +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