mirror of https://github.com/6dylan6/jdpro.git
13 lines
52 KiB
JavaScript
13 lines
52 KiB
JavaScript
|
/*
|
|||
|
京东跨年狂欢抽奖
|
|||
|
|
|||
|
只做任务,抽奖 无助力
|
|||
|
|
|||
|
cron "55 5 * * *" script-path=jd_newYear_party.js, tag=京东跨年狂欢抽奖
|
|||
|
|
|||
|
*/
|
|||
|
const $ = new Env('京东跨年狂欢抽奖')
|
|||
|
var iil='jsjiami.com.v7';const l1I1Il=iii1II;(function(liiili,I1ll11,lI1lIi,Iii1Ii,Iii1Il,i1l1I1,lI1lI1){return liiili=liiili>>0x9,i1l1I1='hs',lI1lI1='hs',function(llIl1,l1iIiI,illlli,illlll,IIIIiI){const l1lI1l=iii1II;illlll='tfi',i1l1I1=illlll+i1l1I1,IIIIiI='up',lI1lI1+=IIIIiI,i1l1I1=illlli(i1l1I1),lI1lI1=illlli(lI1lI1),illlli=0x0;const II1I1=llIl1();while(!![]&&--Iii1Ii+l1iIiI){try{illlll=-parseInt(l1lI1l(0xd7,'ysCz'))/0x1+-parseInt(l1lI1l(0x234,'U[zW'))/0x2+parseInt(l1lI1l(0x10a,'c0Nx'))/0x3+parseInt(l1lI1l(0x19e,'gWki'))/0x4*(parseInt(l1lI1l(0x247,'V8m7'))/0x5)+parseInt(l1lI1l(0xb7,'ueKd'))/0x6+-parseInt(l1lI1l(0x203,'*Qqx'))/0x7*(-parseInt(l1lI1l(0x14e,'ueKd'))/0x8)+parseInt(l1lI1l(0x174,'c0Nx'))/0x9;}catch(i1i111){illlll=illlli;}finally{IIIIiI=II1I1[i1l1I1]();if(liiili<=Iii1Ii)illlli?Iii1Il?illlll=IIIIiI:Iii1Il=IIIIiI:illlli=IIIIiI;else{if(illlli==Iii1Il['replace'](/[leUSxuDAWGQhwVqktgJbr=]/g,'')){if(illlll===l1iIiI){II1I1['un'+i1l1I1](IIIIiI);break;}II1I1[lI1lI1](IIIIiI);}}}}}(lI1lIi,I1ll11,function(ii1l1I,lI1lII,lIill1,iiI1i1,ilIlII,iIiil1,l1lI1i){return lI1lII='\x73\x70\x6c\x69\x74',ii1l1I=arguments[0x0],ii1l1I=ii1l1I[lI1lII](''),lIill1=`\x72\x65\x76\x65\x72\x73\x65`,ii1l1I=ii1l1I[lIill1]('\x76'),iiI1i1=`\x6a\x6f\x69\x6e`,(0x14d570,ii1l1I[iiI1i1](''));});}(0x19600,0x6213f,Iii11l,0xcd),Iii11l)&&(iil=0x23af);const lI1l1i=$[l1I1Il(0x12b,'s]og')]()?require(l1I1Il(0x2a0,'lJ2^')):'',i1iil=$['isNode']()?require(l1I1Il(0x101,'2)Y6')):'',llI11l=require('./function/krgetH5st'),I1llIl=require(l1I1Il(0x270,'a#%l'));let i1iii=!![],I1llIi=l1I1Il(0x202,'yrta'),IIii1I=l1I1Il(0x28e,'II5C'),llI11i=l1I1Il(0x191,'eDB*'),i1iIi1=l1I1Il(0x25d,'Zy[d')+iIIil1(0x6f,IIii1I+I1llIi)[l1I1Il(0x176,'Dzgp')](),l1l1il=l1I1Il(0x116,'gWki')+iIIil1(0x7b,IIii1I+I1llIi)[l1I1Il(0x29c,'V8m7')]();const I11i1I={'2':'[支付券]','3':'[优惠券]','4':l1I1Il(0x12d,'[GJG'),'5':l1I1Il(0xfa,'2)Y6')},iliIi1=[l1I1Il(0xc7,'vwvn')];let l1l1ii=[],Il1i1I='',Ii1iii;function iii1II(_0x38fe92,_0x2dda95){const _0x4b12e5=Iii11l();return iii1II=function(_0x2ab64a,_0x1ea9ad){_0x2ab64a=_0x2ab64a-0xaf;let _0x5d703a=_0x4b12e5[_0x2ab64a];if(iii1II['gXLoIU']===undefined){var _0x3fb2c5=function(_0x410033){const _0x39a8e3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b007f='',_0x196b80='';for(let _0x5d90f6=0x0,_0x98c538,_0x47d76c,_0x4a9c96=0x0;_0x47d76c=_0x410033['charAt'](_0x4a9c96++);~_0x47d76c&&(_0x98c538=_0x5d90f6%0x4?_0x98c538*0x40+_0x47d76c:_0x47d76c,_0x5d90f6++%0x4)?_0x4b007f+=String['fromCharCode'](0xff&_0x98c538>>(-0x2*_0x5d90f6&0x6)):0x0){_0x47d76c=_0x39a8e3['indexOf'](_0x47d76c);}for(let _0x15d120=0x0,_0x319f49=_0x4b007f['length'];_0x15d120<_0x319f49;_0x15d120++){_0x196b80+='%'+('00'+_0x4b007f['charCodeAt'](_0x15d120)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x196b80);};const _0x5021fc=function(_0x367cf4,_0x58678b){let _0x32425b=[],_0x4e2cce=0x0,_0x36cd2b,_0x2cb02a='';_0x367cf4=_0x3fb2c5(_0x367cf4);let _0x238d9c;for(_0x238d9c=0x0;_0x238d9c<0x100;_0x238d9c++){_0x32425b[_0x238d9c]=_0x238d9c;}for(_0x238d9c=0x0;_0x238d9c<0x100;_0x238d9c++){_0x4e2cce=(_0x4e2cce+_0x32425b[_0x238d9c]+_0x58678b['charCodeAt'](_0x238d9c%_0x58678b['length']))%0x100,_0x36cd2b=_0x32425b[_0x238d9c],_0x32425b[_0x238d9c]=_0x32425b[_0x4e2cce],_0x32425b[_0x4e2cce]=_0x36cd2b;}_0x238d9c=0x0,_0x4e2cce=0x0;for(let _0xed4ed8=0x0;_0xed4ed8<_0x367cf4['length'];_0xed4ed8++){_0x238d9c=(_0x238d9c+0x1)%0x100,_0x4e2cce=(_0x4e2cce+_0x32425b[_0x238d9c])%0x100,_0x36cd2b=_0x32425b[_0x238d9c],_0x32425b[_0x238d9c]=_0x32425b[_0x4e2cce],_0x32425b[_0x4e2cce]=_0x36cd2b,_0x2cb02a+=String['fromCharCode'](_0x367cf4['charCodeAt'](_0xed4ed8)^_0x32425b[(_0x32425b[_0x238d9c]+_0x32425b[_0x4e2cce])%0x100]);}return _0x2cb02a;};iii1II['Lqddfz']=_0x5021fc,_0x38fe92=arguments,iii1II['gXLoIU']=!![];}const _0x42a33e=_0x4b12e5[0x0],_0x181fd9=_0x2ab64a+_0x42a33e,_0xd66b1f=_0x38fe92[_0x181fd9];return!_0xd66b1f?(iii1II['RIvKxX']===undefined&&(iii1II['RIvKxX']=!![]),_0x5d703a=iii1II['Lqddfz'](_0x5d703a,_0x1ea9ad),_0x38fe92[_0x181fd9]=_0x5d703a):_0x5d703a=_0xd66b1f,_0x5d703a;},iii1II(_0x
|
|||
|
// 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
|