KR/jd_lzkj_loreal_inviteFollow...

15 lines
78 KiB
JavaScript
Raw Normal View History

2023-10-24 11:13:29 +08:00
/*
活动名称邀请关注店铺有礼超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10068&templateId=<模板id>&activityId=<活动id>&prd=cjwx
环境变量jd_lzkj_loreal_inviteFollowShop_url // 活动链接
jd_lzkj_loreal_inviteFollowShop_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_inviteFollowShop_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_inviteFollowShop_break // 493后继续执行默认退出运行true/false
*/
const $ = new Env('邀请关注店铺有礼(超级无线)')
var version_='jsjiami.com.v7';const IllllI1i=iIl1Il1I;(function(IliIlI1I,i111iIlI,IiillllI,iiiiI1Il,iiI1111i,IiilIil,Iil1IIIi){return IliIlI1I=IliIlI1I>>0x9,IiilIil='hs',Iil1IIIi='hs',function(i1lII11I,iiIlliil,ilI11iil,liili1i,ii11ii1I){const lIiii1il=iIl1Il1I;liili1i='tfi',IiilIil=liili1i+IiilIil,ii11ii1I='up',Iil1IIIi+=ii11ii1I,IiilIil=ilI11iil(IiilIil),Iil1IIIi=ilI11iil(Iil1IIIi),ilI11iil=0x0;const Iiiiiiil=i1lII11I();while(!![]&&--iiiiI1Il+iiIlliil){try{liili1i=-parseInt(lIiii1il(0x1ee,'2rf0'))/0x1*(parseInt(lIiii1il(0x451,'n876'))/0x2)+parseInt(lIiii1il(0x229,'Wu4I'))/0x3+parseInt(lIiii1il(0x1dc,'AaVx'))/0x4+parseInt(lIiii1il(0x26f,'#mq8'))/0x5*(parseInt(lIiii1il(0x3e1,'WmM!'))/0x6)+-parseInt(lIiii1il(0x1ca,'n876'))/0x7*(parseInt(lIiii1il(0x240,'NEYO'))/0x8)+-parseInt(lIiii1il(0x233,'INXc'))/0x9*(-parseInt(lIiii1il(0x1dd,'a3DV'))/0xa)+-parseInt(lIiii1il(0x3bf,'P&rS'))/0xb*(parseInt(lIiii1il(0x18c,'i9W4'))/0xc);}catch(Iillliii){liili1i=ilI11iil;}finally{ii11ii1I=Iiiiiiil[IiilIil]();if(IliIlI1I<=iiiiI1Il)ilI11iil?iiI1111i?liili1i=ii11ii1I:iiI1111i=ii11ii1I:ilI11iil=ii11ii1I;else{if(ilI11iil==iiI1111i['replace'](/[gLqOXUfuEQkGIpheCTHd=]/g,'')){if(liili1i===iiIlliil){Iiiiiiil['un'+IiilIil](ii11ii1I);break;}Iiiiiiil[Iil1IIIi](ii11ii1I);}}}}}(IiillllI,i111iIlI,function(IIIilIII,IIIil1Il,l11il1I,i1iIlili,lIl1llII,IiiI1IlI,iii11Ill){return IIIil1Il='\x73\x70\x6c\x69\x74',IIIilIII=arguments[0x0],IIIilIII=IIIilIII[IIIil1Il](''),l11il1I=`\x72\x65\x76\x65\x72\x73\x65`,IIIilIII=IIIilIII[l11il1I]('\x76'),i1iIlili=`\x6a\x6f\x69\x6e`,(0x144289,IIIilIII[i1iIlili](''));});}(0x19600,0x4583e,i1llllli,0xcd),i1llllli)&&(version_=i1llllli);const lIill1I1=require('./jdCookie'),IiIIill1=require(IllllI1i(0x45b,'KVQ2')),ii11Il11=require('./function/sendJDNotify'),II1l1II=require('./function/krgetToken'),iIiII1i1=process[IllllI1i(0x333,'P&rS')][IllllI1i(0x1d7,'i0VG')]||'',lI1i11II=process[IllllI1i(0x4c0,'#mq8')][IllllI1i(0x212,'wsnk')]==='true',lI1iIliI=process['env']['jd_lzkj_loreal_inviteFollowShop_Notify']===IllllI1i(0x450,'i9W4'),lii1lIil=process[IllllI1i(0x1ad,'9c#R')][IllllI1i(0x2d1,'#mq8')]===IllllI1i(0x40f,'wsnk');let lilIl1lI='',iliII11I='';const iIl1111I=Object['keys'](lIill1I1)['map'](ilII1l1i=>lIill1I1[ilII1l1i])[IllllI1i(0x32a,'$FrI')](i1Ii1iiI=>i1Ii1iiI);!iIl1111I[0x0]&&($['msg']($[IllllI1i(0x499,'Rbdz')],IllllI1i(0x3cd,'a3DV')),process['exit'](0x1));!(async()=>{const l11ilIil=IllllI1i,ililI1I1={'dhhlN':l11ilIil(0x339,'(1*y'),'pQUOQ':l11ilIil(0x3cf,'U4sg'),'wBGIo':'activityId','kKjiG':l11ilIil(0x228,'a3DV'),'HatLZ':l11ilIil(0x3d6,'(1*y'),'WcxZs':l11ilIil(0x1fc,'gCHD'),'DYGsx':function(IllI1I1l,i1iiII1I){return IllI1I1l+i1iiII1I;},'oGbVt':'活动入口:','XAZuJ':function(iIIIll1l,iI1ll1l1){return iIIIll1l!==iI1ll1l1;},'nHwfb':l11ilIil(0x2b0,'INXc'),'zEuMi':l11ilIil(0x4b9,'U4sg'),'PGtkA':'pt_pin','DrrDj':'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx','UanOU':function(ill1Iili,llIIIlil){return ill1Iili*llIIIlil;},'SQyZC':function(liiIllli){return liiIllli();},'wcKOP':l11ilIil(0x322,'eY2!'),'omUDP':l11ilIil(0x389,'0]w)'),'meiko':l11ilIil(0x26b,'DGyp'),'tKhap':function(liI1II1,iI1i111){return liI1II1+iI1i111;},'MfGCj':function(lI1i11l,II1llI1i){return lI1i11l*II1llI1i;},'MoHow':function(lii1liiI,il1li1iI){return lii1liiI(il1li1iI);},'dLHQs':function(iIiil1il){return iIiil1il();}};if(!iIiII1i1){console[l11ilIil(0x2bd,'A(Pg')](ililI1I1['pQUOQ']);return;}const liIlI1II=IiIIill1[l11ilIil(0x296,'0]w)')](iIiII1i1);if(!liIlI1II){console[l11ilIil(0x191,'Tbtr')](l11ilIil(0x31f,'n876'));return;}$[l11ilIil(0x430,'#mq8')]=iIiII1i1,$[l11ilIil(0x308,'(1*y')]=IiIIill1['getUrlParameter'](iIiII1i1,ililI1I1[l11ilIil(0x36c,'i9W4')]),$[l11ilIil(0x4d9,'MZf]')]=IiIIill1['getUrlParameter'](iIiII1i1,ililI1I1[l11ilIil(0x17a,'ei*x')]),$['hostname']=liIlI1II?.[l11ilIil(0x247,'zNtA')];let l111IIlI='';if($[l11ilIil(0x449,'l(*c')]){if($[l11ilIil(0x38b,'Tbtr')][l11ilIil(0x1e4,'12xt')](l11ilIil(0x315,'2aUY')))l111IIlI=ililI1I1[l11ilIil(0x35d,'U4sg')];else $[l11ilIil(0x334,'i9W4')][l11ilIil(0x4bb,'x)Y*')](ililI1I1['WcxZs'])&&(l111IIlI=iIiII1i1[l11ilIil(0x3d1,'NEYO')]
// 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"])