mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 08:19:11 +08:00
15 lines
104 KiB
JavaScript
15 lines
104 KiB
JavaScript
|
/*
|
|||
|
环境变量:
|
|||
|
export jd_opencard_draw="3" //抽奖次数 3
|
|||
|
export jd_opencard_notify="true" // 是否推送
|
|||
|
|
|||
|
cron:59 23 29 2 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('1.11 年味大欢聚 新年旺翻天')
|
|||
|
function u8Smx4(){}var zKfKQp6=Object['defineProperty'],EQpP_1M,SnR79h,PZopOk,muEYDA,qK8XqZ7,okMx15,KzXSNf_,TktyypM,I49e8rt,GEV5zIn,g7TQFl,zZCBo1,VEHwen,cfAYycL,CLn_D9,BhvRBC,QuwF1Gk;function dKpVgh(u8Smx4){return EQpP_1M[u8Smx4<0x15?u8Smx4+0x56:u8Smx4-0x16]}u8Smx4(EQpP_1M=H_lwrpH(),SnR79h=m3bXJ_((u8Smx4,zKfKQp6)=>{return zKfKQp6(u8Smx4())},0x2)(NDjnTr2,GLKo2b));var DGdNue=[],mwEYMz=[KfjCeg(dKpVgh(0x25)),KfjCeg(dKpVgh(0x24)),'\x4e\x5d\x5e\x47\x7c\x74\x49\x44','\u0057\u005f\u0040\u005a\u0078','U7QZ','\x5e\x6d\x26\x72\x31\x57\x3f\x58\x76\x59\x69\x56\x70\x65\x39\x5e\x76\x3e\x23\x3d\x77\x6b\x54','e]r4#','\x5e\x6d\x26\x72\x31\x57\x3f\x58\x76\x59\x69\x56\x70\x65\x6c\x3a\x31\x52\x55\x5a','\x51\x3e\x79\x5a\x66\x74\x48\x6b\x22\x41\x7a\x26\x7e\x70\x21\x62\x28\x51\x2a\x7c\x6f\x34\x66\x7a\x72\x49\x53\x7e\x25\x65\x6c\x62\x76\x37\x79\x75\x3b\x75\x54','\u0071\u002e\u0066\u0069\u0021',',RX0',KfjCeg(0x2),'\u005f\u003d\u0042\u0030','\u0044\u0052\u0040\u0034\u0023','\x55\x44\x67\x3e\x70\x40\x5d\x29\x3f\x21\x4b\x2a\x65\x70\x28\x74\x3e\x4e\x36\x29\x3f\x60\x58\x65\x23\x7c\x34\x71\x77\x37\x40\x64\x2e\x34\x56\x47\x23','>FL0x','\x3a\x4a\x42\x30',KfjCeg(dKpVgh(0x2a)),KfjCeg(0x4),'\u0051\u003e\u0079\u005a\u0030\u0062\u0064\u006b\u0037\u0059\u0071\u005d\u0032\u0028\u0073\u0066\u006c\u0067\u0025\u0022\u0071\u0037\u0044\u0024\u0034\u0079\u0028\u004e\u005d\u0022\u0035\u0029\u0051\u004f\u007b\u0030\u0055\u0034\u007a\u007a\u003d\u007a\u0038','\u0030\u003c\u0025\u007d\u0024\u0031\u0038\u0044\u0024\u004e\u0028',KfjCeg(0x5),'K.I|itlD',KfjCeg(0x6),'\x77\x76\x4d\x48\x3f\x39\x64\x47\x29\x3f\x3c\x26\x3d',KfjCeg(0x7),KfjCeg(dKpVgh(0x2c)),KfjCeg(0x9),KfjCeg(0xa),'\x44\x35\x4d\x72\x40\x6a\x23\x54\x3a\x54\x3f\x2c\x47','\u006c\u004a\u0067\u003d\u0040\u0053\u004c\u0044',KfjCeg(0xb),'\u004b\u002e\u0049\u007c\u0069\u0074\u006c\u0044','\u007e\u0037\u0068\u0047\u0048\u007d\u0054','\x46\x52\x33\x57\x63\x6a\x46\x3e\x60\x32\x77',KfjCeg(dKpVgh(0x33)),'\u0050\u002e\u0046\u007c\u0071\u0069\u0068\u007b\u007e\u0036\u0055\u0047\u006c\u007e\u006c\u0062\u005a\u002c','\x55\x3e\x3a\x42\x6a\x53\x5e\x44','P.z4/UT',KfjCeg(0xd),'\x25\x6c\x4b\x75\x6e\x38\x23\x72\x72\x66',KfjCeg(0xe),KfjCeg(dKpVgh(0x26)),'\x40\x52\x4c\x30\x78','\u0045\u0048\u003e\u006f\u0075\u006a\u0037\u0050','\u0050\u002e\u0045\u0034\u0071\u0028\u0051\u007a\u006e\u0059\u0038\u004d\u002c',KfjCeg(0x10),dKpVgh(0x1a),'\x26\x43\x46\x7c\x51\x39\x54','\u003a\u004a\u003d\u0047\u0035\u0058\u0024\u0044','\u0037\u006c\u007a\u0034\u0049\u0075\u002c\u0041\u0063','\x46\x46\x42\x5d\x4f\x24\x29\x44',KfjCeg(0x11),'\u007e\u006b\u0070\u007a\u0057\u0065\u0044\u0074\u005e',KfjCeg(dKpVgh(0x29)),'\x55\x37\x72\x42\x63\x53\x25\x68\x31','\x38\x3d\x5b\x41\x37\x58\x7c\x63\x58\x50','\u0040\u004a\u002f\u0047\u0073\u007c\u0054','@J/Gs|%D','\u003a\u004a\u0042\u0030',KfjCeg(0x13),dKpVgh(0x18),'\x52\x6c\x3c\x74','JXJ?Dz_|`:3+#/shM$fngsV',KfjCeg(dKpVgh(0x3a)),KfjCeg(0x15),'\u0045\u003d\u007d\u0041\u003c\u0041\u0072\u0062\u0025\u0050\u0038','$0E4#eID',dKpVgh(0x1e),'\u007e\u0037\u0068\u0047\u0048\u007d\u0054',KfjCeg(0x16),'\u0024\u0030\u0045\u0034\u0023\u0065\u004e\u004c\u002b\u0050\u0025\u0059\u0062\u0052','\u0046\u0078\u0036\u007d\u003d\u003d\u0037\u0036\u005d\u0069\u0055',KfjCeg(dKpVgh(0x3b)),'\u003a\u004a\u0042\u0030','\u0064\u004a\u0023\u003d\u0058\u0074\u0025\u0044',KfjCeg(0x18),KfjCeg(dKpVgh(0x37)),'\x35\x4a\x6a\x47\x64\x46\x29\x44',KfjCeg(0x1a),'gZNqO',KfjCeg(0x1b),KfjCeg(0x1c),'\u0071\u002e\u0048\u005a',dKpVgh(0x1f),'\x45\x5a\x43\x46','\u0079\u0024\u007d\u0041\u007d\u003c\u003a\u006e\u0048\u0059\u0051\u0059\u003a\u005e\u002f\u0037','[l{0[+:nHY0gLen','\u0038\u003d\u0047\u0021\u005f\u007c\u0063\u007a\u0030\u0066\u004c\u005d\u002c','\u004b\u002e\u0049\u007c\u0069\u0074\u006c\u0044',KfjCeg(dKpVgh(0x36)),'\u0035\u002e\u007b\u0030\u0021\u0028\u006e\u0041\u003e\u0066','\x50\x2e\x45\x34\x51\x58\x77\x44\x5a\x66\x52\x2b\x31\x48\x7d\x37\x46\x5d\x43',KfjCeg(0x1e),KfjCeg(0x1f),'_ho[nRVGW|UsTxdXzrY)#fc*^Vx.,c',KfjCeg(0x20),'\u0045\u0050\u0058\u0037','\x57\x5d\x23\x3d\x35\x28\x54','\u003a\u004a\u0079\u005a\u0034\u0028\u006e\u0041\u0063','\x76\x55\x30\x5f\x64','
|
|||
|
|
|||
|
// 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
|