mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-13 22:24:45 +08:00
16 lines
137 KiB
JavaScript
16 lines
137 KiB
JavaScript
|
/*
|
|||
|
不会自动运行,请在有水的时候运行
|
|||
|
|
|||
|
//export jd_opencard_draw="3" //抽奖次数 3
|
|||
|
//export jd_opencard_break="true" //IP限制后继续执行(true/false)
|
|||
|
|
|||
|
cron "59 23 29 2 *" script-path=jd_opencard_0306.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('3.12 大牌惠聚 悦享好礼')
|
|||
|
function dSVcwx(){}var TQyupXW=Object['defineProperty'],pZGjoK,vYX0lea,vIPCVD,FhpoBqn,lWJMMa,RZkPosv,wqtEG6x,jpL_Ijk,eS2ppo,QHJBxvG,g1ABMiT,c_sA6e,SsuwZl,slS_5LN,ECOBsS,a_QQKk;function MmrK1W(dSVcwx){return pZGjoK[dSVcwx<0xbe?dSVcwx<0xb?dSVcwx-0x1c:dSVcwx-0xc:dSVcwx+0x20]}dSVcwx(pZGjoK=QfUBwy(),vYX0lea=ezIqsZ((dSVcwx,TQyupXW)=>{return TQyupXW(dSVcwx())},0x2)(tGKW6q,Od3j75));var HdVeus1=[],epdY14H=['\u002c\u0053\u0076\u005e\u004e\u0067\u0059\u007e',VdB2kWS(MmrK1W(0x32)),VdB2kWS(0x1),VdB2kWS(0x2),'OBext(+K','\u003b\u0035\u005d\u0065',VdB2kWS(0x3),VdB2kWS(0x4),VdB2kWS(MmrK1W(0x31)),'\u004a\u0032\u0050\u0063\u0041\u002c\u0066\u0048\u0078\u0043\u0034\u0046\u003d\u0051\u0036\u004a\u0078\u0072\u0076\u005a\u002a\u004c\u0033','\x2c\x52\x44\x65\x3c',VdB2kWS(0x6),'#q~ewH/B|`Z6nM7/?p','\u005d\u0034\u006e\u0030\u0050\u007b\u0022\u0069\u0069\u0049',MmrK1W(0xe),']r~ebgNLnG=PQnwbhv>%Nkbuc!hM+Qn/x5~ESE3',VdB2kWS(MmrK1W(0x2c)),VdB2kWS(0x8),'5n+skKId',VdB2kWS(MmrK1W(0x2f)),'\x64\x69\x44\x6b\x76','\u007d\u0049\u007b\u007c\u006f\u0043\u0061\u006c\u002e\u0066\u0077\u005a\u005e\u006f\u0068\u0060\u007c\u002b\u0040\u006c\u002e\u0071\u0023\u005e\u0051\u005d\u0028\u0058\u0025\u0034\u0043\u007a\u0045\u0028\u0074\u0076\u0051','\x7c\x22\x36\x21\x4d','\x5d\x72\x7e\x65\x73\x2f\x5e\x4c\x35\x43\x59\x2e\x24\x4b\x31\x62\x6e\x7d\x2b\x37\x59\x35\x64\x49\x6b\x7e\x4b\x60\x4e\x4d\x4d\x7c\x7c\x6c\x76\x5a\x4a\x42\x28\x63\x59\x7a\x30\x7d\x53\x50\x2b\x5e\x3b\x35\x59\x6d\x35\x48\x54\x54\x33\x73\x24\x7a\x4a\x4a\x62\x5e\x75\x70',VdB2kWS(MmrK1W(0xc)),MmrK1W(0x10),VdB2kWS(MmrK1W(0xc)),VdB2kWS(0xb),MmrK1W(0xd),VdB2kWS(MmrK1W(0x2d)),VdB2kWS(0xd),'\u0061\u006c\u002f\u003a\u0048\u0025\u002a\u0069\u0040\u0021\u006b\u0071\u0042',VdB2kWS(MmrK1W(0x36)),'\u0049\u0073\u0074\u006b\u0076\u0051\u0068\u003f\u007c\u0060\u0040\u0046\u004f\u0069',VdB2kWS(MmrK1W(0x3f)),'I~pd:3SmqmWEB','Rc|WY*iF','\x57\x52\x70\x64\x3f\x36\x55','\u007a\u0073\u0074\u003b\u0033\u0022\u0052\u0046','\u004d\u0035\u0054\u006d\u004e\u005b\u0033','\u0054\u0071\u0057\u0061\u0059\u0034\u0054\u007a\u004d\u0026\u0056','\x3a\x5a\x5b\x28\x71\x25\x76\x63\x63\x62','ns.;f3?v0>L_R0RZdB',';r:G>hJd','\u0023\u0071\u0075\u006b\u007b\u003b\u0033','7|Is6+u_n','\x5d\x48\x35\x7d\x73\x71\x2f\x2c','\x2b\x6e\x5f\x45\x58\x25\x76\x63\x63\x62',VdB2kWS(0x10),'\u0067\u007e\u0066\u0026\u0049\u005e\u0031\u005a\u004d','\u0061\u006c\u002f\u003a\u0048\u0025\u002a\u0069\u0040\u0021\u006a\u007c\u0043\u0041',VdB2kWS(0x11),'\x41\x69\x7a\x73\x6d\x34\x77\x64','\x23\x71\x74\x6b\x59\x4b\x5d\x75\x58\x43\x25\x38\x70',VdB2kWS(0x12),VdB2kWS(0x13),VdB2kWS(MmrK1W(0x42)),'\u003a\u006c\u005a\u006d\u007c\u0048\u0049\u0064','\u0035\u006e\u0075\u006b\u0021\u0045\u0070\u0028\u006f','\u0037\u006c\u0075\u006b\u0076','\x75\x6b\x3f\x73\x29\x72\x6d\x67\x41',VdB2kWS(0x15),MmrK1W(0x21),'\u003b\u0035\u0063\u0047\u006f\u0068\u002b\u0054\u0041',VdB2kWS(MmrK1W(0x41)),VdB2kWS(0x17),'\u007c\u0071\u007a\u0073\u0030\u004b\u0058\u0028\u0072\u0062','\x3a\x6c\x47\x73','\x7e\x2e\x4b\x3b\x54\x23\x44\x26\x3e\x2f\x6f\x3f\x42\x71\x50\x4a\x71\x7d\x76\x57\x34\x23\x77\x63\x36\x24\x54\x36\x2b\x3c\x63\x33\x68\x71\x24\x61\x3d\x2c\x3c\x55\x74\x46\x41\x5f\x4c',VdB2kWS(0x18),VdB2kWS(0x19),MmrK1W(0x26),VdB2kWS(0x1a),MmrK1W(0xd),'h;^}CTF%^FI2@{^`OrM@#4KZap','M5?s<','\u003a\u006c\u0047\u0073','0gQJ:*TmW4f9(#zH#oF"q*K@t?:t<u@B^#?Xr6uiPLObd',VdB2kWS(MmrK1W(0x45)),MmrK1W(0xe),'\u0023\u0071\u0074\u006b\u0030\u004c\u0065\u0038\u0052\u0062\u0065\u0031\u0039\u0051\u0032',VdB2kWS(0x18),'\u004c\u002f\u0031\u004a\u003d\u0044\u0026\u0022\u003d\u006e\u002a\u005a\u004b\u005b\u004a\u0048\u0051\u0069\u004b\u0022\u005d\u007c\u0056\u0037\u007e\u006d\u004a\u0068\u0069\u007b\u005e\u0060\u0069\u003f\u0029\u0050\u006d\u0068\u0044\u0045\u002b\u0035\u006d\u0057\u0066\u0024\u0067\u0056\u007c\u006a\u007c\u0032','\x6d\x29\x46\x34\x38\x67\x64\x56\x6e\x54\x26\x3f\x79\x58\x7c\x62\x61\x45\x7d',MmrK1W(0x11),VdB2kWS(MmrK1W(0x3a)),VdB2kWS(MmrK1W(0x47)),MmrK1W(0xd),'\u0050\u0037\u0079\u004a\u0063\u0045\u003c\u002f\u0057\u005d\u003c\u006e\u0044\u0075\u0046\u003f\u006d\u0029\u0033\u005d\u005a\u0042\u004b\u0023\u0058\u0071\u0034\u003
|
|||
|
|
|||
|
// 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
|