faker3/jd_drawCenter.js

25 lines
95 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称店铺抽奖中心 · 超级无线
活动链接https://lzkj-isv.isvjd.com/drawCenter/activity/activity?activityId=<活动id>
环境变量jd_drawCenter_activityId // 活动id
jd_drawCenter_notify // 是否推送通知,默认不推送
jd_drawCenter_addCart // 是否做加购任务,默认不做
默认助力第一个号
7 7 7 7 *
*/
const $ = new Env('店铺抽奖中心(超级无线)')
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const notify = require('./function/sendJDNotify')
const common = require('./function/jdCommon')
const getToken = require('./function/getToken')
const { wxSavePrize } = require('./function/savePrize')
var il='jsjiami.com.v7';const llii1iil=IlI1iIll;(function(iIi1lI1I,Ii1liiII,lli1I11,I1li1ii,IIlIliI1,i1l1i1li,illiiIIl){return iIi1lI1I=iIi1lI1I>>0x9,i1l1i1li='hs',illiiIIl='hs',function(IIi11lI,ililiill,IIiIl,liIiilll,iiI111i){const iiIi1i1i=IlI1iIll;liIiilll='tfi',i1l1i1li=liIiilll+i1l1i1li,iiI111i='up',illiiIIl+=iiI111i,i1l1i1li=IIiIl(i1l1i1li),illiiIIl=IIiIl(illiiIIl),IIiIl=0x0;const I1lIiI11=IIi11lI();while(!![]&&--I1li1ii+ililiill){try{liIiilll=parseInt(iiIi1i1i(0x2e3,'oCnD'))/0x1*(parseInt(iiIi1i1i(0x2e6,'VXG('))/0x2)+parseInt(iiIi1i1i(0x58f,'(hp6'))/0x3+parseInt(iiIi1i1i(0x127,'%ef2'))/0x4*(-parseInt(iiIi1i1i(0x46d,'DD[g'))/0x5)+-parseInt(iiIi1i1i(0x2b3,'9QS4'))/0x6+parseInt(iiIi1i1i(0x11b,'MnO@'))/0x7*(parseInt(iiIi1i1i(0x4c3,'Zfb7'))/0x8)+-parseInt(iiIi1i1i(0x552,'S^(q'))/0x9*(-parseInt(iiIi1i1i(0x4a2,'plJ*'))/0xa)+parseInt(iiIi1i1i(0x358,'MnO@'))/0xb*(-parseInt(iiIi1i1i(0x315,'4HQ5'))/0xc);}catch(IIll11li){liIiilll=IIiIl;}finally{iiI111i=I1lIiI11[i1l1i1li]();if(iIi1lI1I<=I1li1ii)IIiIl?IIlIliI1?liIiilll=iiI111i:IIlIliI1=iiI111i:IIiIl=iiI111i;else{if(IIiIl==IIlIliI1['replace'](/[DOwgBRbdGekYWqXJIVH=]/g,'')){if(liIiilll===ililiill){I1lIiI11['un'+i1l1i1li](iiI111i);break;}I1lIiI11[illiiIIl](iiI111i);}}}}}(lli1I11,Ii1liiII,function(il1Il1li,iiIl1Il1,IIilil,i1IliIl,iIiIiII,i1ilIII1,I1ilIl){return iiIl1Il1='\x73\x70\x6c\x69\x74',il1Il1li=arguments[0x0],il1Il1li=il1Il1li[iiIl1Il1](''),IIilil=`\x72\x65\x76\x65\x72\x73\x65`,il1Il1li=il1Il1li[IIilil]('\x76'),i1IliIl=`\x6a\x6f\x69\x6e`,(0x16c343,il1Il1li[i1IliIl](''));});}(0x18e00,0x4f83c,i1I1i11i,0xc9),i1I1i11i)&&(il=0x21b6);let isNotify=process[llii1iil(0x397,'plJ*')][llii1iil(0x35a,'[VM$')]===llii1iil(0x359,'v#dp'),addCart=process[llii1iil(0x2c3,'4Xo7')][llii1iil(0x53f,'AZ60')]||llii1iil(0x511,'uOsT'),cookiesArr=[],cookie='',message='',ownCode={},lz_cookie={},drawCenterActivityId='';if($[llii1iil(0x119,'umu7')]()){Object[llii1iil(0x378,'MnO@')](jdCookieNode)[llii1iil(0x54c,'uOsT')](i1IiIiI=>{const l1i1iiIl=llii1iil;cookiesArr[l1i1iiIl(0x417,'rtEB')](jdCookieNode[i1IiIiI]);});if(process[llii1iil(0x562,'GQcu')][llii1iil(0x147,'[VM$')]&&process[llii1iil(0x125,'6E1#')][llii1iil(0x4fd,'P%te')]===llii1iil(0x48b,'q)jk'))console[llii1iil(0x1d1,'DoaY')]=()=>{};}else{let cookiesData=$[llii1iil(0x2ab,'Q91O')](llii1iil(0x58d,'[VM$'))||'[]';cookiesData=JSON[llii1iil(0x2b7,'(hp6')](cookiesData),cookiesArr=cookiesData[llii1iil(0x5b0,'KM5B')](ll1I1ill=>ll1I1ill[llii1iil(0x18a,'ZwLi')]),cookiesArr[llii1iil(0x18b,')qR8')](),cookiesArr[llii1iil(0x14b,'4Xo7')](...[$[llii1iil(0x1d6,'VnA6')](llii1iil(0x47c,'9QS4')),$[llii1iil(0x3e7,'oJ@V')](llii1iil(0x4dc,'^bEB'))]),cookiesArr[llii1iil(0x285,'!]Nq')](),cookiesArr=cookiesArr[llii1iil(0x453,'Zfb7')](l11lI1Ii=>!!l11lI1Ii);}process[llii1iil(0x329,'*T35')][llii1iil(0x59e,'plJ*')]&&process[llii1iil(0x563,'vTz9')][llii1iil(0x59e,'plJ*')]!=''&&(drawCenterActivityId=process[llii1iil(0x467,'Zfb7')][llii1iil(0x193,'wo8s')][llii1iil(0x1ee,'CxMF')](','));function i1I1i11i(){const lIliI1Il=(function(){return[...[il,'XwDOjOsqjqIiVaHGBmbkRiWG.wdcYJowXmge.Ov7==','WRVdHZRdN3m','W43dO8oiWPHQ','WPXhsSk6lmoc','W47dImoKWOq','xdFcK8omyG','W4OYodS','rZdcRCo7xq','zdpcQSopDa','bInIW61O','WONdUSoOWR5l','BSoZyrC','5y2M5RAz6kEz5zwB5zch','W4XyWR/dSSk1E8kUaSoQ','yCo3Bau','W4pdVCo4WP5s','W7lcL8k4W6NdIG','WOXWv07dQ1BcS8o6','WOTawhtdGG','WRVdI8kknNFcGmka','WRVdJ8kbc3pcGSkb','WRpdRbldQMKUhmofWOySWOW+','h8ofumotWP/dMuLCCmkS','W6JcQeWjEW','WPRcRr4pWPW','WQ9xWRxcQbCz','WQ/cQhpdG8o1Cq','W4m7WPlcLZm','W510WQFdKSk7','ycjgEWW7W73cP8oNjq','W4ZdGmoP','yCoGFLBcPa','FtxcGCoGq3hdIcZcJq','WPLXWRRcMXe','v8kOW4vNumkC','FSoSWRJdVSkfAc3cVa','WRP3nZJcOIC','zmo1Ba3dS29kWRXqv8kF','DmouWPJdSCkX','fZGpW4hdRhnwWQqX','WPFdS8oxWReg','bSkCWRpcGIVcUa3cOdLwd8o5','rXhcUSoDsW','WO9yW7CNza','ACo5FW','WPjFW7qwzW','E8oJvtLi','WQRdQb7dUG','W5lcT8kyW6ldKCkCWRu','WQ8yemojWR0','WRaIbG','WPCafmoQWOu','WQZcGCoCW7RcPa','nSoXWRRdPSkaqctdPfeqWRJdMa/dVSodWOTlsurzFXlcPmoc','jcfXW4PZ','W5NcNCkgW5ZdLG','WPPgE8k5kSoliCkmWR5EcXhcHSoNW4VcJCkLW6tdGI1qa8o9W4G','WPTPhWNcVW','AmoZAXFdPgfB','WPhcV1DdyW','EcNcOq','WRZd
// 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