faker3/jd_wxMcLevelAndBirthGifts.js

21 lines
140 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称生日礼包/会员等级礼包 · 超级会员
活动链接https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=<活动id>
环境变量jd_wxMcLevelAndBirthGifts_activityId // 活动id
jd_wxMcLevelAndBirthGifts_openCard // 是否开卡,默认开卡
7 7 7 7 *
*/
const $ = new Env('生日礼包/会员等级礼包(超级会员)')
const notify = $.isNode() ? require('./sendNotify') : ''
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const getH5st = require('./function/getH5st3_0')
const getToken = require('./function/getToken')
var version_='jsjiami.com.v7';const IIilI1Ii=IIililI;(function(iIiI1lI,I1lIii1I,IiIIIIi,liII1I,liIIl1ll,lIIilIlI,i11llIII){return iIiI1lI=iIiI1lI>>0x3,lIIilIlI='hs',i11llIII='hs',function(IIIIlIil,III1i1l,IliiII11,llil1Ii,lllII1II){const i1llill=IIililI;llil1Ii='tfi',lIIilIlI=llil1Ii+lIIilIlI,lllII1II='up',i11llIII+=lllII1II,lIIilIlI=IliiII11(lIIilIlI),i11llIII=IliiII11(i11llIII),IliiII11=0x0;const iiiiii1i=IIIIlIil();while(!![]&&--liII1I+III1i1l){try{llil1Ii=parseInt(i1llill(0x85e,'TvkH'))/0x1*(-parseInt(i1llill(0x3a3,'huyy'))/0x2)+parseInt(i1llill(0x2e1,'qRO)'))/0x3*(parseInt(i1llill(0x761,'Z1!j'))/0x4)+parseInt(i1llill(0x266,'TvkH'))/0x5*(parseInt(i1llill(0x4d9,'IFB#'))/0x6)+-parseInt(i1llill(0x530,'c*&X'))/0x7+-parseInt(i1llill(0x4f2,'J*Oo'))/0x8*(parseInt(i1llill(0x2ac,'huyy'))/0x9)+-parseInt(i1llill(0x6f6,'zdYP'))/0xa*(-parseInt(i1llill(0x35c,'h2)j'))/0xb)+-parseInt(i1llill(0x6e8,'j^7]'))/0xc;}catch(IIIIl111){llil1Ii=IliiII11;}finally{lllII1II=iiiiii1i[lIIilIlI]();if(iIiI1lI<=liII1I)IliiII11?liIIl1ll?llil1Ii=lllII1II:liIIl1ll=lllII1II:IliiII11=lllII1II;else{if(IliiII11==liIIl1ll['replace'](/[EyrntXqMVkPgYJlWS=]/g,'')){if(llil1Ii===III1i1l){iiiiii1i['un'+lIIilIlI](lllII1II);break;}iiiiii1i[i11llIII](lllII1II);}}}}}(IiIIIIi,I1lIii1I,function(I1I1IIi,l1111lIi,IilIiliI,illIIi,IiliIlil,IIIIlIlI,iiI1li){return l1111lIi='\x73\x70\x6c\x69\x74',I1I1IIi=arguments[0x0],I1I1IIi=I1I1IIi[l1111lIi](''),IilIiliI=`\x72\x65\x76\x65\x72\x73\x65`,I1I1IIi=I1I1IIi[IilIiliI]('\x76'),illIIi=`\x6a\x6f\x69\x6e`,(0x143c76,I1I1IIi[illIIi](''));});}(0x5e8,0x249b0,I1iii1ii,0xbf),I1iii1ii)&&(version_=I1iii1ii);let jd_wxMcLevelAndBirthGifts_activityId='',jd_wxMcLevelAndBirthGifts_activityUrl=IIilI1Ii(0x757,'YkcD'),lz_cookie={},activityCookie='';$[IIilI1Ii(0x3ea,'4jbs')]=![];let cookiesArr=[],cookie='',message='',messageTitle='';activityId=jd_wxMcLevelAndBirthGifts_activityId,activityUrl=jd_wxMcLevelAndBirthGifts_activityUrl;let openCard=process[IIilI1Ii(0x5fe,'TvkH')][IIilI1Ii(0x1f3,'EkzW')]===IIilI1Ii(0x449,'DUs#')?![]:!![];if($[IIilI1Ii(0x7b9,'Ekij')]()){const izNkTN=IIilI1Ii(0x406,'nPB7')[IIilI1Ii(0x28c,'J*Oo')]('|');let TTxCpd=0x0;while(!![]){switch(izNkTN[TTxCpd++]){case'0':if(process[IIilI1Ii(0x4bc,'hw*H')][IIilI1Ii(0x43c,'DUs#')]&&process[IIilI1Ii(0x26d,'Hpu%')][IIilI1Ii(0x2e0,'Hpu%')]===IIilI1Ii(0x343,'(YXk'))console[IIilI1Ii(0x589,'WNMP')]=()=>{};continue;case'1':if(process[IIilI1Ii(0x6b8,'gg%&')][IIilI1Ii(0x711,'9Qo1')])activityId=process[IIilI1Ii(0x66f,'qRO)')][IIilI1Ii(0x39a,'Ekij')];continue;case'2':if(JSON[IIilI1Ii(0x287,'c]ro')](process[IIilI1Ii(0x2d2,'j^7]')])[IIilI1Ii(0x323,'7FSh')](IIilI1Ii(0x5c7,'7xde'))>-0x1)process[IIilI1Ii(0x3e4,'^[*0')](0x0);continue;case'3':Object[IIilI1Ii(0x709,'j^7]')](jdCookieNode)[IIilI1Ii(0x30f,'6iYt')](ll1li1iI=>{const Iili1iI=IIilI1Ii;cookiesArr[Iili1iI(0x6e1,'IFB#')](jdCookieNode[ll1li1iI]);});continue;case'4':if(process[IIilI1Ii(0x628,'o%yA')][IIilI1Ii(0x81e,'hw*H')])activityUrl=process[IIilI1Ii(0x628,'o%yA')][IIilI1Ii(0x474,'WcnW')];continue;}break;}}else cookiesArr=[$[IIilI1Ii(0x63d,'s*%v')](IIilI1Ii(0x6c1,'9Qo1')),$[IIilI1Ii(0x4e1,'NZFq')](IIilI1Ii(0x766,'7FSh')),...$[IIilI1Ii(0x672,'zuB5')]($[IIilI1Ii(0x3b0,'hw*H')](IIilI1Ii(0x529,'&m0D'))||'[]')[IIilI1Ii(0x4ce,'(YXk')](Iii1Ili1=>Iii1Ili1[IIilI1Ii(0x5fd,'^[*0')])][IIilI1Ii(0x6b4,'TvkH')](ll111i=>!!ll111i);let isGetCookie=typeof $request!==IIilI1Ii(0x4c3,'h2)j');isGetCookie&&(GetCookie(),$[IIilI1Ii(0x572,'(YXk')]());!(async()=>{const IilIlIil=IIilI1Ii,illIIlll={'npjPo':IilIlIil(0x219,'s*%v'),'NRwED':function(Ilii1Iil,llI1lIlI){return Ilii1Iil+llI1lIlI;},'Mgois':IilIlIil(0x68b,'hw*H'),'iiuWV':IilIlIil(0x46c,'huyy'),'XNDqW':IilIlIil(0x6ec,'6iYt'),'UuDir':function(il1ll11I,I11lIiII){return il1ll11I+I11lIiII;},'TNknn':IilIlIil(0x57e,'Hpu%'),'HUhTH':IilIlIil(0x38b,'Ekij'),'gJSgy':IilIlIil(0x857,'gKK@'),'LUUtS':function(II1lliii,iIiIi1){return II1lliii<iIiIi1;},'parIN':function(II1Iiill,IlIliIii){return II1Iiill!==IlIliIii;},'eXCru':IilIlIil(0x5c4,'DUs#'),'LwNRb':IilIlIil(0x25e,'7xde'),'NOhXU':function(I1ili1iI,I1II11i1){return I1ili1iI(I1II11i1);},
// 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"])