mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-15 00:09:20 +08:00
15 lines
40 KiB
JavaScript
15 lines
40 KiB
JavaScript
|
/*
|
|||
|
PRO抽奖机抽奖
|
|||
|
|
|||
|
jd_pro_lottery_id // 活动ID
|
|||
|
|
|||
|
|
|||
|
cron:1 1 1 1 * jd_pro_lottery.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('PRO抽奖机抽奖');
|
|||
|
var iil='jsjiami.com.v7';const lI1III=iii1II;function iii1II(_0x236bf2,_0x2117aa){const _0x1b6e29=Iii11l();return iii1II=function(_0x4cfb30,_0x22e285){_0x4cfb30=_0x4cfb30-0xa1;let _0x32c00c=_0x1b6e29[_0x4cfb30];if(iii1II['QBaPOg']===undefined){var _0xafa02a=function(_0x5cb28e){const _0x5b8579='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1d05bd='',_0x41fde2='';for(let _0x2c8787=0x0,_0x3ddc9e,_0x134fa0,_0x4b8a64=0x0;_0x134fa0=_0x5cb28e['charAt'](_0x4b8a64++);~_0x134fa0&&(_0x3ddc9e=_0x2c8787%0x4?_0x3ddc9e*0x40+_0x134fa0:_0x134fa0,_0x2c8787++%0x4)?_0x1d05bd+=String['fromCharCode'](0xff&_0x3ddc9e>>(-0x2*_0x2c8787&0x6)):0x0){_0x134fa0=_0x5b8579['indexOf'](_0x134fa0);}for(let _0x316441=0x0,_0x1e38c5=_0x1d05bd['length'];_0x316441<_0x1e38c5;_0x316441++){_0x41fde2+='%'+('00'+_0x1d05bd['charCodeAt'](_0x316441)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x41fde2);};const _0x575521=function(_0x5d179c,_0xc8419d){let _0x26f8dd=[],_0x350951=0x0,_0x54288c,_0x5ea6a3='';_0x5d179c=_0xafa02a(_0x5d179c);let _0x4d152e;for(_0x4d152e=0x0;_0x4d152e<0x100;_0x4d152e++){_0x26f8dd[_0x4d152e]=_0x4d152e;}for(_0x4d152e=0x0;_0x4d152e<0x100;_0x4d152e++){_0x350951=(_0x350951+_0x26f8dd[_0x4d152e]+_0xc8419d['charCodeAt'](_0x4d152e%_0xc8419d['length']))%0x100,_0x54288c=_0x26f8dd[_0x4d152e],_0x26f8dd[_0x4d152e]=_0x26f8dd[_0x350951],_0x26f8dd[_0x350951]=_0x54288c;}_0x4d152e=0x0,_0x350951=0x0;for(let _0x188257=0x0;_0x188257<_0x5d179c['length'];_0x188257++){_0x4d152e=(_0x4d152e+0x1)%0x100,_0x350951=(_0x350951+_0x26f8dd[_0x4d152e])%0x100,_0x54288c=_0x26f8dd[_0x4d152e],_0x26f8dd[_0x4d152e]=_0x26f8dd[_0x350951],_0x26f8dd[_0x350951]=_0x54288c,_0x5ea6a3+=String['fromCharCode'](_0x5d179c['charCodeAt'](_0x188257)^_0x26f8dd[(_0x26f8dd[_0x4d152e]+_0x26f8dd[_0x350951])%0x100]);}return _0x5ea6a3;};iii1II['hZkavl']=_0x575521,_0x236bf2=arguments,iii1II['QBaPOg']=!![];}const _0x34e99f=_0x1b6e29[0x0],_0x252dcc=_0x4cfb30+_0x34e99f,_0x2e2193=_0x236bf2[_0x252dcc];return!_0x2e2193?(iii1II['AHvjeq']===undefined&&(iii1II['AHvjeq']=!![]),_0x32c00c=iii1II['hZkavl'](_0x32c00c,_0x22e285),_0x236bf2[_0x252dcc]=_0x32c00c):_0x32c00c=_0x2e2193,_0x32c00c;},iii1II(_0x236bf2,_0x2117aa);}(function(IlllIl,II11lI,lI1IIi,I1l11I,Ilil1l,iIIiii,iilll){return IlllIl=IlllIl>>0x1,iIIiii='hs',iilll='hs',function(il1iI1,IlllIi,iIIiil,i1l1Ii,I1iIIi){const iillI=iii1II;i1l1Ii='tfi',iIIiii=i1l1Ii+iIIiii,I1iIIi='up',iilll+=I1iIIi,iIIiii=iIIiil(iIIiii),iilll=iIIiil(iilll),iIIiil=0x0;const I1iIIl=il1iI1();while(!![]&&--I1l11I+IlllIi){try{i1l1Ii=-parseInt(iillI(0x161,'Xqgt'))/0x1+parseInt(iillI(0x194,'cGAq'))/0x2*(parseInt(iillI(0x164,'G8il'))/0x3)+parseInt(iillI(0xe8,'aC2I'))/0x4+-parseInt(iillI(0x21e,'iXa5'))/0x5+-parseInt(iillI(0x1fa,'nSQN'))/0x6+parseInt(iillI(0x121,'5YdT'))/0x7+-parseInt(iillI(0xe0,'&&[Y'))/0x8*(parseInt(iillI(0x1e8,'Jd2q'))/0x9);}catch(lI1IIl){i1l1Ii=iIIiil;}finally{I1iIIi=I1iIIl[iIIiii]();if(IlllIl<=I1l11I)iIIiil?Ilil1l?i1l1Ii=I1iIIi:Ilil1l=I1iIIi:iIIiil=I1iIIi;else{if(iIIiil==Ilil1l['replace'](/[EHltfXKNWrghSndwyQUeL=]/g,'')){if(i1l1Ii===IlllIi){I1iIIl['un'+iIIiii](I1iIIi);break;}I1iIIl[iilll](I1iIIi);}}}}}(lI1IIi,II11lI,function(i1ilI,iii1lI,i1ilI1,Iiilii,Iil1li,Iiilil,Iil1ll){return iii1lI='\x73\x70\x6c\x69\x74',i1ilI=arguments[0x0],i1ilI=i1ilI[iii1lI](''),i1ilI1=`\x72\x65\x76\x65\x72\x73\x65`,i1ilI=i1ilI[i1ilI1]('\x76'),Iiilii=`\x6a\x6f\x69\x6e`,(0x1639fb,i1ilI[Iiilii](''));});}(0x184,0x638ee,Iii11l,0xc4),Iii11l)&&(iil=`\x8d6`);const jdCookie=require(lI1III(0x17e,'M7es')),notify=require(lI1III(0x115,'CV(F')),common=require(lI1III(0xab,'10nd')),{H5st}=require('./utils/Rebels_H'),isNotify=![];let cookie='';console[lI1III(0xde,']XyV')](''),console[lI1III(0xc6,'YwQL')](lI1III(0x1f1,'@6mK')+$[lI1III(0x1ee,'R7Ux')]+'变量说明=========='),console[lI1III(0xde,']XyV')](lI1III(0x20b,'jUUh')),console[lI1III(0x1ae,'yowI')](lI1III(0x204,'nSQN')+$[lI1III(0xc2,'c1!B')]+lI1III(0x10b,'R7Ux')),console[lI1III(0x1d0,'kBsI')]('');const configCode=process[lI1III(0x1b5,'1b12')]['jd_pro_lottery_id']||'',joinMember=process['env'][lI1III(0x14f,'#o3N')]===l
|
|||
|
// 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
|