faker3/jd_opencard_0305.js

15 lines
116 KiB
JavaScript
Raw Normal View History

2025-03-06 11:41:55 +08:00
/*
环境变量
export jd_opencard_draw="3" //抽奖次数 3
export jd_opencard_notify="true" // 是否推送
cron:59 23 29 2 *
*/
const $ = new Env('3.9 焕新倍护 大胆悦己')
function ZDfvfJ(){}var OZN3ETT=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],nV4AJgz,IyM7J2,ktZ0X6,ruhvZq,sV1vx8S,jZS_wy,JFoBNk,pcWfg34,vHyMEz,_LXDctf,d1x1sX,IUdB1Z,BsZhTCK,pDymbLb;function OYq4Dm(ZDfvfJ){return nV4AJgz[ZDfvfJ<0x25?ZDfvfJ-0x53:ZDfvfJ<0x25?ZDfvfJ+0x3a:ZDfvfJ>0x9e?ZDfvfJ+0x30:ZDfvfJ>0x9e?ZDfvfJ-0x1c:ZDfvfJ-0x26]}ZDfvfJ(nV4AJgz=f2ADqqD(),IyM7J2=dmH8P8R((ZDfvfJ,OZN3ETT)=>{return OZN3ETT(ZDfvfJ())},0x2)(XLS4fl,l190Yu));var OrdMyJ=[],fvgqRtn=['8<>_k&|%','\x31\x2e\x24\x25\x59\x3f\x6a\x66','\x67\x49\x30\x62\x7c','\u002f\u0047\u0076\u0062','\x36\x65\x2b\x44\x28\x67\x7d\x5b\x32\x45\x3b\x4a\x69\x4c\x54\x36\x32\x42\x34\x3e\x6c\x43\x64',ryFgJD(0x0),ryFgJD(OYq4Dm(0x45)),ryFgJD(OYq4Dm(0x4a)),'\u003c\u0077\u0057\u003b\u002e','\x52\x6a\x5b\x31',ryFgJD(OYq4Dm(0x3d)),'\u004c\u006a\u0040\u0075','yj0^4','\x6c\x22\x43\x2c\x61\x37\x65\x63\x25\x58\x53\x69\x6b\x61\x34\x62\x2c\x6e\x50\x63\x25\x2b\x41\x6b\x45\x47\x36\x3a\x3d\x7d\x37\x59\x7c\x36\x30\x3e\x45','\u0042\u007b\u0021\u0031\u007c','\x61\x46\x6d\x31','yj0^4','5wHbZ[uM7$>TS)*u!R',ryFgJD(OYq4Dm(0x3e)),ryFgJD(0x5),ryFgJD(0x6),'\x6c\x7c\x3a\x34\x30\x2b\x7a\x72',ryFgJD(OYq4Dm(0x2f)),'\u0024\u0037\u007e\u0049\u0029\u005a\u0068\u0058\u0022\u0029\u0026\u0054\u0064','\x44\x3d\x54\x60\x21\x4e\x30\x3e\x3b\x65','\u003a\u0047\u0039\u0038\u003f\u0059\u0040\u0052\u0038\u0057\u003b\u0030\u0061\u0053\u0076\u0034\u0042\u0049\u007b\u0039\u006e\u0037\u0071\u0074\u0074\u0074\u002f\u005f\u0079\u0076\u004f\u006c\u0070\u0064','s1@^4L%!7$,Jrj','Jocfh9d])5x','\u0058\u003f\u0048\u0062\u005e\u003b\u0061\u0056\u007e\u0056\u003e\u0063\u0052','\x53\x46\x23\x3e\x30\x25\x21\x79',ryFgJD(OYq4Dm(0x44)),ryFgJD(OYq4Dm(0x27)),'\x46\x32\x70\x33\x75\x7b\x64','\u0070\u007c\u0023\u0034\u0063\u0030\u0070\u0069\u0046\u0045\u0024','\u006f\u0029\u007b\u002e\u007c\u004a\u0021\u0061\u0061\u0065','\x79\x7c\x23\x34\x63\x30\x70\x69\x46\x45\x37\x33\x7a\x46\x7a\x77\x73\x58','7;oUQkHr',ryFgJD(OYq4Dm(0x59)),'\u0021\u0077\u003f\u0059\u003d\u007b\u005a\u005d\u0028','\u0043\u0067\u0048\u0033\u0034\u002b\u003a\u0072','\u0038\u007a\u006c\u0031\u002c\u004a\u0021\u0061\u0061\u0065',ryFgJD(0xb),'\u0038\u006a\u0041\u0068\u0062\u0065\u0075\u0028',ryFgJD(OYq4Dm(0x3a)),ryFgJD(OYq4Dm(0x43)),'y|T`c&fm,?J>X',ryFgJD(OYq4Dm(0x4b)),'\x2e\x3f\x58\x62\x53','\u002b\u0071\u007b\u0059\u0076\u0054\u0064',ryFgJD(0xf),ryFgJD(OYq4Dm(0x49)),ryFgJD(0x11),'\u0028\u004a\u0066\u0050\u006c\u006d\u0026\u004f\u0067','\u0076\u0056\u002f\u0046\u004a\u0072\u0037\u006c\u0072\u002c','\x30\x46\x4f\x68\x7a\x59\x64','\x30\x46\x4f\x68\x7a\x59\x3d\x79',ryFgJD(0x12),'\u0058\u0064\u002e\u0062\u0073\u0063\u004f\u004e\u007e\u006e\u003b\u004d\u0046\u002c\u0045\u0072\u002c\u006c\u0054\u003c\u0030\u0063\u0065\u002a\u003d\u0077\u0073\u003d\u007a\u004c\u002a\u0043\u0055\u002c\u0077\u005a\u0032\u002b\u004c\u0059\u0060\u005d\u007d\u0021\u0048',OYq4Dm(0x26),'\u004a\u0044\u0046\u0047','tRtzYv>.|7)KrB@28w_bg@9','\u0030\u006a\u0021\u0031\u007c','\x67\x59\x45\x6f\x4e\x6e\x2f\x48','\x3d\x56\x22\x46\x7d\x46\x66\x38\x26\x2c\x76','\x36\x6f\x3d\x29\x7c\x2e\x7b\x48',OYq4Dm(0x28),'5JON:"9','\u0061\u0046\u006d\u0031','\u0036\u006f\u003d\u0029\u007c\u002e\u0071\u0077\u0043\u002c\u0026\u0042\u0038\u0059',ryFgJD(OYq4Dm(0x4f)),ryFgJD(OYq4Dm(0x50)),'\x73\x52\x50\x6f','\u0055\u0052\u007c\u0056\u0072\u0064\u0026\u0048','\u0060\u0046\u0034\u003e\u005b\u006e\u0039\u0058\u0071','\u0033\u0052\u007c\u0056\u003f\u0057\u002c\u0048','\u0033\u0052\u0070\u004e\u0055\u007e\u003c\u0048',ryFgJD(OYq4Dm(0x30)),'\u0025\u0052\u004c\u0029\u007c','\x4c\x71\x69\x37\x60\x7b\x7a\x79','JDL)0dSd2AV','\x4b\x30\x3a\x47','\u0050\u0059\u0023\u0037\u0044',ryFgJD(0x16),ryFgJD(0x17),ryFgJD(0x18),'\x31\x36\x60\x2c\x6c\x67\x37\x40\x75\x3e\x2a\x25\x4c',ryFgJD(0x9),'\u0068\u0036\u0022\u0046\u006c\u0023\u0048\u0054\u0067',ryFgJD(0x19),'\x2c\x30\x3d\x29\x5f\x72\x63\x48\x47\x21\x59\x43\x67\x3a\x22\x4a\x7e\x57\x61','\x68\x77\x58\x62\x7c','\x3f\x36\x2f\x69\x77','\x49\x5d\x6b\x5a\x58\x6a\x4a\x68\x67\x59\x2f\x7a\x64\x7c\x60\x5b\x56\x44\x45\x22\x34\x57\x26\x78\x36\x4a\x7c\x77\x52\x26','\x2a\x6e\
// 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