KR/jd_drawCenter.js

18 lines
82 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称店铺抽奖中心 · 超级无线
活动链接https://lzkj-isv.isvjd.com/drawCenter/activity/activity?activityId=<活动id>
环境变量
jd_drawCenter_activityId // 活动id、链接均可
jd_drawCenter_addCart // 是否做加购任务,默认不做
JD_LZ_OPEN //关闭LZ相关活动运行
jd_drawCenter_blacklist // 黑名单 用&隔开 pin值
默认助力第一个号
*/
const $ = new Env('店铺抽奖中心(超级无线)')
var version_='jsjiami.com.v7';const lIilIl=iii1II;(function(Ii1Ii,Il1iIl,lIi1ll,l1IIiI,IlilIi,I1lilI,i11IiI){return Ii1Ii=Ii1Ii>>0x7,I1lilI='hs',i11IiI='hs',function(iIlill,IlilIl,iIlili,Ii1II,Iii1l1){const iIiiIl=iii1II;Ii1II='tfi',I1lilI=Ii1II+I1lilI,Iii1l1='up',i11IiI+=Iii1l1,I1lilI=iIlili(I1lilI),i11IiI=iIlili(i11IiI),iIlili=0x0;const iIlil1=iIlill();while(!![]&&--l1IIiI+IlilIl){try{Ii1II=-parseInt(iIiiIl(0x202,'KdX1'))/0x1+parseInt(iIiiIl(0x367,'xrmi'))/0x2*(-parseInt(iIiiIl(0x278,'WJfz'))/0x3)+parseInt(iIiiIl(0x3d4,'X32C'))/0x4*(-parseInt(iIiiIl(0x496,'n0Qc'))/0x5)+-parseInt(iIiiIl(0x342,'^]f$'))/0x6*(parseInt(iIiiIl(0x3d3,')bLn'))/0x7)+parseInt(iIiiIl(0x21e,'j5^a'))/0x8+-parseInt(iIiiIl(0x3b5,'FSGu'))/0x9*(parseInt(iIiiIl(0x3f8,'R8wa'))/0xa)+parseInt(iIiiIl(0x237,'R8wa'))/0xb*(parseInt(iIiiIl(0x4ce,'92^@'))/0xc);}catch(l1IIi1){Ii1II=iIlili;}finally{Iii1l1=iIlil1[I1lilI]();if(Ii1Ii<=l1IIiI)iIlili?IlilIi?Ii1II=Iii1l1:IlilIi=Iii1l1:iIlili=Iii1l1;else{if(iIlili==IlilIi['replace'](/[MfXrkwHJKBOUpFVbYTh=]/g,'')){if(Ii1II===IlilIl){iIlil1['un'+I1lilI](Iii1l1);break;}iIlil1[i11IiI](Iii1l1);}}}}}(lIi1ll,Il1iIl,function(IIiii1,IlilII,iIII1,I1lil1,iIlilI,i11Ii1,lIilIi){return IlilII='\x73\x70\x6c\x69\x74',IIiii1=arguments[0x0],IIiii1=IIiii1[IlilII](''),iIII1='\x72\x65\x76\x65\x72\x73\x65',IIiii1=IIiii1[iIII1]('\x76'),I1lil1='\x6a\x6f\x69\x6e',(0x136460,IIiii1[I1lil1](''));});}(0x6580,0xbfd2d,Iii11l,0xcd),Iii11l)&&(version_=Iii11l);const iIiilI=$[lIilIl(0x4d1,'R8wa')]()?require(lIilIl(0x198,'[5sq')):'',iIiiil=$[lIilIl(0x29b,'@tPZ')]()?require(lIilIl(0x25d,'$yBu')):'',iIiiii=require(lIilIl(0x434,'3n%T')),ilIlIi=require('./function/krwxSavePrize');let ilIlIl=[],l1lI1I='',ll1llI='',i11lIl={},l1lI11=!![],lI1iii=!![],i11lIi={},ll1ll1='';if($['isNode']()){Object[lIilIl(0x425,'@f3X')](iIiilI)[lIilIl(0x1d8,'FSGu')](ll1li1=>{const iIiiIi=lIilIl;ilIlIl[iIiiIi(0x1f8,'3n%T')](iIiilI[ll1li1]);});if(process['env']['JD_DEBUG']&&process['env'][lIilIl(0x1d5,'GZn(')]===lIilIl(0x1d9,'KdX1'))console['log']=()=>{};}else{let iIIlll=$[lIilIl(0x3dd,'Yj2y')](lIilIl(0x2c2,'xrmi'))||'[]';iIIlll=JSON[lIilIl(0x208,'[yQk')](iIIlll),ilIlIl=iIIlll['map'](I1iiiI=>I1iiiI['cookie']),ilIlIl[lIilIl(0x23c,'[yQk')](),ilIlIl[lIilIl(0x180,'ryGy')](...[$['getdata'](lIilIl(0x4cd,'iVt1')),$[lIilIl(0x468,'iVt1')]('CookieJD')]),ilIlIl[lIilIl(0x314,'bAh^')](),ilIlIl=ilIlIl[lIilIl(0x196,'X32C')](iiI1il=>!!iiI1il);}let lilil1=process['env']['jd_drawCenter_activityId']?process['env']['jd_drawCenter_activityId']:'',lIilli=process[lIilIl(0x2e1,'^[$Y')][lIilIl(0x382,'9g8G')]?process[lIilIl(0x431,'@f3X')][lIilIl(0x38c,'APn6')]:lIilIl(0x4c6,'&]E%'),I1iiii=process[lIilIl(0x472,'T)y1')][lIilIl(0x40d,'6*Dn')]?process['env'][lIilIl(0x409,'nIvu')]:lIilIl(0x4fa,'xrmi'),iiI1iI='',I1iiil='';function Iii11l(){const liii1l=(function(){return[version_,'wKTwjFhhsjOViHUaJYmbHiB.rrXcoMOpmf.UvFk7==','WPuYBwvUW5yCEmkUW6S','c8oVWOOqdmoBW5lcVmkTmG','WOC0EN59W4S4Amkj','hCoKnbVdHedcHmkR','tSoUdspdSq','tv/cLtHs','FJ/dUKCV','qWOZfJq','W4tcG8okcLW','WPNdGXtdHJ8','8ykJImkN56QT5RkJ','n3ddRftcUmkfW5pcJr0kaq','BdlcQHFdV8oNWQBdKrqcpSk5pSolomoMW7TRlrKwWP/dHSotWRtcV3q','dSo5jXddPW','W4SAW5Krgq','W5WibgLNWOiXfsa5AmohwJC','WPnEfmk9qa','gdJcQ8oDd8k3W5/cLCkQW7DcWOhdStmBpmo/W5z1WQ/cShGjf8odiu3cQ8ojptZcLmk+','WQFcQYtcMJa','shRdRSoBcCkxW6tcQmkc','wgRcMYpdQa','pmk6rLyyWRddPxtcOa','fCkUWOK8nq','CxpcK8keW58','W6uqW64LiW','dGxcO8o6iG','sXJdTMmR','WQGKW7hcQsWuWRRcHfhdJqRdUGm','W4dcMWi1WRNcMmkuEhNdRcG0mK3dHIu7ta5cW4ZcLCky','h00YWRBcUa','c8kSFh0/','BSktWOLqrq','z8kermkBAMhcLmo0WOe','gmo4ichdSW','ythdT8odWOxcLG','W6KHW40dkq','a8oEWOyDW7NcHfRdIq','d8oRWPDj','nSoXWO5OiNVcNSkfrSouW4ZdJSoRW4fE','ASkRrvufWQtdRw7dVbOjjZbbWPJdT1S0htrJWOj+nYaeyx3cPW','WRhcOZJcMXK','W4OaW4KeeSkuWRjaDaXarubbWR8heSkCsSk/F01jfw7dTa8','WQTubmkUAq','t07cSCk4W7G','dmkqwelcSG','W795za','jCoZWPrLo38','WP4tW4VcUmoquZu','WOCbW7xcPmos','WRpcRspcMcW','W6FdKLOYWRK','pSo2jmksW4JcQmk7WO1qkG','rEISGEMhJ+AwNoEAPEw+SoIpMownTvTsW7H+W67dHW','WRr8W7/cLvm','W6lcN8oTeh8','W5qBW78Jfq','cCowWPex','k8k8EfWr','imkcDL3cLq','f8kWqxFcHW','WPaNu1ri','W5WzbLBdRCkprNT+n8oQW6f2WQG'
// 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