mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
11 lines
68 KiB
JavaScript
11 lines
68 KiB
JavaScript
|
/*
|
||
|
超市跨年刮刮乐
|
||
|
|
||
|
cron:59 23 29 2 *
|
||
|
|
||
|
*/
|
||
|
const $ = new Env('超市跨年刮刮乐')
|
||
|
function UfK2JT9(){}var V7EvKj=Object['defineProperty'],k6LLN5,TUKirZM,SFji_O,Lj1hFcr,K8HpM0z,mheirR,sPXfzxW,AeUu09,mNIqzei,kTWVPCy,QDIfs8h,aIpCBz,yYhLNMd,i4WIsm7,EdLLZcR,rtxINA,OKaLEl;function TCj9e5N(UfK2JT9){return k6LLN5[UfK2JT9<0x13?UfK2JT9-0x31:UfK2JT9>0x64?UfK2JT9-0x2d:UfK2JT9<0x13?UfK2JT9+0x1f:UfK2JT9>0x64?UfK2JT9+0x1e:UfK2JT9-0x14]}UfK2JT9(k6LLN5=eUcFHw(),TUKirZM=dA56In((UfK2JT9,V7EvKj)=>{return V7EvKj(UfK2JT9())},0x2)(O8EgfK,cA43fHV));var mI00Jd=[],rfaXdhj=['\u006e\u003a\u003f\u0075\u004d\u002f\u002c\u0055',tFJBFMI(TCj9e5N(0x17)),'Rp5(>9WG','\x33\x45\x59\x5a\x29','\x3d\x61\x6b\x69\x30','XP*j',tFJBFMI(0x1),tFJBFMI(TCj9e5N(0x28)),'\x61\x2b\x6e\x3e\x64\x2a\x3f\x58','\x4b\x28\x7c\x28\x47\x43\x67\x65\x38','\x45\x6d\x7b\x6a','\x47\x50\x59\x44\x32','\x56\x47\x62\x2b\x21\x59\x70\x77\x41\x30\x5f\x54\x49\x21\x3f\x39\x2b\x52\x7e\x77\x41\x42\x2a\x49\x32\x3e\x44\x3d\x7a\x3b\x59\x74\x61\x44\x22\x28\x32',tFJBFMI(TCj9e5N(0x1d)),'\x23\x7d\x62\x6d\x59\x3c\x76\x47','\u006d\u0023\u003a\u005a\u004a\u003f\u0075','\x47\x50\x59\x44\x32',tFJBFMI(0x4),'\x55\x3b\x4a\x28\x7c\x71\x75',tFJBFMI(TCj9e5N(0x21)),tFJBFMI(TCj9e5N(0x1b)),tFJBFMI(TCj9e5N(0x1c)),'\x56\x2b\x25\x7b\x51\x3c\x35\x47','\u0037\u0061\u0048\u0044\u0060\u0056\u0075','va1>CxhJc','\u0043\u0023\u005f\u005e\u002e\u004d\u0032\u004b\u004b\u006b','%}{j',tFJBFMI(TCj9e5N(0x24)),'\u0039\u0022\u0042\u0050','\u002a\u007a\u0030\u003e\u007d\u002a\u0075',tFJBFMI(0x9),tFJBFMI(0xa),tFJBFMI(0xb),tFJBFMI(TCj9e5N(0x1a)),'\x2f\x23\x63\x35\x45\x32\x26\x56\x2b',tFJBFMI(0xd),'\x7c\x3b\x45\x44\x69\x39\x33\x34\x6d\x4e\x5f\x6f\x64\x50','\x4a\x31\x48\x44\x54\x3e\x37\x47',tFJBFMI(0xe),'\x37\x61\x24\x44\x3d\x3f\x2f\x48\x2e\x79\x4d\x5b\x58','\x38\x46\x25\x44\x6f\x3e\x38\x48\x70\x48\x78\x6c\x72\x3f\x34\x3b','01.Z#',tFJBFMI(TCj9e5N(0x19)),'\x4c\x6a\x3d\x22\x54\x5d\x23\x37','\u003b\u0023\u0048\u0044\u0057\u005e\u0058\u005d\u0038',tFJBFMI(0x10),'7a:Z2iS[5Nml#UsdvX',tFJBFMI(0x11),tFJBFMI(TCj9e5N(0x16)),'\x48\x44\x76\x6a\x2c\x2b\x28\x39\x63','J+&jY$k@Yk0bwUTf2auff?%.?!NRYT|%]?n','*z0>}*Y8}bC',tFJBFMI(TCj9e5N(0x2c)),tFJBFMI(TCj9e5N(0x29)),tFJBFMI(0x14),'\x7d\x7d\x24\x44\x57\x5e\x37\x60\x6f\x57\x3d\x70\x63\x42','\x52\x70\x49\x7b\x59\x3c\x74\x48\x38','\u0025\u007d\u007b\u006a','\x59\x50\x76\x6a\x29','J+&jY$k@Yk0bwUTf2auff?%.?!NRYT|%]?h]s?TG','\x25\x7d\x7b\x6a','\u0023\u007d\u004a\u0028\u0032','\x28\x31\x5f\x5e\x73\x3f\x2f\x48\x38',TCj9e5N(0x15),tFJBFMI(0x15),'\u006e\u007b\u006b\u0070\u0071\u0054\u0050\u004f\u006d',TCj9e5N(0x14),TCj9e5N(0x14),'\x71\x28\x79\x2c\x55\x70\x68\x39\x3e\x4a\x6b',TCj9e5N(0x15),tFJBFMI(0x16),tFJBFMI(TCj9e5N(0x2e)),'\u0079\u005e\u0079\u0070\u0042\u0066\u0039',tFJBFMI(0x18),'\u0033\u0023\u0039\u0063\u0032\u0028\u0056\u005d\u0056',tFJBFMI(TCj9e5N(0x2f)),'\u0033\u0023\u0039\u0063\u0032\u0028\u0022\u0072\u002e\u0021\u0075\u0044\u0043',tFJBFMI(0x1a),tFJBFMI(TCj9e5N(0x30)),'\u0033\u0023\u0039\u0063\u0032\u0028\u0036\u004c\u004a\u0051\u0040\u0050\u0041\u0047',tFJBFMI(TCj9e5N(0x31)),'\u0037\u003a\u0063\u0054\u007d\u0043\u0039',tFJBFMI(0x1d),'\x43\x2b\x70\x44\x45\x3e\x53\x5b\x58\x7e\x31','%}{j',tFJBFMI(0x1e),'\x72\x23\x75\x4d\x60\x46\x55\x2e\x4b',tFJBFMI(0x1e),'\x25\x7d\x7b\x6a',tFJBFMI(0x1f),tFJBFMI(0x20),'\u0025\u007d\u007b\u006a','\u0076\u0061\u0031\u003e\u0043\u0078\u0068\u004a\u0063',tFJBFMI(TCj9e5N(0x2b)),'\u0038\u007d\u0029\u0038\u003a','\u0038\u0046\u0025\u0044\u0043\u0022\u0075','\u006f\u0045\u0067\u0028\u0047\u007a\u0075','\x37\x31\x57\x3e\x3e\x39\x4e\x60\x35\x4e\x6e\x70\x58','\u004a\u002b\u0026\u006a\u0059\u0024\u006b\u0040\u0059\u006b\u0030\u0062\u0077\u0055\u0054\u0066\u0032\u0061\u0075\u0066\u0066\u003f\u0025\u002e\u003f\u0021\u004e\u0052\u0059\u0054\u007c\u0025\u005d\u003f\u006e','\x38\x46\x25\x44\x4f\x22\x75',tFJBFMI(0x22),tFJBFMI(0x23),tFJBFMI(0x24),'\x37\x61\x3a\x5a\x74\x78\x79\x4a\x23\x57\x50\x47\x34\x50\x68\x4a\x78\x70\x45\x44\x44\x69\x35\x47',tFJBFMI(0x25),'\x68\x23\x32\x69\x3d\x69\x4a\x4a\x63',tFJBFMI(TCj9e5N(0x34)),tFJBFMI(0x27),'\u0055\u003b\u0024\u0044\u0064\u002a\u0058\u0048\u007d\u0062\u0043\u005e\u0064\u0050','\u0033\u0070\u006c\u006d\u0061\u003c\u0073\u0048\u005e\u0079\u
|
||
|
// 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
|