mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
15 lines
99 KiB
JavaScript
15 lines
99 KiB
JavaScript
|
/*
|
|||
|
活动名称:种豆得豆任务
|
|||
|
活动入口:APP-我的-种豆得豆
|
|||
|
环境变量:
|
|||
|
jd_plantBean_notify //是否推送通知,默认false
|
|||
|
|
|||
|
cron:1 7-21/2 * * *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('种豆得豆任务')
|
|||
|
function IxVnA_1(){}var fbK0bCt=Object['defineProperty'],BhVzJc,jWMjXpC,Yuf7mqz,vWvWqX,SvNn0lk,i1NAI1,knYW0Et,AzeEa9,SZtd4U1,AcEJe7,xT6Y0EG,pVYQDO,VCj5Gk2,QzS6d0,SGoVjZt,T1xg2r,HtCu68M;function MLO3h_0(IxVnA_1){return BhVzJc[IxVnA_1>0x4b?IxVnA_1>0x4b?IxVnA_1-0x4c:IxVnA_1-0x5:IxVnA_1+0x49]}BhVzJc=lTL85H();function XHwrgT(IxVnA_1,fbK0bCt){return jWMjXpC.call(MLO3h_0(0x86),IxVnA_1,'\x6c\x65\x6e\x67\x74\x68',{value:fbK0bCt,configurable:!0x0})}IxVnA_1(jWMjXpC=Object.defineProperty,Yuf7mqz=XHwrgT(XtnVf2d((...fbK0bCt)=>{var jWMjXpC=XtnVf2d(fbK0bCt=>{return BhVzJc[fbK0bCt>0xff?fbK0bCt-0x62:fbK0bCt<0x6?fbK0bCt+0x8:fbK0bCt<0x6?fbK0bCt+0x61:fbK0bCt-0x7]},0x1);IxVnA_1(fbK0bCt.length=0x2,fbK0bCt[MLO3h_0(0x4c)]=fbK0bCt[jWMjXpC(0x1c)]);return fbK0bCt[0x1](fbK0bCt[MLO3h_0(0x4c)]())}),0x2)(__RcAz,l7IWUfW));var pHIAmaD=[],paJzUnL=[QG2qBR(0x0),QG2qBR(MLO3h_0(0x60)),QG2qBR(0x2),QG2qBR(0x3),QG2qBR(MLO3h_0(0x63)),QG2qBR(0x5),QG2qBR(MLO3h_0(0x67)),QG2qBR(0x7),QG2qBR(MLO3h_0(0x79)),QG2qBR(MLO3h_0(0x6d)),QG2qBR(0xa),'|7?~',QG2qBR(MLO3h_0(0x81)),QG2qBR(0xc),QG2qBR(MLO3h_0(0x76)),QG2qBR(0xe),QG2qBR(MLO3h_0(0x68)),QG2qBR(MLO3h_0(0x4d)),QG2qBR(0xd),'_XZaD?U`WeB<Gz1UR|',QG2qBR(0x11),QG2qBR(MLO3h_0(0x6b)),QG2qBR(0x13),QG2qBR(MLO3h_0(0x5d)),QG2qBR(MLO3h_0(0x88)),QG2qBR(0x16),QG2qBR(0x17),'_XO*Jk^QzC=fGzGUa|',QG2qBR(MLO3h_0(0x90)),QG2qBR(0x19),QG2qBR(MLO3h_0(0x95)),QG2qBR(0x1b),'\u0065\u0076\u005d\u007c\u0069\u0057\u003a\u0044',QG2qBR(0x1c),QG2qBR(0x1d),QG2qBR(0x1e),'\x5d\x24\x72\x7c\x35\x3e\x6d',QG2qBR(MLO3h_0(0x91)),QG2qBR(0x20),QG2qBR(0x21),QG2qBR(0x22),QG2qBR(MLO3h_0(0x96)),QG2qBR(MLO3h_0(0x83)),QG2qBR(MLO3h_0(0x8d)),QG2qBR(MLO3h_0(0x6c)),'\u0072\u0047\u002b\u006a\u0026\u0068\u007c\u005b\u005d',QG2qBR(0x27),'h/4R9@aV|MgZ#Fb57]',QG2qBR(0x28),QG2qBR(MLO3h_0(0xa0)),QG2qBR(0x2a),QG2qBR(MLO3h_0(0xa1)),QG2qBR(MLO3h_0(0xa2)),QG2qBR(MLO3h_0(0xa3)),QG2qBR(0x1d),QG2qBR(0x2e),QG2qBR(MLO3h_0(0xa6)),QG2qBR(0x30),QG2qBR(0x31),QG2qBR(MLO3h_0(0xc5)),QG2qBR(MLO3h_0(0xa5)),QG2qBR(0x34),QG2qBR(0x35),QG2qBR(MLO3h_0(0xb2)),QG2qBR(MLO3h_0(0x70)),QG2qBR(0x38),QG2qBR(0x39),QG2qBR(0x3a),QG2qBR(MLO3h_0(0xa7)),QG2qBR(MLO3h_0(0xa8)),QG2qBR(0x3d),QG2qBR(0x29),QG2qBR(MLO3h_0(0x4e)),QG2qBR(MLO3h_0(0x6a)),QG2qBR(0x40),QG2qBR(MLO3h_0(0xa9)),'4oL[24U|',QG2qBR(0x42),QG2qBR(0x43),QG2qBR(0x44),QG2qBR(MLO3h_0(0xae)),QG2qBR(0x46),'lV1j5l!N,Y<<|',QG2qBR(0x47),QG2qBR(MLO3h_0(0xad)),QG2qBR(MLO3h_0(0x73)),QG2qBR(0x4a),QG2qBR(MLO3h_0(0xaf)),QG2qBR(0x10),QG2qBR(0x4c),QG2qBR(0x4d),QG2qBR(MLO3h_0(0xb0)),QG2qBR(MLO3h_0(0xb1)),QG2qBR(0x50),QG2qBR(0x51),QG2qBR(0x52),QG2qBR(MLO3h_0(0xb6)),QG2qBR(0x10),QG2qBR(0x54),QG2qBR(0x55),QG2qBR(MLO3h_0(0xb5)),'4A;~@H|+F_n2]Tp',QG2qBR(0x57),QG2qBR(MLO3h_0(0x75)),QG2qBR(MLO3h_0(0xb9)),QG2qBR(0x5a),QG2qBR(MLO3h_0(0x74)),QG2qBR(0x5c),QG2qBR(MLO3h_0(0xc3)),QG2qBR(MLO3h_0(0xc4)),QG2qBR(MLO3h_0(0xbd)),'6c?|2p{h!oSCjUixBa8e,>`Wb',MLO3h_0(0x4f),QG2qBR(0x60),QG2qBR(0x61),QG2qBR(0x62),'\u0078\u0067\u0021\u0039\u0066\u003e\u002c\u007c\u004a\u0022\u0052\u0077\u0067\u007e\u0048\u0038\u0077\u0067\u0022\u0065\u003c\u0070\u0075',QG2qBR(0x63),QG2qBR(0x64),QG2qBR(MLO3h_0(0x8c)),QG2qBR(0x66),'6c?|2p[^',QG2qBR(0x67),QG2qBR(0x68),QG2qBR(0x69),QG2qBR(0x6a),QG2qBR(MLO3h_0(0xc2)),QG2qBR(0x6c),QG2qBR(0x6d),QG2qBR(0x6e),QG2qBR(MLO3h_0(0xc6)),QG2qBR(0x70),QG2qBR(MLO3h_0(0xc7)),QG2qBR(MLO3h_0(0xc8)),QG2qBR(0x73),QG2qBR(0x74),QG2qBR(0x10),QG2qBR(0x75),QG2qBR(0x76),QG2qBR(0x77),'w"L[?F[btYRKkzH@b|',QG2qBR(0x78),QG2qBR(MLO3h_0(0x4d)),QG2qBR(0x79),QG2qBR(MLO3h_0(0x58)),QG2qBR(MLO3h_0(0x52)),QG2qBR(0x7c),MLO3h_0(0x5b),QG2qBR(MLO3h_0(0x13d)),QG2qBR(0x7e),QG2qBR(MLO3h_0(0x66)),QG2qBR(MLO3h_0(0x65)),'G:^d?F=|',QG2qBR(0x81),QG2qBR(0x4b),QG2qBR(MLO3h_0(0xcd)),QG2qBR(0x10),'Xx.~d}2^%($Ej1g@R|',QG2qBR(MLO3h_0(0x4e)),QG2qBR(MLO3h_0(0x4d)),QG2qBR(0x83),'Xx.~d}2^%($Ej1g@R|',QG2qBR(MLO3h_0(0x4e)),QG2qBR(MLO3h_0(0x51)),QG2qBR(MLO3h_0(0x4d)),QG2qBR(MLO3h_0(0x55)),QG2qBR(0x7a),QG2qBR(0x7b),QG2qBR(0x7c),MLO3h_0(0x4f),QG2qBR(MLO3h_0(0x5c)),'|:6a+',QG2qBR(MLO3h_0(0xcf)),QG2qBR(0x10),QG2qBR(MLO3h_0(0x50)),QG2qBR(0x87),QG2qBR(0x88),QG2qBR(MLO3h_0(0xd9)),QG2qBR(MLO3h_0(0x4d)),QG2qBR(MLO3h_0(0x50)),QG2qBR(MLO3h_0
|
|||
|
// 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
|