KR/jd_wxMcLevelAndBirthGifts.js

24 lines
105 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称生日礼包/会员等级礼包 · 超级无线
活动链接https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=<活动id>
必须条件配置文件或者环境变量中添加变量
## CJ店铺生日和等级礼包-jd_wxMcLevelAndBirthGifts.js
//export jd_wxMcLevelAndBirthGifts_activityUrl // 活动链接
//export jd_wxMcLevelAndBirthGifts_num //运行账号数量默认运行前7
//export jd_wxMcLevelAndBirthGifts_openCard //是否开卡,需要开卡变量值为 true默认不开卡
//export JD_CJ_OPEN="false" //关闭CJ相关活动运行
//export jd_wxMcLevelAndBirthGifts_blacklist //黑名单 用&隔开 pin值
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#CJ店铺生日和等级礼包-加密
1 1 1 1 * jd_wxMcLevelAndBirthGifts.js, tag=CJ店铺生日和等级礼包-加密, enabled=true
*/
const $ = new Env("生日礼包和会员等级礼包");
2023-10-22 10:38:09 +08:00
var version_='jsjiami.com.v7';const ii1i1iiI=lilIiiIl;(function(l1ll1lll,l1llilll,ll111ili,illI11l1,iI11iIi1,l1I111iI,liIilIII){return l1ll1lll=l1ll1lll>>0x8,l1I111iI='hs',liIilIII='hs',function(ll1i1IiI,liIliI1I,ilIllil1,lIll11I1,ii1lil1){const IiIiiiiI=lilIiiIl;lIll11I1='tfi',l1I111iI=lIll11I1+l1I111iI,ii1lil1='up',liIilIII+=ii1lil1,l1I111iI=ilIllil1(l1I111iI),liIilIII=ilIllil1(liIilIII),ilIllil1=0x0;const ll11ll1i=ll1i1IiI();while(!![]&&--illI11l1+liIliI1I){try{lIll11I1=parseInt(IiIiiiiI(0x447,'9nB@'))/0x1*(parseInt(IiIiiiiI(0x234,'Vz!q'))/0x2)+-parseInt(IiIiiiiI(0x26e,'Kg(G'))/0x3+parseInt(IiIiiiiI(0x318,'NCmy'))/0x4+parseInt(IiIiiiiI(0x4eb,'koRo'))/0x5+parseInt(IiIiiiiI(0x525,'aw$L'))/0x6*(parseInt(IiIiiiiI(0x3e2,'0NzW'))/0x7)+parseInt(IiIiiiiI(0x41d,'udt*'))/0x8+parseInt(IiIiiiiI(0x521,'W3qp'))/0x9*(-parseInt(IiIiiiiI(0x2ca,'JM&u'))/0xa);}catch(l1lIIIiI){lIll11I1=ilIllil1;}finally{ii1lil1=ll11ll1i[l1I111iI]();if(l1ll1lll<=illI11l1)ilIllil1?iI11iIi1?lIll11I1=ii1lil1:iI11iIi1=ii1lil1:ilIllil1=ii1lil1;else{if(ilIllil1==iI11iIi1['replace'](/[nEGLtIUAkrBeKdgfyY=]/g,'')){if(lIll11I1===liIliI1I){ll11ll1i['un'+l1I111iI](ii1lil1);break;}ll11ll1i[liIilIII](ii1lil1);}}}}}(ll111ili,l1llilll,function(Il1lli1,liiIlill,ii1iIli,l11iiiII,IlIlI1iI,I1lii1,I1iIilil){return liiIlill='\x73\x70\x6c\x69\x74',Il1lli1=arguments[0x0],Il1lli1=Il1lli1[liiIlill](''),ii1iIli=`\x72\x65\x76\x65\x72\x73\x65`,Il1lli1=Il1lli1[ii1iIli]('\x76'),l11iiiII=`\x6a\x6f\x69\x6e`,(0x143d44,Il1lli1[l11iiiII](''));});}(0xc200,0x769ca,Ii1i1li,0xc4),Ii1i1li)&&(version_=Ii1i1li);const IIIlliii=$[ii1i1iiI(0x5a9,'gRzK')]()?require('./sendNotify'):'',IllilIl=$[ii1i1iiI(0x2b3,'z!xF')]()?require(ii1i1iiI(0x576,'OrS3')):'',li1IIIi=require(ii1i1iiI(0x554,'5iSH')),l1ii1l11=require(ii1i1iiI(0x517,'Vz!q')),li11il1l=require(ii1i1iiI(0x264,'B5ZL'));let liii1111={},Ii1ll1iI='';$[ii1i1iiI(0x561,'NCmy')]=![];let IiiIl1il=[ii1i1iiI(0x377,'$Bf['),ii1i1iiI(0x4ee,'JUYC'),ii1i1iiI(0x232,'0NzW'),ii1i1iiI(0x2f3,'LWkG'),ii1i1iiI(0x2f4,'UGwR'),ii1i1iiI(0x281,'P^Ju'),ii1i1iiI(0x2e5,'ztcq'),ii1i1iiI(0x4db,'Ke#('),ii1i1iiI(0x499,'LWkG'),ii1i1iiI(0x298,'5iSH'),ii1i1iiI(0x27a,'b0g!'),ii1i1iiI(0x368,'W3qp')],l1III11i=[],l1ll11iI='',I1iiIi1='',lIII11ll='',iil1iIii=0x7;process[ii1i1iiI(0x440,'koRo')]['jd_wxMcLevelAndBirthGifts_num']&&process['env']['jd_wxMcLevelAndBirthGifts_num']!=0x7&&(iil1iIii=process[ii1i1iiI(0x29b,'UGwR')][ii1i1iiI(0x3ab,'aWAE')]);let il1I1lll=$[ii1i1iiI(0x31f,'b0g!')]()?process['env'][ii1i1iiI(0x245,'udt*')]?process[ii1i1iiI(0x1e7,'LWkG')][ii1i1iiI(0x415,'Kg(G')]:![]:$[ii1i1iiI(0x3e6,'9s#b')]('jd_wxMcLevelAndBirthGifts_openCard')?$[ii1i1iiI(0x5a1,'GD(T')](ii1i1iiI(0x29a,'0NzW')):![],iIi1iilI=process['env']['jd_wxMcLevelAndBirthGifts_activityUrl']?process[ii1i1iiI(0x389,'F3LF')]['jd_wxMcLevelAndBirthGifts_activityUrl']:'';if($[ii1i1iiI(0x524,'LeV1')]()){if(JSON['stringify'](process[ii1i1iiI(0x39c,'JUYC')])[ii1i1iiI(0x53e,'9s#b')](ii1i1iiI(0x54b,'Ptpa'))>-0x1)process['exit'](0x0);Object[ii1i1iiI(0x3d2,'g0*M')](IllilIl)['forEach'](iI11ilI1=>{const I1l1liIi=ii1i1iiI;l1III11i[I1l1liIi(0x310,'TvR]')](IllilIl[iI11ilI1]);});if(process[ii1i1iiI(0x60a,'lp#%')][ii1i1iiI(0x2b8,'a][v')]&&process[ii1i1iiI(0x1ee,'FGV$')][ii1i1iiI(0x51e,'9s#b')]===ii1i1iiI(0x24a,'a][v'))console['log']=()=>{};}else l1III11i=[$[ii1i1iiI(0x2e9,'dRy*')](ii1i1iiI(0x226,'Y32K')),$[ii1i1iiI(0x49c,'b0g!')](ii1i1iiI(0x4ff,'9ZnO')),...$[ii1i1iiI(0x5ee,']@mV')]($['getdata'](ii1i1iiI(0x4cb,'ztcq'))||'[]')[ii1i1iiI(0x572,'Ptpa')](IillIiii=>IillIiii[ii1i1iiI(0x542,'TvR]')])][ii1i1iiI(0x56b,'koRo')](ii11lIl=>!!ii11lIl);let llIiii11=typeof $request!==ii1i1iiI(0x357,'TU6M');llIiii11&&(GetCookie(),$[ii1i1iiI(0x362,'udt*')]());let ilIIi11I=process[ii1i1iiI(0x268,'OrS3')][ii1i1iiI(0x3d8,'0NzW')]?process[ii1i1iiI(0x434,'JM&u')][ii1i1iiI(0x40b,'NCmy')]:ii1i1iiI(0x219,'YPm('),iIi1illI='',i11Illil='';$[ii1i1iiI(0x3fa,'$Bf[')]=process[ii1i1iiI(0x57a,'YPm(')]['jd_wxMcLevelAndBirthGifts_whitelist']||iIi1illI,$[ii1i1iiI(0x4f0,'JUYC')]=process['env'][ii1i1iiI(0x4d3,'mTud')]||i11Illil,IlIIll1i(),Ill1lIII();if(iIi1iilI)activityId=IiIll
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"])