KR/jd_luck_draw.js

32 lines
168 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称店铺抽奖 · 超级无线
活动链接https://lzkj-isv.isvjcloud.com/lzclient/<活动id>/cjwx/common/entry.html?activityId=<活动id>&gameType=<玩法类型>
https://lzkj-isv.isvjcloud.com/wxDrawActivity/activity/activity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity/activity?activityId=<活动id>
环境变量LUCK_DRAW_URL // 活动链接
LUCK_DRAW_OPENCARD // 是否开卡,默认不开卡
LUCK_DRAW_NOTIFY // 是否推送通知,默认不推送 抽中才会推送,空气不推送
LUCK_DRAW_NUM //运行账号数量默认运行前7
LUCK_DRAW_WAIT // 账号间延迟,默认 3秒
LUCK_DRAW_Number // 连续无次数跳出,默认 5 次,火爆账号请设置黑名单,否则也会占用次数
LUCK_DRAW_BLACKLIST 黑名单 &隔开 pin值
JD_LZ_OPEN // 是否开启LZ活动运行默认运行
JD_CJ_OPEN // 是否开启CJ活动运行默认运行
只有在没有抽奖次数的情况下才会去做任务获取
2023/3/19 连续无次数跳出默认 5 火爆账号请设置黑名单否则也会占用次数
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#店铺抽奖通用活动-加密
1 1 1 1 * jd_luck_draw.js, tag=店铺抽奖通用活动-加密, enabled=true
*/
const $ = new Env("店铺抽奖通用活动-加密");
2023-08-29 23:01:33 +08:00
var version_='jsjiami.com.v7';const IilIilll=lIliIiI;(function(iiIi1IIi,lii1i1l1,il111lII,I1ii1il,l1lIli1i,Iil111Ii,li1lI1l1){return iiIi1IIi=iiIi1IIi>>0x2,Iil111Ii='hs',li1lI1l1='hs',function(iIiIliIi,IllI1Ili,IIIIiI,iiIl1II,ii11iiil){const Il1l1I1l=lIliIiI;iiIl1II='tfi',Iil111Ii=iiIl1II+Iil111Ii,ii11iiil='up',li1lI1l1+=ii11iiil,Iil111Ii=IIIIiI(Iil111Ii),li1lI1l1=IIIIiI(li1lI1l1),IIIIiI=0x0;const l1lI1ll=iIiIliIi();while(!![]&&--I1ii1il+IllI1Ili){try{iiIl1II=-parseInt(Il1l1I1l(0x619,'JgTE'))/0x1+parseInt(Il1l1I1l(0x4d3,'V)%n'))/0x2*(-parseInt(Il1l1I1l(0x562,'Xw#0'))/0x3)+-parseInt(Il1l1I1l(0x3d3,'UCHr'))/0x4*(-parseInt(Il1l1I1l(0x55e,'NksG'))/0x5)+-parseInt(Il1l1I1l(0x6c1,'FF&G'))/0x6*(-parseInt(Il1l1I1l(0x4e1,'zf19'))/0x7)+parseInt(Il1l1I1l(0x339,'9NZ]'))/0x8+-parseInt(Il1l1I1l(0x65b,'*Ci%'))/0x9*(-parseInt(Il1l1I1l(0x6a1,'QeQF'))/0xa)+-parseInt(Il1l1I1l(0x1c0,'v^t1'))/0xb;}catch(IIll1I1l){iiIl1II=IIIIiI;}finally{ii11iiil=l1lI1ll[Iil111Ii]();if(iiIi1IIi<=I1ii1il)IIIIiI?l1lIli1i?iiIl1II=ii11iiil:l1lIli1i=ii11iiil:IIIIiI=ii11iiil;else{if(IIIIiI==l1lIli1i['replace'](/[kTUOQyIlndPuFGMbxgEXHh=]/g,'')){if(iiIl1II===IllI1Ili){l1lI1ll['un'+Iil111Ii](ii11iiil);break;}l1lI1ll[li1lI1l1](ii11iiil);}}}}}(il111lII,lii1i1l1,function(iiil1I11,l1li11l1,iili1III,llll11I1,iII1ll11,ililliI,lI1I111I){return l1li11l1='\x73\x70\x6c\x69\x74',iiil1I11=arguments[0x0],iiil1I11=iiil1I11[l1li11l1](''),iili1III=`\x72\x65\x76\x65\x72\x73\x65`,iiil1I11=iiil1I11[iili1III]('\x76'),llll11I1=`\x6a\x6f\x69\x6e`,(0x13bbae,iiil1I11[llll11I1](''));});}(0x328,0xa246d,llili1I,0xcc),llili1I)&&(version_=llili1I);const IIli1I1i=$['isNode']()?require(IilIilll(0x779,'zf19')):'',l1liiIii=$[IilIilll(0x7ab,'51h2')]()?require(IilIilll(0x59f,'PBz6')):'',l1lIl1ii=require(IilIilll(0x740,'Xw#0')),Il1iIi=require(IilIilll(0x311,'E7!i')),iiililll=require(IilIilll(0x3ed,'51h2')),I1i1iI11=require(IilIilll(0x548,'3!m('));let i1liIlii=process[IilIilll(0x260,'daqY')][IilIilll(0x176,'Y$d8')]?process['env'][IilIilll(0x29b,'&kbs')]:'',IIIllIIl=process['env'][IilIilll(0x284,'&jW1')]?process[IilIilll(0x2c7,'v^t1')][IilIilll(0x6db,'Y$d8')]:'false',i1llllll=process[IilIilll(0x2c7,'v^t1')][IilIilll(0x172,'zf19')]?process[IilIilll(0x218,'hcO2')]['LUCK_DRAW_OPENCARD']:'false';const lllilII=process[IilIilll(0x44c,'E7!i')][IilIilll(0x4cd,'3!m(')]?process[IilIilll(0x5c1,'1sEB')][IilIilll(0x1bd,'rnr#')]:'',I1ll1lll=process['env']['WX_ADDRESS_BLOCK']?process[IilIilll(0x694,'Y$d8')][IilIilll(0x43d,'daqY')]:'';let i1lllIli=0x7;process['env']['LUCK_DRAW_NUM']&&process[IilIilll(0x260,'daqY')][IilIilll(0x460,'9[nn')]!=0x7&&(i1lllIli=process[IilIilll(0x6f2,'*Ci%')][IilIilll(0x2e6,'FF&G')]);let l1ilil=process['env'][IilIilll(0x614,'b2T!')]?process['env'][IilIilll(0x153,'VWo7')]:'3',ii111I11=process['env']['LUCK_DRAW_Number']?process[IilIilll(0x4cf,'gw4K')]['LUCK_DRAW_Number']:'5',ii1IIi11=!![],IIiI1iI={},l1lllIiI='',l11ll1ll=[],iI1IiiII='',ii1l1llI='',iI1IiII='';messageTitle='';if($[IilIilll(0x64d,'UCHr')]()){if(JSON[IilIilll(0x310,'krf]')](process[IilIilll(0x5be,'JgTE')])['indexOf']('GITHUB')>-0x1)process[IilIilll(0x682,'D]F]')](0x0);Object[IilIilll(0x2ff,'daqY')](l1liiIii)[IilIilll(0x2ed,'FF&G')](ii1l1I1i=>{l11ll1ll['push'](l1liiIii[ii1l1I1i]);});if(process[IilIilll(0x5e8,'poRV')][IilIilll(0x42b,'PBz6')]&&process[IilIilll(0x6f1,'k#vY')]['JD_DEBUG']==='false')console[IilIilll(0x17a,'T1@a')]=()=>{};}else l11ll1ll=[$[IilIilll(0x58e,'krf]')](IilIilll(0x233,'9[nn')),$['getdata'](IilIilll(0x72e,'krf]')),...$['toObj']($['getdata'](IilIilll(0x764,'E7!i'))||'[]')[IilIilll(0x50b,'NksG')](i111ilIl=>i111ilIl[IilIilll(0x137,'v^t1')])]['filter'](IiIlIlll=>!!IiIlIlll);let llIililI=process['env']['JD_LZ_OPEN']?process['env'][IilIilll(0x578,'f^e4')]:IilIilll(0x34c,'&kbs'),lIlIIlii=process[IilIilll(0x254,'HCno')]['JD_CJ_OPEN']?process[IilIilll(0x44c,'E7!i')][IilIilll(0x16e,'mk@1')]:IilIilll(0x7eb,'VWo7'),iiIlIllI='',i1l1llii='';$['whitelist']=process[IilIilll(0x12a,'ZkTB')]['LUCK_DRAW_WHITELIST']||iiIlIllI,$[IilIilll(0x1d5,'FF&G')]=process['env'][IilIilll(0x6dc,']w$J')]||i1l1llii,lliIii(),IiiI1l1i();if(i1liIlii){cons
2023-07-27 16:14:01 +08:00
// 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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])