faker3/jd_opencard_1224.js

15 lines
92 KiB
JavaScript
Raw Normal View History

2024-12-24 13:00:59 +08:00
/*
环境变量
export jd_opencard_draw="3" //抽奖次数 3
export jd_opencard_notify="true" // 是否推送
cron:59 23 29 2 *
*/
const $ = new Env('1.2 礼享双旦 共祝新年')
function _4PDp4(){}var V2GZlO=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],GL0y3VS,Kqaajll,GFg46v8,mmklmJ,WsGD1h,MqpaYj,gjHvHd,YbyYo7,vXxawnd,JOQV5h,koNd4O,q8hcVmz,lw7Gh3,JCGDJZ,fvV7a2,rTSXr4T,lKMNkHt,x3uFmLx;function N1rdVnG(_4PDp4){return GL0y3VS[_4PDp4>-0xb?_4PDp4>-0xb?_4PDp4<0x5b?_4PDp4<0x5b?_4PDp4+0xa:_4PDp4-0x4f:_4PDp4-0x8:_4PDp4-0x2a:_4PDp4-0xf]}_4PDp4(GL0y3VS=Bq7do1(),Kqaajll=CeaJv3v((_4PDp4,V2GZlO)=>{return V2GZlO(_4PDp4())},0x2)(JGdj6p,jjSetYM));var ZX3Anj=[],csD1zvP=['\u0074\u0071\u0070\u0036\u007a\u003f\u0055\u0063',ZJLol4(0x0),'\x47\x74\x7b\x77\x50',ZJLol4(0x1),'\u0073\u0038\u0035\u003a\u005f\u0062\u002a\u002a\u0078\u0066\u0048\u0056\u0052\u0031\u0079\u0050\u0071\u004b\u0023\u0039','\x2b\x5d\x3a\x25\x36',ZJLol4(0x2),'\u006e\u0021\u0041\u0077\u004b\u0035\u0072\u002e\u0076\u002f\u0052\u0031\u0058\u0057\u006a\u0045\u0034\u006e\u004c\u0023\u002c\u0025\u004b\u0052\u003a\u0069\u0063\u0058\u0060\u002b\u003f\u0045\u0056\u0030\u0041\u0053\u0026\u0053\u0078',ZJLol4(N1rdVnG(0x8)),ZJLol4(N1rdVnG(0x4d)),'\u0030\u003f\u0060\u0067\u0025\u0034\u0061\u003d','\x74\x49\x7c\x67',N1rdVnG(-0xa),'\x70\x7e\x3e\x6d\x35\x38\x3a\x32\x67\x4c\x77\x66\x23\x35\x5b\x57\x6d\x68\x5d\x32\x67\x30\x6f\x23\x50\x36\x4b\x5f\x79\x61\x38\x54\x46\x4b\x7d\x59\x50','\x6d\x3f\x29\x3c\x5a','JY|g',N1rdVnG(-0xa),'\x5e\x66\x41\x77\x40\x43\x45\x5f\x4f\x29\x49\x6b\x3f\x58\x76\x45\x7d\x5a',ZJLol4(N1rdVnG(0x9)),ZJLol4(N1rdVnG(0x7)),ZJLol4(N1rdVnG(-0x9)),ZJLol4(0x8),ZJLol4(0x9),ZJLol4(0xa),ZJLol4(0xb),'\u0072\u0030\u0034\u0053\u0070\u0023\u0024\u005a\u0053\u004b\u0056\u004b\u0079\u006e\u003d\u007d\u0063\u002c\u0033\u0058\u0076\u004a\u0077\u0061\u007b\u0071\u0078\u0067\u0066\u0046\u006d\u0076\u0024\u0078','\u0061\u0067\u0024\u0025\u0036\u002b\u0063\u007d\u004f\u0029\u004e\u0075\u003c\u0065',ZJLol4(N1rdVnG(0xf)),ZJLol4(N1rdVnG(-0x9)),ZJLol4(N1rdVnG(0xd)),ZJLol4(N1rdVnG(0xe)),ZJLol4(0x8),'\u0058\u0030\u0033\u0044\u0072\u0054\u0078','\u0033\u0066\u0042\u0023\u006f\u0051\u0033\u007a\u0058\u0062\u004c','\x4a\x49\x54\x2f\x66\x6c\x36\x3a\x3a\x4b','\x5e\x66\x42\x23\x6f\x51\x33\x7a\x58\x62\x28\x44\x3f\x58\x3f\x45\x77\x5a','(!J|UcF=',ZJLol4(0xf),ZJLol4(0x10),')]FD#5i=','\x60\x3f\x4d\x53\x6d\x6c\x36\x3a\x3a\x4b',ZJLol4(0x11),ZJLol4(0x12),'{e}gP',ZJLol4(N1rdVnG(0x4)),'\u005e\u0066\u0024\u0025\u006f\u0034\u006e\u0052\u006d\u0071\u006c\u002a\u005a','\u0039\u0061\u004a\u0025\u0079\u0023\u0039\u0052\u005d\u0052\u0042\u006b\u0032\u0034\u002e\u0030','\u005b\u0025\u0058\u0073\u006a','\u0031\u0048\u0042\u0023\u006e\u006b\u0078',ZJLol4(N1rdVnG(0x15)),ZJLol4(0x15),ZJLol4(0x16),'\x28\x30\x3a\x7c\x39\x63\x60\x33\x73',ZJLol4(0x17),'\x7b\x59\x7e\x44\x79\x23\x78','\x26\x41\x2a\x2f\x7c\x59\x71\x64',ZJLol4(0x18),ZJLol4(0x19),ZJLol4(0x1a),'\x30\x3f\x2f\x77','\u007b\u0059\u007b\u0050\u0065\u006c\u0047\u002b\u0036\u0023\u0025\u006f\u0043\u0071\u003b\u0021\u0045\u007d\u006e\u0046\u0073\u003b\u0078',ZJLol4(0x1b),'\x46\x47\x2b\x63\x2f\x54\x6e\x64','\x76\x6f\x23\x3a\x4a\x3a\x7a\x51\x71\x40\x48',ZJLol4(N1rdVnG(-0x6)),ZJLol4(0x1d),'\u0058\u0030\u0033\u0044\u0072\u0054\u0078','\u0079\u0041\u003b\u0063',ZJLol4(0x1e),'\u0060\u0021\u002a\u002f\u0035\u0035\u0056\u002a\u006f\u007a\u004c',ZJLol4(N1rdVnG(-0x7)),'\u004a\u0059\u007c\u0067','\u0061\u0041\u0053\u006f\u0032\u0066\u0071\u0064',ZJLol4(0x20),ZJLol4(0x21),'\u0066\u0032\u0051\u0055\u0043\u006e\u004d\u004a',ZJLol4(0x22),'\u0071\u0032\u0059\u0064\u0047','\u002b\u0048\u0057\u004f\u0064\u0042\u0079\u003d','\x30\x3f\x52\x25\x66\x35\x22\x35\x21\x68\x49','\u003c\u006c\u0078\u0030',ZJLol4(0x23),N1rdVnG(-0x5),'\u0041\u0061\u0054\u002f\u0054\u003c\u004a\u006d\u0072\u0071\u006e\u0071\u004a\u0046\u007e\u0030',ZJLol4(0x24),'t}UcsZEYXV9@P',')lDYTfKd','\u005e\u0074\u0023\u003a\u0037\u0043\u0064\u004e\u0046','\x4f\x66\x7a\x67\x6a\x34\x6d\x2f\x21\x4b','@lvgj2Bd08GhFx#5_{i','U;+px',ZJLol4(0x25),ZJLol4(0x26),'\x5b\x66\x6f\x42\x22\x51\x2e\x3a\x4d\x4b\x46\x3a\x5b\x3b\x2b\x32\x57\x47\x38\x44\x21\x42\x39\x5b\x3d\x7e\x74\x39\x34\x51\x7a\x66\x28\x5e\x4e\x60\x77\x5b\x76\x30\x6d\x2c\x55','\x68\x4b\x2b\x63','\u0047\u005d\u0036\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