mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-13 22:24:45 +08:00
16 lines
121 KiB
JavaScript
16 lines
121 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_joinCommon.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('1.19 冬日狂欢 惊喜派送')
|
|||
|
function OajKGT(){}var XIGdo3N=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],YNgtTyn,EyToSd,xWQ0ErC,PPloxU,Q2gvhp,LBE4a8,ZHMvFd,hEfM8DQ,O0OImAr,T5mnuwt,FJe78Rt,HnOAB5z,_niBplN,a4ojBo,DSqV8iy,Opgxg1s,BNvGKGQ;function qqkK7on(OajKGT){return YNgtTyn[OajKGT>0xb?OajKGT<0xaf?OajKGT<0xaf?OajKGT-0xc:OajKGT+0x1b:OajKGT+0x16:OajKGT-0x23]}OajKGT(YNgtTyn=hjsG8Ut(),EyToSd=OKC3Xz1((OajKGT,XIGdo3N)=>{return XIGdo3N(OajKGT())},0x2)(OyJUUej,W8tbFVt));var yhV3IR=[],Dam6xk=['\u0054\u0068\u0074\u007c\u0059\u0024\u0050\u004b\u003f','\u0029\u0037\u002f\u0035\u005e\u0022\u0079\u006a\u003f',BoGkdH7(qqkK7on(0x25)),BoGkdH7(qqkK7on(0x2f)),'\x2f\x73\x25\x4d\x78\x32\x37\x30\x38\x4c\x53\x5d\x55','\x4f\x78\x22\x55','\u0023\u0041\u0075\u0033\u0045\u003e\u0049\u002b\u0037\u0043\u0031\u006b\u0050\u003a\u0074\u002a\u0045\u0061\u004f\u0055','\u0023\u0041\u0075\u0033\u0045\u003e\u0049\u002b\u0037\u0043\u0031\u006b\u0050\u003a\u0051\u0073\u0063\u0035\u0062\u0066\u0074',BoGkdH7(qqkK7on(0x30)),BoGkdH7(0x3),BoGkdH7(qqkK7on(0x36)),'\u0052\u004c\u0066\u0051\u0048\u0073\u005e\u0034\u0041\u002f\u004d\u007c\u006e\u0074\u0062\u0022\u0022\u0035\u006e','45DUZ+]&.W<(tJS]pK','\u0037\u0034\u0061\u0042\u007b\u0063\u0066\u006f\u006f\u0057',BoGkdH7(qqkK7on(0x39)),BoGkdH7(qqkK7on(0x29)),BoGkdH7(0x7),'\u004b\u0061\u002b\u0079','\u0078\u0074\u006d\u0079\u005f\u006a\u007d\u006c',BoGkdH7(qqkK7on(0x32)),BoGkdH7(0x9),'\x4f\x6c\x77\x59\x50\x65\x39\x25\x49\x3b\x3f\x7a\x3a\x50\x6a\x24\x59\x57\x4d\x25\x49\x71\x2b\x3a\x64\x7e\x5f\x67\x73\x78\x65\x58\x35\x5f\x6b\x21\x64','Yipyc',BoGkdH7(qqkK7on(0x4b)),qqkK7on(0xc),BoGkdH7(0xb),qqkK7on(0xc),'\u003f\u0035\u0040\u007e\u0031\u0024\u0074\u006c',qqkK7on(0xd),'\u006c\u0061\u0065\u005f\u0064','\x65\x61\x70\x79\x5a\x42\x5d\x33\x33\x2f','\u002f\u0066\u0079\u0039\u0028\u003b\u0047\u003f\u0053\u005e\u005a\u0022\u0064','`/>a.ikE0<GHZa_4"jWQBXe67Q#(T#{6?E>a7kPl',BoGkdH7(0xc),'\x6e\x3a\x7b\x72\x7e\x6b\x29\x6d\x76\x6c\x3c',BoGkdH7(0xd),'2WhIRG?o','\u0049\u0032\u0069\u0050\u006d\u006b\u0029','\x3f\x35\x40\x7e\x31\x24\x74\x6c','JxR!V0G','\u006d\u004a\u0037\u002c\u0063\u007d\u006d\u0025\u0076\u005b\u003c','\u003d\u0049\u0024\u0072\u004a\u0042\u0028\u0030\u0030\u0073',BoGkdH7(0xe),'\u002e\u0036\u003d\u0048\u0041\u0047\u0033\u006f','\x34\x35\x36\x5f\x60\x4f\x47','\u0070\u0035\u0038\u007e\u006d\u0069\u005a\u0052\u0045',BoGkdH7(0xf),'mt?f2Nd33/','VxB_1$>,<h?F]a','\u0045\u0021\u0063\u0042\u004c\u0059\u003e\u0070\u0058','\x7d\x79\x6f\x5f\x64\x3a\x4c\x70\x2e\x57\x62\x77\x22\x61',BoGkdH7(qqkK7on(0x21)),BoGkdH7(0x11),BoGkdH7(qqkK7on(0x2b)),'b}*_F~b696i(^j,x',BoGkdH7(qqkK7on(0x1d)),'\x75\x6e\x69\x7e\x22\x28\x47','\u002a\u005b\u003c\u0021\u002e\u002b\u007d\u006c','\x78\x74\x36\x5f\x40\x66\x4b\x51\x62','\u0053\u005b\u0036\u005f\u0064',qqkK7on(0x20),qqkK7on(0x16),'\x6f\x39\x62\x66\x4d\x46\x60\x60\x7b\x36','\u004f\u0078\u0033\u0072\u0062\u004c\u006d\u0052\u0045','\u0065\u005b\u0060\u0021\u0046\u007e\u0047',BoGkdH7(qqkK7on(0x3d)),'\u002e\u0035\u0068\u0079\u003b\u006a\u0032\u0051\u0059\u002f',BoGkdH7(0x15),BoGkdH7(0x16),qqkK7on(0xd),BoGkdH7(0x16),BoGkdH7(0x17),BoGkdH7(0x18),'\u002a\u005b\u0072\u0079','\x4c\x4f\x58\x77\x43\x52\x6b\x4e\x58\x6b\x7d\x41\x48\x60\x58\x57\x7b\x59\x4a\x48\x34\x31\x6a\x3c\x7e\x4b',BoGkdH7(0x19),qqkK7on(0xe),'\x65\x3d\x2a\x38\x74\x58\x75\x5b\x6a\x47\x36\x69\x2b\x4f\x62\x78\x4f\x3c\x7d\x7c\x7e\x58\x7b\x3e\x44\x7a\x74\x44\x45\x2f\x3e\x33\x76\x4f\x7a\x3a\x72\x49\x2f\x73\x59\x56\x66\x2e\x41',')sz?E','\x65\x61\x70\x79\x5a\x42\x5d\x33\x33\x2f','\x4f\x7e\x44\x28\x65\x56\x60\x5a\x6f\x2e\x60\x32\x69\x2a\x42',BoGkdH7(qqkK7on(0xf)),'\x2c\x5d\x46\x23\x50\x65\x4d\x25\x50\x74\x73\x3c\x6a\x30\x23\x2b\x3a\x61\x6a\x25\x22\x2e\x7a\x53\x44\x21\x23\x4c\x61\x60\x58\x57\x61\x70\x3d\x75\x21\x4c\x65\x66\x6d\x78\x21\x69\x49\x5e\x24\x7a\x2e\x71\x2e\x41','\u007d\u0079\u0067\u0021\u0054\u0024\u0061\u006b\u007c\u0068\u003a\u005f\u0046\u004a\u0057\u005a\u005e\u0065\u006c',BoGkdH7(0x1a),'\x5b\x34\x4b\x46\x3a\x79\x33\x6d\x4d','\x7d\x79\x69\x7e\x5b\x2b\x47\x52\x4a\x34\x7a',qqkK7on(0xe),'Vm28p)g]3hgZaMK(R?jh4x@uJO[mk`.5/K;0%MLS|exqe
|
|||
|
|
|||
|
// 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
|