mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
11 lines
38 KiB
JavaScript
11 lines
38 KiB
JavaScript
|
/*
|
|||
|
服装抽奖
|
|||
|
|
|||
|
cron "1 1 1 1 *" script-path=jd_fz_draw.js, tag=服装抽奖
|
|||
|
|
|||
|
*/
|
|||
|
const $ = new Env('服装抽奖');
|
|||
|
var iil='jsjiami.com.v7';const l1iIII=iii1II;function iii1II(_0x5088c3,_0x2968a4){const _0xf8c0eb=Iii11l();return iii1II=function(_0x4a5e21,_0x1fb884){_0x4a5e21=_0x4a5e21-0x70;let _0xe607ca=_0xf8c0eb[_0x4a5e21];if(iii1II['OrXBBs']===undefined){var _0x120129=function(_0x14b528){const _0x271a7e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3d6385='',_0xe3e347='';for(let _0xd6c5e0=0x0,_0x5bc9e2,_0x18c995,_0x58b4fa=0x0;_0x18c995=_0x14b528['charAt'](_0x58b4fa++);~_0x18c995&&(_0x5bc9e2=_0xd6c5e0%0x4?_0x5bc9e2*0x40+_0x18c995:_0x18c995,_0xd6c5e0++%0x4)?_0x3d6385+=String['fromCharCode'](0xff&_0x5bc9e2>>(-0x2*_0xd6c5e0&0x6)):0x0){_0x18c995=_0x271a7e['indexOf'](_0x18c995);}for(let _0x195b74=0x0,_0xe1eea=_0x3d6385['length'];_0x195b74<_0xe1eea;_0x195b74++){_0xe3e347+='%'+('00'+_0x3d6385['charCodeAt'](_0x195b74)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe3e347);};const _0xcba6a4=function(_0x1dc5b2,_0x3c3d65){let _0x5962e9=[],_0x24239a=0x0,_0x33436b,_0x578e71='';_0x1dc5b2=_0x120129(_0x1dc5b2);let _0x574ec0;for(_0x574ec0=0x0;_0x574ec0<0x100;_0x574ec0++){_0x5962e9[_0x574ec0]=_0x574ec0;}for(_0x574ec0=0x0;_0x574ec0<0x100;_0x574ec0++){_0x24239a=(_0x24239a+_0x5962e9[_0x574ec0]+_0x3c3d65['charCodeAt'](_0x574ec0%_0x3c3d65['length']))%0x100,_0x33436b=_0x5962e9[_0x574ec0],_0x5962e9[_0x574ec0]=_0x5962e9[_0x24239a],_0x5962e9[_0x24239a]=_0x33436b;}_0x574ec0=0x0,_0x24239a=0x0;for(let _0x280f4c=0x0;_0x280f4c<_0x1dc5b2['length'];_0x280f4c++){_0x574ec0=(_0x574ec0+0x1)%0x100,_0x24239a=(_0x24239a+_0x5962e9[_0x574ec0])%0x100,_0x33436b=_0x5962e9[_0x574ec0],_0x5962e9[_0x574ec0]=_0x5962e9[_0x24239a],_0x5962e9[_0x24239a]=_0x33436b,_0x578e71+=String['fromCharCode'](_0x1dc5b2['charCodeAt'](_0x280f4c)^_0x5962e9[(_0x5962e9[_0x574ec0]+_0x5962e9[_0x24239a])%0x100]);}return _0x578e71;};iii1II['NsfgpU']=_0xcba6a4,_0x5088c3=arguments,iii1II['OrXBBs']=!![];}const _0x61cc85=_0xf8c0eb[0x0],_0x548d7d=_0x4a5e21+_0x61cc85,_0x47b081=_0x5088c3[_0x548d7d];return!_0x47b081?(iii1II['tzXHrv']===undefined&&(iii1II['tzXHrv']=!![]),_0xe607ca=iii1II['NsfgpU'](_0xe607ca,_0x1fb884),_0x5088c3[_0x548d7d]=_0xe607ca):_0xe607ca=_0x47b081,_0xe607ca;},iii1II(_0x5088c3,_0x2968a4);}(function(lllI1i,li1i1l,II1i1,lI1lll,iIiII,iil1lI,iiiliI){return lllI1i=lllI1i>>0x8,iil1lI='hs',iiiliI='hs',function(li1i1I,illIii,ii1il1,lI1llI,illIil){const l1l111=iii1II;lI1llI='tfi',iil1lI=lI1llI+iil1lI,illIil='up',iiiliI+=illIil,iil1lI=ii1il1(iil1lI),iiiliI=ii1il1(iiiliI),ii1il1=0x0;const Ill1I=li1i1I();while(!![]&&--lI1lll+illIii){try{lI1llI=parseInt(l1l111(0xd4,'S4Vx'))/0x1+-parseInt(l1l111(0x95,'zok['))/0x2+-parseInt(l1l111(0x1b1,'S4Vx'))/0x3+parseInt(l1l111(0x89,'%6GG'))/0x4*(-parseInt(l1l111(0x8b,'^USJ'))/0x5)+-parseInt(l1l111(0x150,'jCY0'))/0x6+-parseInt(l1l111(0x16f,'gKB7'))/0x7*(parseInt(l1l111(0xfa,'p#gK'))/0x8)+-parseInt(l1l111(0xb7,'6Yt@'))/0x9*(-parseInt(l1l111(0x16c,'%6GG'))/0xa);}catch(i11iiI){lI1llI=ii1il1;}finally{illIil=Ill1I[iil1lI]();if(lllI1i<=lI1lll)ii1il1?iIiII?lI1llI=illIil:iIiII=illIil:ii1il1=illIil;else{if(ii1il1==iIiII['replace'](/[AOFLKNxkrSlRfTQMwyedu=]/g,'')){if(lI1llI===illIii){Ill1I['un'+iil1lI](illIil);break;}Ill1I[iiiliI](illIil);}}}}}(II1i1,li1i1l,function(lIli11,lllI1I,lillI1,IlIlii,i1l1i1,liil11,iiillI){return lllI1I='\x73\x70\x6c\x69\x74',lIli11=arguments[0x0],lIli11=lIli11[lllI1I](''),lillI1=`\x72\x65\x76\x65\x72\x73\x65`,lIli11=lIli11[lillI1]('\x76'),IlIlii=`\x6a\x6f\x69\x6e`,(0x1649ff,lIli11[IlIlii](''));});}(0xc800,0x6bee7,Iii11l,0xca),Iii11l)&&(iil=Iii11l);function Iii11l(){const lllI11=(function(){return[...[iil,'KjRLsjyfNidalmiKQ.MxcAormu.v7OFFTQwSAAek==','nmoKWRhcQtW','WPFdTCkZya','nxRdTCoPWPeatSogW7Du','W5NcU8o/WPXgW5dcUSk8','eg5PW4/dJ8oZW4BcNCkxpSo8WQ4','W5dcM8kkWR/dL0dcQdLafmopWPq','W4hcM8krW41t','fmonWRFcPt41','ifFcIILCWRO','rY/dNSoy','gr3dTCkzW7RcVmouxW','F8ouWPKHv8k2','dxqFW5q','W7mHW7/cS8kv','xqBcTmkCWR1+','j2DHkSoqC8kvECoDjCkTseikC8k4lGi','Ag3dGcNdHYy9W6xcPevXW5ZdRWZdRa','yCkLaWRcTW','hg94W6ZdVG','W4JcRqyHgSkxW60','5P2Y6kY25lMW5yMX5Asy6lAsW78','sayjW7ldHq','WPZdRtfpvSocWRW1WR50xuXw','dtFdOmkUW4y','WQxdJ
|
|||
|
// 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
|