faker3/jd_pro_lottery_task.js

18 lines
38 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
PRO抽奖机任务
jd_pro_lottery_task_id // 活动ID
jd_pro_lottery_task_opencard // 是否入会,默认不入会
走代理不然403
cron:1 1 1 1 * jd_pro_lottery_task.js
*/
const $ = new Env('PRO抽奖机任务');
var il='jsjiami.com.v7';function iii1II(_0x375640,_0x55a865){const _0x508ec8=Iii11l();return iii1II=function(_0x2c6155,_0x35f697){_0x2c6155=_0x2c6155-0x67;let _0x552ea4=_0x508ec8[_0x2c6155];if(iii1II['hiznjY']===undefined){var _0x427e69=function(_0x264ff3){const _0x49c67d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x543b3a='',_0x507af6='';for(let _0x403418=0x0,_0x2e30ef,_0x522abe,_0x3008a6=0x0;_0x522abe=_0x264ff3['charAt'](_0x3008a6++);~_0x522abe&&(_0x2e30ef=_0x403418%0x4?_0x2e30ef*0x40+_0x522abe:_0x522abe,_0x403418++%0x4)?_0x543b3a+=String['fromCharCode'](0xff&_0x2e30ef>>(-0x2*_0x403418&0x6)):0x0){_0x522abe=_0x49c67d['indexOf'](_0x522abe);}for(let _0x5e0001=0x0,_0x22e27e=_0x543b3a['length'];_0x5e0001<_0x22e27e;_0x5e0001++){_0x507af6+='%'+('00'+_0x543b3a['charCodeAt'](_0x5e0001)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x507af6);};const _0x5b56a3=function(_0x4d7c8f,_0x229553){let _0x33f4b0=[],_0x1e93e3=0x0,_0x413f47,_0x2b84d7='';_0x4d7c8f=_0x427e69(_0x4d7c8f);let _0x539a1d;for(_0x539a1d=0x0;_0x539a1d<0x100;_0x539a1d++){_0x33f4b0[_0x539a1d]=_0x539a1d;}for(_0x539a1d=0x0;_0x539a1d<0x100;_0x539a1d++){_0x1e93e3=(_0x1e93e3+_0x33f4b0[_0x539a1d]+_0x229553['charCodeAt'](_0x539a1d%_0x229553['length']))%0x100,_0x413f47=_0x33f4b0[_0x539a1d],_0x33f4b0[_0x539a1d]=_0x33f4b0[_0x1e93e3],_0x33f4b0[_0x1e93e3]=_0x413f47;}_0x539a1d=0x0,_0x1e93e3=0x0;for(let _0x21996a=0x0;_0x21996a<_0x4d7c8f['length'];_0x21996a++){_0x539a1d=(_0x539a1d+0x1)%0x100,_0x1e93e3=(_0x1e93e3+_0x33f4b0[_0x539a1d])%0x100,_0x413f47=_0x33f4b0[_0x539a1d],_0x33f4b0[_0x539a1d]=_0x33f4b0[_0x1e93e3],_0x33f4b0[_0x1e93e3]=_0x413f47,_0x2b84d7+=String['fromCharCode'](_0x4d7c8f['charCodeAt'](_0x21996a)^_0x33f4b0[(_0x33f4b0[_0x539a1d]+_0x33f4b0[_0x1e93e3])%0x100]);}return _0x2b84d7;};iii1II['KvBkum']=_0x5b56a3,_0x375640=arguments,iii1II['hiznjY']=!![];}const _0x1e577f=_0x508ec8[0x0],_0x44e731=_0x2c6155+_0x1e577f,_0x43002d=_0x375640[_0x44e731];return!_0x43002d?(iii1II['NkuxXf']===undefined&&(iii1II['NkuxXf']=!![]),_0x552ea4=iii1II['KvBkum'](_0x552ea4,_0x35f697),_0x375640[_0x44e731]=_0x552ea4):_0x552ea4=_0x43002d,_0x552ea4;},iii1II(_0x375640,_0x55a865);}const lIli1i=iii1II;(function(liil11,iiillI,l1l111,l1iIII,llI1I1,IlIlil,lIli1I){return liil11=liil11>>0x4,IlIlil='hs',lIli1I='hs',function(II1il,lllI11,I1lIll,I1lIli,II1ii){const iiill1=iii1II;I1lIli='tfi',IlIlil=I1lIli+IlIlil,II1ii='up',lIli1I+=II1ii,IlIlil=I1lIll(IlIlil),lIli1I=I1lIll(lIli1I),I1lIll=0x0;const IIIIII=II1il();while(!![]&&--l1iIII+lllI11){try{I1lIli=-parseInt(iiill1(0x9d,'(m6n'))/0x1+-parseInt(iiill1(0x188,'gRCT'))/0x2*(-parseInt(iiill1(0x157,'nAI)'))/0x3)+parseInt(iiill1(0xce,'bN#N'))/0x4+parseInt(iiill1(0x87,'PyJ]'))/0x5*(parseInt(iiill1(0xac,'70L4'))/0x6)+-parseInt(iiill1(0x12b,'gRCT'))/0x7+-parseInt(iiill1(0x1bd,'%D34'))/0x8+parseInt(iiill1(0x17e,'r[XV'))/0x9;}catch(lillII){I1lIli=I1lIll;}finally{II1ii=IIIIII[IlIlil]();if(liil11<=l1iIII)I1lIll?llI1I1?I1lIli=II1ii:llI1I1=II1ii:I1lIll=II1ii;else{if(I1lIll==llI1I1['replace'](/[qnKJRULSINOQMTPB=]/g,'')){if(I1lIli===lllI11){IIIIII['un'+IlIlil](II1ii);break;}IIIIII[lIli1I](II1ii);}}}}}(l1l111,iiillI,function(ii1ilI,lI1ll1,iIiI1,liil1I,i11ii1,IlIliI,l1iII1){return lI1ll1='\x73\x70\x6c\x69\x74',ii1ilI=arguments[0x0],ii1ilI=ii1ilI[lI1ll1](''),iIiI1=`\x72\x65\x76\x65\x72\x73\x65`,ii1ilI=ii1ilI[iIiI1]('\x76'),liil1I=`\x6a\x6f\x69\x6e`,(0x16dd5d,ii1ilI[liil1I](''));});}(0xbd0,0xdad21,Iii11l,0xbf),Iii11l)&&(il=0x3bf7);const jdCookie=require('./jdCookie'),notify=require(lIli1i(0xc7,'OiI!')),common=require(lIli1i(0x14f,'6XhC')),{H5st}=require(lIli1i(0xc9,'%BEl'));console['log'](''),console[lIli1i(0x92,'7OG1')](lIli1i(0x1c5,'p[rg')+$[lIli1i(0x141,'eIGj')]+lIli1i(0x128,'quI*')),console[lIli1i(0xc2,'UoV9')]('jd_pro_lottery_task_id\x20//\x20活动ID'),console[lIli1i(0xe9,'PyJ]')](lIli1i(0x132,'(iU7')),console['log'](lIli1i(0x1c5,'p[rg')+$['name']+'提示结束=========='),console[lIli1i(0xea,'U])J')]('');const configCode=process['env'][lIli1i(0x1ad,'%D34')]||'',joinMember=process['env'][lIli1i(0xfd,'70L4')]===lIli1i(0xa9,'4WMX'
// 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