faker3/jd_opencard_1227.js

16 lines
104 KiB
JavaScript
Raw Normal View History

2024-12-28 03:31:07 +08:00
/*
环境变量
export jd_opencard_draw="3" //抽奖次数 3
export jd_opencard_notify="true" // 是否推送
cron:59 23 29 2 *
*/
const $ = new Env('1.21 烹然心动 共赴新年味')
function rBtqig(){}var QvLzzy7=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],TkWKRc,pl1aRxx,Kod7maP,l5ta8T,lt6knT,DGfIgWB,DrvMSk,utv2y8,jxLhAL,erlX3ep,NjftRcr,rB2IEen,Ex9WwK,XSLVkIT,DSkp6h,LiI8Ngb,WEfVuA,XPdngnN,I_B2y0o;function LtOcC5(rBtqig){return TkWKRc[rBtqig>0x1f?rBtqig>0x9e?rBtqig+0x63:rBtqig-0x20:rBtqig-0xb]}rBtqig(TkWKRc=IjY3w2(),pl1aRxx=ppXcMN((rBtqig,QvLzzy7)=>{return QvLzzy7(rBtqig())},0x2)(NijO3q4,TKvXvFh));var Kdvwuq=[],Ep8rk7=['\x78\x72\x75\x61\x36\x3a\x54\x48',FLGe2ez(0x0),FLGe2ez(0x1),FLGe2ez(0x2),'\x64\x77\x47\x48\x58',FLGe2ez(LtOcC5(0x37)),'\x30\x3b\x77\x7b\x7b\x5a\x2a','J4c>i`P2ec{G)oe','\u004c\u004c\u002a\u0025\u0071\u005f\u0072\u0030\u0039\u0050\u003e\u004d\u006d\u0035\u0053\u0067\u005a\u0076',FLGe2ez(LtOcC5(0x8d)),FLGe2ez(LtOcC5(0x9a)),'}"Wp+i|fX<KI(Vz}X6aRQbu',FLGe2ez(LtOcC5(0x2f)),'}"Wp+i|fX<KI(V5s+=H9','\u004f\u0036\u0042\u0039\u0046\u0029\u0041\u0062\u006f\u0045\u0074\u0057\u0032\u0028\u0033\u0078\u002c\u004f\u0023\u005f\u0037\u005e\u0046\u0074\u0070\u0072\u0063\u0032\u0060\u0056\u0035\u0078\u0058\u0067\u0042\u0064\u006d\u0064\u0075',FLGe2ez(0x7),'\x76\x3d\x66\x21','\x67\x35\x60\x21\x5e\x2c\x2a\x30','\x71\x52\x44\x21','\x30\x3d\x3e\x5e\x61','\u0048\u0030\u0050\u0036\u0028\u003e\u005b\u0054\u007c\u0033\u0068\u0023\u0056\u0028\u002c\u0029\u0036\u0034\u0024\u0054\u007c\u003f\u0066\u0056\u0061\u005f\u005e\u0055\u0051\u0067\u003e\u0059\u004c\u005e\u0049\u0025\u0061',FLGe2ez(LtOcC5(0x36)),'\x73\x79\x44\x21','\x30\x3d\x3e\x5e\x61','CLB9;fxlJ4Rz52ox]v','\u004f\u0036\u0042\u0039\u0021\u0078\u0059\u0062\u0067\u003c\u0055\u005b\u0047\u002c\u003a\u0046\u0035\u0050\u0060\u006f\u0055\u0067\u0030\u002a\u005e\u0042\u002c\u0034\u005b\u006f\u004a\u0054\u004f\u006e\u0072\u005f\u0058\u005e\u0074\u0074\u0052\u0074\u0031','\u0066\u006f\u0040\u004f\u004e\u0070\u0044\u0075\u004e\u003d\u0069','\x75\x63\x54\x71\x5d\x77\x64\x43\x56\x43\x7b\x24\x32','\u0068\u004c\u0072\u005f\u004b\u0029\u0035\u0030',FLGe2ez(0x9),'\u0061\u0063\u0037\u005f\u0077\u0076\u003b\u0032','\u0070\u0042\u0053\u0033\u0072\u0056\u0025\u0078','\x73\x79\x54\x3c\x7b\x5a\x5b\x32\x74\x7b\x6f\x26\x60','\u0051\u0033\u0026\u005d\u0052\u0038\u0077\u0024\u004e\u003b','\u0041\u0067\u002c\u0064\u006e\u005f\u007b\u0076\u0064\u0046\u0039\u0068\u0037\u007e\u007e\u005d\u0063\u0037\u005a\u0032\u006f\u0073\u0064\u002b\u0036\u0050\u0052\u002e\u004a\u0060\u007b\u0061\u0040\u0075','\x2a\x21\x7b\x5e\x61\x56\x63\x5d\x4a\x34\x6a\x49\x4e\x3d','\x49\x68\x2e\x45\x25\x2c\x75\x5a\x32\x43\x23','8nB9^Kst[tR.v',FLGe2ez(LtOcC5(0x3e)),'\u007b\u0037\u0054\u0071\u0031\u006f\u0060',FLGe2ez(LtOcC5(0x31)),'\u0032\u0067\u005a\u0025\u0041\u0040\u0075','\u0031\u003e\u0036\u007c\u006b\u0077\u0031\u002f\u0059\u0050\u0073','\u0064\u007b\u0029\u007a\u003e\u0069\u0052\u005f\u005f\u003b','%>6|kw1/YPy,7Y7jq2','H6sD/c}0','\x43\x4c\x74\x5e\x53\x48\x75',LtOcC5(0x20),'.VX,|G=x','\u0066\u0037\u0042\u004a\u0075\u0069\u0052\u005f\u005f\u003b','\u0034\u0040\u0072\u005d\u0077\u0047\u002b\u0065\u007b\u002f\u0042\u0022\u006a\u003c',FLGe2ez(LtOcC5(0x30)),FLGe2ez(0xd),'\u0028\u003c\u002f\u0033\u002c\u0077\u0076\u0078',FLGe2ez(0xe),FLGe2ez(0xf),FLGe2ez(LtOcC5(0x54)),'W~M_Ozu',FLGe2ez(0x11),FLGe2ez(LtOcC5(0x3f)),')FRM^','\u0048\u0067\u0070\u0044\u0077\u0063\u0060\u005a\u002b','\x31\x52\x3b\x45\x67\x66\x5f\x77\x66\x43',FLGe2ez(0x13),'\x3e\x79\x53\x25\x3a\x5f\x60\x30',FLGe2ez(LtOcC5(0x2b)),'\x33\x29\x56\x7d\x73\x51\x5a\x25\x4d\x4b\x7c\x37\x45\x43\x65\x66\x43\x77\x49\x54\x4c\x51\x2c\x6a\x7b\x5d\x73\x7b\x6b\x74\x6a\x6c\x59\x43\x5d\x38\x36\x7a\x74\x3d\x57\x62\x4e\x46\x30',LtOcC5(0x20),'\u0067\u0035\u0045\u0039',FLGe2ez(0x15),FLGe2ez(0x16),'\x2b\x3d\x65\x21\x25\x4b\x3b\x30',LtOcC5(0x22),'\u002a\u0021\u007b\u005e\u0061\u0056\u0072\u0030','\u005a\u006e\u0074\u005e\u0023\u005f\u0043\u0030',FLGe2ez(LtOcC5(0x41)),'\x73\x79\x44\x21','\x2a\x21\x7b\x5e\x61\x56\x34\x5d\x6c\x43\x60\x3c\x78\x3d','\x60\x36\x2e\x45\x29\x29\x58\x2e\x55\x65\x23',FLGe2ez(0x18),LtOcC5(0x21),FLGe2ez(0x19),'\u0059\u0079\u0061\u0052\u0066\u0029\u002c\u0038\u007e',FLGe2ez(LtOcC5(0x44)),'\u004a\u0079\u002f\u0025\u0059\u004d\u0054\u0030'
// 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