mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-25 15:49:11 +08:00
15 lines
61 KiB
JavaScript
15 lines
61 KiB
JavaScript
|
/*
|
|||
|
环境变量:
|
|||
|
export jd_opencard_draw="3" //抽奖次数 3
|
|||
|
export jd_opencard_notify="true" // 是否推送
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('12.12 自护在线 好价嗨购')
|
|||
|
function DP5zmeQ(){}var DAc18h=Object['defineProperty'],oMpWkK5,dqPSq9,M7yuqZ,AOpVtO,lqkPXw1,QeX76_,HgD7XxL,B9LoVV,bzKmKy1,EQyEsD,OPshk3,Lw3ZAkb,Su2z2i,diPIQm,hJ1D5Cf,EUmHAI,XhWO7Qt,KPARnCN,sO1mR2Y;function dUIfeq(DP5zmeQ){return oMpWkK5[DP5zmeQ<-0x35?DP5zmeQ+0x34:DP5zmeQ<-0x35?DP5zmeQ+0x44:DP5zmeQ<-0x35?DP5zmeQ+0x4d:DP5zmeQ<-0x35?DP5zmeQ+0x2:DP5zmeQ+0x34]}oMpWkK5=ecHD0K();var MybLj2k=[],Tw37T6o=['NO<Y|n}u','kfWhI;3y5','4nk$W&|a','}D]GhSpu','*36EEK!','pH2">9T512E^u.1','WWAm&^25*oUR`{Z=>8','r=O*','QqHE?f0k[1Nz;.(Q[v%uns/','.gEb%','QqHE?f0k[1Nz;.{@?$r*','Ov"*YdwsSV)Hy;#T+O4^hbY)E2pyD.{T[="G`G/','MWYN#','8$kl','={Dlb+A5','&u_l','5$Ub%','r5ov;Ug~0#K4.;+dvjL~0,k.%^bMn=U:Wbzm%','vRxl|','@e_l','5$Ub%','XW"*CkT<!ju({ySTx8','Ov"*lT:s=1Mgc+JY{oDSM=5Ab"+jgS!~OIouwpaZO)','D+=(vzeFv2P',dUIfeq(-0x34),'KW2^Nd{5',dUIfeq(-0x28),'zK}l&gX5','wC(KjFGAqjW1J','Alib%.N9vY','w=+GI^i8GY;O1%?mph>yd!sfGh+^XQ$Q^/','`"13iY4.0l6R+K','Rd{EBWJ_|uw',dUIfeq(-0x34),')kqjP4.a','u{"*>+/','dN/nmU)a','|M_Bv5J','_Nen!m_t|Hw','$j5EN[i<<D','uNen!m_t|HCB)|)ycA','CQ$Of4#a','uN*3zCJ','n!a@{9s#A','|7B%@foY','x)dr8[i<<D','vM&3mU@;jtdoyK',dUIfeq(-0x30),'U$xl|','TKt"Bm>a','XWibM+O)F1P98','X`$3onX*}*e:=W;M','9Z8c)','H7R^O(/','@eum!kA5','={)b2G8V6','Se)b%','r=E_6pD>?','PuCV=k^6kX','UeZmJ^/','UeZmJ^D5',dUIfeq(-0x33),'z7L`pN5Z0[T&G@nm@AUuoN%V]Op]lFVkW@OX$!FP<hyq>',dUIfeq(-0x32),'#CG4','686lPwELB)2vmR_$9Ox`t_,','6PO^l','?$tlmNC5','iuaVBVETDXP','Alib%.25','5sF2I)@>','y=>mwa/',dUIfeq(-0x33),'Alib%.jx<XD1T$','Dv9Vdd[9Mt4','4?MGp"9iiq','p8*^','W8BSm7{>','W8BSm7%Xf','!e%uJgX5','b8}ZW0u>','oo]24;jFA','Se)b%','Lf3bW0/>','={)bWd,dvou','voQ4','*Ps)C','b8"*','"AaVaB@Fw1O1@QZ=','C{tlC<@Fw1lox.F','wSZz")AF^qOY+','KW2^Nd{5','"AaV6I5z?','!Wtl#+FVvY','@o]2xmN>4qPktQM#0Yf','ZoX4l','4PJSa','b8BSQ/R:UnuDzd"pj+','"5&eXPUZE)=/,lWmFiRuBqAI`Ulo+A','SdunQTcV/{?VS_tk!$Y2.nhSq|AhGTEd}"z~(Si*jxL','<{tl',dUIfeq(-0x2e),'p8H42%XGA',dUIfeq(-0x31),'UjDGZ%,','{%#!$U8X$1w','D+=(vz25','D+F*ARJ>?','UjDGZ%,5J@I','p8*^','>U,W)j62dBoSGti7Ogn~[oIdHZ`;P:WgPO_<Z;6K{#Z0Tr7Ib|ba',dUIfeq(-0x33),dUIfeq(-0x32),'{e>m%','gr"$',dUIfeq(-0x2a),'UeZmJ^D5','.7ibx','xWI^DRC>?','@e_l',dUIfeq(-0x33),'iuaVBVETDXP','Alib%.25',dUIfeq(-0x2f),'Alib%.jx<XD1T$','Alib%.3@ZF','Dv9Vdd[9Mt4','r=E_6pD>?','*LaV@&TEEY','!e%uJgX5','iuaV}Ii8','UV:dY>2<O',':e%ukdD5',':e%ukdO)7','zyur_pr[iR^&[Q}','KW2^Nd{5','#V^A','xBGAe!onL',dUIfeq(-0x31),dUIfeq(-0x32),'ig6G^DBFu)v','@e_l','SdrOE~`>DpB','5z`n%b[mVSa','~eUb%',dUIfeq(-0x2d),dUIfeq(-0x30),'={V*','}J/:I6Gm>bGP8~6dscUU',dUIfeq(-0x33),'Dvgb&^H98LI',dUIfeq(-0x2b),'*$Dl','zo9VJzm6Mt4',dUIfeq(-0x2f),'#IF*{','#IF*{',dUIfeq(-0x33),'MWw*','!e%uS','xWI^DRC>?',dUIfeq(-0x33),dUIfeq(-0x33),dUIfeq(-0x2c),'!e&_',dUIfeq(-0x2f),'zo9VJz[9+t4','fg%u!+/','#IF*{','zo9VJzm6Mt4','xWI^DRC>?','y=&bTk45','Pl!s70Fz:U[)&','fZq+2',':CPH"OG','Sxha_02((|','Alib%.px!j}zB$',dUIfeq(-0x2e),'#IF*{',dUIfeq(-0x32),dUIfeq(-0x2e),'#IF*{','~eUb%',dUIfeq(-0x2d),'PuCV=k^6kX','hM^?F[EE_A','>I)b4^X5','@e_l',dUIfeq(-0x2c),'@e"*b+FV6','.7ibx',')WDl1J;_eon}8','@e_l',dUIfeq(-0x32),'@e_l','@e_l','Dvgb&^H98LI','zK9Vm+/','xWI^DRC>?','D+F*ARJ>?','sa}(','xWI^DRC>?',dUIfeq(-0x30),'6e|6"','zK}l&gX5','eeZmJ^/','UeZmJ^/','~e>PsB25',dUIfeq(-0x2c),'iuaVBVETDXP','Alib%.N9vY','zK9Vm+*x?','zK9Vm+/>yX4',dUIfeq(-0x2b),'!eIVKN&E?','_$I^{','!e&_2+;_DXu','WWib*pK)6',':ekl','{eouUpx5','!e%uJgX5','!e&_','@e"*b+FVCvsz($','@e"*b+FV6','`:0*O','9![&(id','rihqu9;0','1![&pQ,~T6Yqw','ARq^"','rig}ZbKyA','FeXL','|*rL','xW"*bNX5','xB*X/iFx=','nLa(3M)0','=ZRLgWq=eN6H?Sy+PelLua6yBmbH>$!v$ho`uj<u0','nLa(3M{fnzT$o$D+o;`','%pxlKm)KEYT1{yw@A0p{]',']lMm$fLECJ"o(IxnXW7','^KA+v^/','>PN1yi6~){/Nw','aBSX^(#%rs{[w','>PlL:i|~@=KRs4z','=ZRLgWq=eN6H?Sy+Pe;Ei%S=IN4[v45jqc7`n','Qq/yrR7%06Rj3IpQ','Ie,(KEr0','@Pg}j','+WX2?o*f=NaNv8#G.L3E&o5Rh6o{w','s~#^qp25','c]AmTkeF6','Z*iTIW80',dUIfeq(-0x29),'S`k:~','u{UbmN6%6','^]O6','U$xl|','|Webb+7%6',dUIfeq(-0x2a),'Rg9^ek/','<Ca.gTQGA',dUIfeq(-0x32),'={V*','|Webb+7%6','agDl','xW"*bNX5','^]O6',')Wg_#+@)6',dUIfeq(-0x29),'$ex!MG/_mV0t*5*]WA1GI^*tw4fMR7cC@K(u>+lsJ]lB8dtYruE5Fp[>t4GA!$ESs0UW#Ujrkl>+$>#16Jk.$)P&g{[b)|I,LWYDYSunE5Fp[>t4:9UQ;:e0$I2=V{(ub!`YU_ctM
|
|||
|
|
|||
|
// 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
|