mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 08:19:11 +08:00
12 lines
69 KiB
JavaScript
12 lines
69 KiB
JavaScript
|
/*
|
||
|
超市新人奖励
|
||
|
|
||
|
cron:1 1 1 1 *
|
||
|
|
||
|
*/
|
||
|
const $ = new Env('超市新人奖励')
|
||
|
function FdHwPrk(){}var j8FYV_=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],pDZkIrX,IbaSDM,zHaOuG,s8TvgE,SoR1_wS,KMhsWeW,CuGX34,BpO1j3H,yCK_eQ,splvd0,s0fhyb,ZiGMVk,TAmASQN,vSJke9x,t4qn6e,awWI6Ka;function tqhDgLX(FdHwPrk){return pDZkIrX[FdHwPrk<0x3b?FdHwPrk+0x3f:FdHwPrk<0xb8?FdHwPrk>0xb8?FdHwPrk-0x51:FdHwPrk-0x3c:FdHwPrk+0x23]}pDZkIrX=ID6yQCW();function EIo1TF2(FdHwPrk,j8FYV_){return IbaSDM.call(tqhDgLX(0x8f),FdHwPrk,'\x6c\x65\x6e\x67\x74\x68',{value:j8FYV_,configurable:!0x0})}FdHwPrk(IbaSDM=Object.defineProperty,zHaOuG=EIo1TF2(SismKwE((...j8FYV_)=>{var IbaSDM=SismKwE(j8FYV_=>{return pDZkIrX[j8FYV_>0x5c?j8FYV_-0x5a:j8FYV_>-0x21?j8FYV_<0x5c?j8FYV_>0x5c?j8FYV_+0x1d:j8FYV_+0x20:j8FYV_-0xb:j8FYV_-0x40]},0x1);FdHwPrk(j8FYV_[tqhDgLX(0x42)]=0x2,j8FYV_.K46fKH=j8FYV_[IbaSDM(-0x20)]);return j8FYV_.K46fKH(j8FYV_[0x0]())}),0x2)(GVxPaHH,_EvIRh));var YrGK8_=[],oEAh6GQ=[k0B05_(0x0),k0B05_(tqhDgLX(0x3c)),k0B05_(0x2),k0B05_(0x3),k0B05_(0x4),k0B05_(tqhDgLX(0x4f)),k0B05_(0x6),k0B05_(0x7),k0B05_(tqhDgLX(0x5f)),k0B05_(0x9),k0B05_(tqhDgLX(0x89)),k0B05_(0xb),k0B05_(0xc),'Yn?Ual|A',k0B05_(tqhDgLX(0x5b)),k0B05_(0xe),k0B05_(tqhDgLX(0x90)),k0B05_(0x10),k0B05_(0x11),k0B05_(0x12),k0B05_(0x13),k0B05_(tqhDgLX(0x6f)),k0B05_(tqhDgLX(0x6d)),k0B05_(tqhDgLX(0x58)),k0B05_(0x17),k0B05_(0x18),k0B05_(0x19),k0B05_(tqhDgLX(0x5c)),k0B05_(0x1b),k0B05_(tqhDgLX(0x6e)),k0B05_(tqhDgLX(0x55)),k0B05_(0x1e),k0B05_(0x1f),k0B05_(tqhDgLX(0x73)),k0B05_(tqhDgLX(0x71)),k0B05_(tqhDgLX(0x72)),'\x2e\x75\x7e\x76\x3d\x78\x6c\x7c\x72',k0B05_(0x23),k0B05_(0x24),k0B05_(0x25),'ac|%i',k0B05_(0x26),k0B05_(0x27),k0B05_(0x28),k0B05_(tqhDgLX(0x44)),k0B05_(tqhDgLX(0x75)),k0B05_(tqhDgLX(0x76)),k0B05_(tqhDgLX(0x43)),'\u002e\u0075\u006d\u003c\u004d\u003e\u0078\u0034\u004e\u006a\u0055\u005b\u0059\u0057\u006f\u0032\u007c\u004c',k0B05_(0x2d),k0B05_(0x2e),'\u007e\u0076\u007c\u0025\u002b\u0047\u0068\u0065\u0072',k0B05_(0x2f),k0B05_(0x30),k0B05_(0x31),k0B05_(0x32),'ac|%i',k0B05_(0x33),k0B05_(0x34),k0B05_(0xf),k0B05_(tqhDgLX(0x3d)),k0B05_(tqhDgLX(0x3e)),k0B05_(0x36),k0B05_(0x37),k0B05_(tqhDgLX(0x7c)),k0B05_(0x39),k0B05_(tqhDgLX(0x3d)),k0B05_(0x3a),k0B05_(0x3b),'gYav(e;|aI',k0B05_(0x3c),k0B05_(0x3d),k0B05_(0x3e),k0B05_(tqhDgLX(0x3d)),k0B05_(tqhDgLX(0x4b)),k0B05_(tqhDgLX(0x9c)),k0B05_(tqhDgLX(0x7f)),k0B05_(0x3b),k0B05_(0x42),k0B05_(tqhDgLX(0x80)),k0B05_(tqhDgLX(0x41)),k0B05_(tqhDgLX(0x3d)),k0B05_(tqhDgLX(0x81)),k0B05_(0x46),'g%6vMTl|vm8grJE',k0B05_(tqhDgLX(0x82)),k0B05_(tqhDgLX(0x6a)),k0B05_(0x49),k0B05_(tqhDgLX(0x83)),k0B05_(tqhDgLX(0x3d)),k0B05_(tqhDgLX(0x3e)),k0B05_(0x2e),k0B05_(0x4b),k0B05_(tqhDgLX(0x84)),k0B05_(tqhDgLX(0x3f)),'TK6v|','|u!8)Sq;r',k0B05_(tqhDgLX(0x3d)),k0B05_(tqhDgLX(0x3d)),k0B05_(tqhDgLX(0x40)),k0B05_(tqhDgLX(0x3f)),k0B05_(tqhDgLX(0x3d)),'|u!8)Sq;r',k0B05_(0x25),k0B05_(0x4e),k0B05_(0x4f),k0B05_(0x50),k0B05_(0x51),k0B05_(0x52),k0B05_(0x53),k0B05_(0x54),k0B05_(0x55),'|95CCi^0M^EA1',k0B05_(0x56),k0B05_(0x57),k0B05_(tqhDgLX(0x40)),k0B05_(tqhDgLX(0x5a)),k0B05_(0x59),k0B05_(0x5a),k0B05_(tqhDgLX(0x41)),k0B05_(tqhDgLX(0x63)),k0B05_(0x5c),k0B05_(0x45),k0B05_(0x5d),k0B05_(0x5e),k0B05_(0x5f),k0B05_(tqhDgLX(0xa7)),'QY`Jz]3oO||I.lKY:t;Ja{Zy4uuU1',k0B05_(0x61),k0B05_(0x62),k0B05_(0x63),k0B05_(0x64),k0B05_(tqhDgLX(0x88)),k0B05_(0x31),k0B05_(0x66),k0B05_(tqhDgLX(0x8e)),k0B05_(0x68),k0B05_(0x69),k0B05_(0x6a),k0B05_(tqhDgLX(0x92)),k0B05_(0x6c),k0B05_(0x6d),k0B05_(0x6e),k0B05_(0x6f),k0B05_(0x70),k0B05_(0x71),k0B05_(0x72),k0B05_(0x73),'\x6a\x78\x3d\x22\x71\x67\x7c\x65',k0B05_(0x74),k0B05_(0x75),k0B05_(tqhDgLX(0xb4)),k0B05_(tqhDgLX(0xb2)),'Ml|%,h~,VH2QYWJOg}lY*','*%Chc(dVq]m?[!|3.uK',k0B05_(tqhDgLX(0x8d)),'kn^Sq];j+Vfs|<D','\u0050\u0067\u006b\u0025\u0077\u006c\u005b\u0050\u006e\u003f\u0051\u0052\u0031\u0054\u002c\u0040\u002e\u003f\u004c\u003e\u0030\u0068\u005d\u0060\u0061\u003f\u0065\u0064\u005e\u006f\u0045\u004e\u0073\u0022\u002c\u003a\u0047\u0026\u0052\u007c\u0072',k0B05_(0x79),k0B05_(0x7a),k0B05_(0x7b),k0B05_(0x7c),k0B05_(tqhDgLX(0x95)),k0B05_(0x7e),k0B05_(0x7f),k0B05_(0x80),k0B05_(0x81),'<,|>&lB;CjF_(A%',k0B05_(0x82),k0B05_(0x83),k0B05_(0x84),k0B05_(tqhDgLX(0x8b)),k0B05_(0x86),
|
||
|
|
||
|
// 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
|