KR/jd_lzkj_loreal_pointsExchan...

15 lines
60 KiB
JavaScript
Raw Normal View History

2023-10-16 10:51:57 +08:00
/*
活动名称积分兑换超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10079&templateId=<模板id>&activityId=<活动id>&prd=cjwx
环境变量jd_lzkj_loreal_pointsExchange_url // 活动链接
jd_lzkj_loreal_pointsExchange_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_pointsExchange_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_pointsExchange_break // 493后继续执行默认退出运行true/false
*/
const $ = new Env('积分兑换(超级无线)')
var version_='jsjiami.com.v7';function iIIIIII1(_0x16789e,_0x2a5755){const _0x1bbbbc=IilliII1();return iIIIIII1=function(_0x1317f8,_0x126c53){_0x1317f8=_0x1317f8-0x1bd;let _0xae6e36=_0x1bbbbc[_0x1317f8];if(iIIIIII1['ksGjUN']===undefined){var _0x487a97=function(_0x41aeb4){const _0x220558='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x299f77='',_0x55da71='';for(let _0x25ecb3=0x0,_0xb0d7d9,_0x73c0b9,_0x4ac0ab=0x0;_0x73c0b9=_0x41aeb4['charAt'](_0x4ac0ab++);~_0x73c0b9&&(_0xb0d7d9=_0x25ecb3%0x4?_0xb0d7d9*0x40+_0x73c0b9:_0x73c0b9,_0x25ecb3++%0x4)?_0x299f77+=String['fromCharCode'](0xff&_0xb0d7d9>>(-0x2*_0x25ecb3&0x6)):0x0){_0x73c0b9=_0x220558['indexOf'](_0x73c0b9);}for(let _0x982fb0=0x0,_0x3953f2=_0x299f77['length'];_0x982fb0<_0x3953f2;_0x982fb0++){_0x55da71+='%'+('00'+_0x299f77['charCodeAt'](_0x982fb0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x55da71);};const _0x1aa72b=function(_0x20d978,_0x2c3f50){let _0x2c2124=[],_0x3094c0=0x0,_0x3d208f,_0x19dfaf='';_0x20d978=_0x487a97(_0x20d978);let _0x2bfe15;for(_0x2bfe15=0x0;_0x2bfe15<0x100;_0x2bfe15++){_0x2c2124[_0x2bfe15]=_0x2bfe15;}for(_0x2bfe15=0x0;_0x2bfe15<0x100;_0x2bfe15++){_0x3094c0=(_0x3094c0+_0x2c2124[_0x2bfe15]+_0x2c3f50['charCodeAt'](_0x2bfe15%_0x2c3f50['length']))%0x100,_0x3d208f=_0x2c2124[_0x2bfe15],_0x2c2124[_0x2bfe15]=_0x2c2124[_0x3094c0],_0x2c2124[_0x3094c0]=_0x3d208f;}_0x2bfe15=0x0,_0x3094c0=0x0;for(let _0x7bd9ca=0x0;_0x7bd9ca<_0x20d978['length'];_0x7bd9ca++){_0x2bfe15=(_0x2bfe15+0x1)%0x100,_0x3094c0=(_0x3094c0+_0x2c2124[_0x2bfe15])%0x100,_0x3d208f=_0x2c2124[_0x2bfe15],_0x2c2124[_0x2bfe15]=_0x2c2124[_0x3094c0],_0x2c2124[_0x3094c0]=_0x3d208f,_0x19dfaf+=String['fromCharCode'](_0x20d978['charCodeAt'](_0x7bd9ca)^_0x2c2124[(_0x2c2124[_0x2bfe15]+_0x2c2124[_0x3094c0])%0x100]);}return _0x19dfaf;};iIIIIII1['GxWkcP']=_0x1aa72b,_0x16789e=arguments,iIIIIII1['ksGjUN']=!![];}const _0x5955af=_0x1bbbbc[0x0],_0x348a9c=_0x1317f8+_0x5955af,_0x455b40=_0x16789e[_0x348a9c];return!_0x455b40?(iIIIIII1['GczOkz']===undefined&&(iIIIIII1['GczOkz']=!![]),_0xae6e36=iIIIIII1['GxWkcP'](_0xae6e36,_0x126c53),_0x16789e[_0x348a9c]=_0xae6e36):_0xae6e36=_0x455b40,_0xae6e36;},iIIIIII1(_0x16789e,_0x2a5755);}const IilIlIiI=iIIIIII1;(function(Ii1il11i,iII11iI1,IllII1ii,ll11l,li11iI1,I1II1Il1,IIi11lIl){return Ii1il11i=Ii1il11i>>0x7,I1II1Il1='hs',IIi11lIl='hs',function(liiIIiIl,i111I1iI,ili1Iill,I1iIIIil,Ii1lli){const i1iliIil=iIIIIII1;I1iIIIil='tfi',I1II1Il1=I1iIIIil+I1II1Il1,Ii1lli='up',IIi11lIl+=Ii1lli,I1II1Il1=ili1Iill(I1II1Il1),IIi11lIl=ili1Iill(IIi11lIl),ili1Iill=0x0;const i1Iilil1=liiIIiIl();while(!![]&&--ll11l+i111I1iI){try{I1iIIIil=-parseInt(i1iliIil(0x240,'$!)^'))/0x1*(-parseInt(i1iliIil(0x455,'h0Qy'))/0x2)+parseInt(i1iliIil(0x2b1,'w4EM'))/0x3*(parseInt(i1iliIil(0x2ff,'$!)^'))/0x4)+parseInt(i1iliIil(0x1fd,'3py6'))/0x5+-parseInt(i1iliIil(0x3e4,'@*uj'))/0x6*(-parseInt(i1iliIil(0x39e,'y^2)'))/0x7)+parseInt(i1iliIil(0x40e,'lZP7'))/0x8+parseInt(i1iliIil(0x433,'(tTf'))/0x9*(parseInt(i1iliIil(0x1d2,'0)KT'))/0xa)+-parseInt(i1iliIil(0x1e6,'l%Pu'))/0xb;}catch(lliI1i){I1iIIIil=ili1Iill;}finally{Ii1lli=i1Iilil1[I1II1Il1]();if(Ii1il11i<=ll11l)ili1Iill?li11iI1?I1iIIIil=Ii1lli:li11iI1=Ii1lli:ili1Iill=Ii1lli;else{if(ili1Iill==li11iI1['replace'](/[CJfeTRMgkdxnYBFOrLWIP=]/g,'')){if(I1iIIIil===i111I1iI){i1Iilil1['un'+I1II1Il1](Ii1lli);break;}i1Iilil1[IIi11lIl](Ii1lli);}}}}}(IllII1ii,iII11iI1,function(l1lIIiI1,IlliIiIi,IliI1l1,i1illI1I,IIiilIl,lll1il1l,i11lIil1){return IlliIiIi='\x73\x70\x6c\x69\x74',l1lIIiI1=arguments[0x0],l1lIIiI1=l1lIIiI1[IlliIiIi](''),IliI1l1=`\x72\x65\x76\x65\x72\x73\x65`,l1lIIiI1=l1lIIiI1[IliI1l1]('\x76'),i1illI1I=`\x6a\x6f\x69\x6e`,(0x142c52,l1lIIiI1[i1illI1I](''));});}(0x6280,0xd6aec,IilliII1,0xc7),IilliII1)&&(version_=IilliII1);const llllIll1=require(IilIlIiI(0x36b,'l%Pu')),lIi11Il=require(IilIlIiI(0x3ee,'(tTf')),liiIi1lI=require('./function/sendJDNotify'),IiI1ll=require('./function/krgetToken'),{loreal_savePrize:II1illlI}=require(IilIlIiI(0x2d4,'br)P')),i1iilllI=process['env']['jd_lzkj_loreal_pointsExchange_url']||'',IIiiIi=process[IilIlIiI(0x44e,'
// 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"])