KR/jd_pointExgHb.js

19 lines
99 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称积分兑换红包 · 超级会员
活动链接https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgHb?venderId=<店铺id>&giftId=<活动id>
环境变量
jd_pointExgHb_activityUrl // 活动链接
JD_CJ_OPEN // 是否开启CJ活动运行默认运行
jd_pointExgHb_blacklist // 黑名单 用&隔开 pin值
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#积分兑换红包
1 1 1 1 * jd_pointExgHb.js, tag=积分兑换红包, enabled=true
*/
const $ = new Env('积分兑换红包(超级会员)')
var version_='jsjiami.com.v7';const iII1l1=iii1II;(function(l1IIIi,i111i1,l1IlI,l1IIIl,IiliI1,Iiii11,l11I){return l1IIIi=l1IIIi>>0x9,Iiii11='hs',l11I='hs',function(llllli,iiiii1,IIill1,iIII,iI1I1){const iiIllI=iii1II;iIII='tfi',Iiii11=iIII+Iiii11,iI1I1='up',l11I+=iI1I1,Iiii11=IIill1(Iiii11),l11I=IIill1(l11I),IIill1=0x0;const Ii11iI=llllli();while(!![]&&--l1IIIl+iiiii1){try{iIII=-parseInt(iiIllI(0x2c3,'xmxU'))/0x1*(parseInt(iiIllI(0x608,'vp)U'))/0x2)+parseInt(iiIllI(0x5a4,'N5uH'))/0x3+-parseInt(iiIllI(0x5ce,'ycSq'))/0x4*(parseInt(iiIllI(0x236,'Jqc['))/0x5)+parseInt(iiIllI(0x42d,'XoLw'))/0x6*(parseInt(iiIllI(0x2e6,'([z^'))/0x7)+parseInt(iiIllI(0x2b3,'PG!m'))/0x8+parseInt(iiIllI(0x539,'683w'))/0x9*(parseInt(iiIllI(0x4cc,'iaEd'))/0xa)+-parseInt(iiIllI(0x276,'uNiF'))/0xb;}catch(IiliII){iIII=IIill1;}finally{iI1I1=Ii11iI[Iiii11]();if(l1IIIi<=l1IIIl)IIill1?IiliI1?iIII=iI1I1:IiliI1=iI1I1:IIill1=iI1I1;else{if(IIill1==IiliI1['replace'](/[OJFlHfrQMupGEyPkgn=]/g,'')){if(iIII===iiiii1){Ii11iI['un'+Iiii11](iI1I1);break;}Ii11iI[l11I](iI1I1);}}}}}(l1IlI,i111i1,function(Iiii1I,II1il1,I11111,l111,il11lI,lIll1I,li1II1){return II1il1='\x73\x70\x6c\x69\x74',Iiii1I=arguments[0x0],Iiii1I=Iiii1I[II1il1](''),I11111='\x72\x65\x76\x65\x72\x73\x65',Iiii1I=Iiii1I[I11111]('\x76'),l111='\x6a\x6f\x69\x6e',(0x136659,Iiii1I[l111](''));});}(0x18000,0x896c7,Iii11l,0xc2),Iii11l)&&(version_=Iii11l);const li11I1=$[iII1l1(0x565,'hJ#(')]()?require(iII1l1(0x5b2,'vp)U')):'',i1I111=$['isNode']()?require(iII1l1(0x203,'fhJQ')):'',l1li11=require(iII1l1(0x606,'N1$^')),il1Il1=require('./function/krgetua');let li11II={},Ii1li='',iIiIli=[],iIllI='',iIiIl1='',i1I11I='',Ii1lli=process[iII1l1(0x292,'dD%a')]['jd_pointExgHb_activityUrl']?process[iII1l1(0x507,'d^SE')][iII1l1(0x3a4,'Rn(1')]:'';if($[iII1l1(0x37d,'fyIu')]()){if(JSON['stringify'](process[iII1l1(0x4e5,'b$96')])[iII1l1(0x4a7,'tv2T')](iII1l1(0x29b,'fhJQ'))>-0x1)process[iII1l1(0x29a,'n9gs')](0x0);Object[iII1l1(0x2a4,'s4$6')](i1I111)[iII1l1(0x3d2,'2h1r')](lI1I=>{iIiIli['push'](i1I111[lI1I]);});if(process['env']['JD_DEBUG']&&process['env'][iII1l1(0x2f0,'8vBu')]===iII1l1(0x34f,'2h1r'))console[iII1l1(0x5e9,'mJ]Z')]=()=>{};}else iIiIli=[$[iII1l1(0x52d,'8vBu')](iII1l1(0x296,'Rn(1')),$[iII1l1(0x345,'N1$^')](iII1l1(0x4ed,'K#CM')),...$[iII1l1(0x26d,'b$96')]($[iII1l1(0x609,'XoLw')](iII1l1(0x4a9,'mJ]Z'))||'[]')['map'](I1Ii=>I1Ii[iII1l1(0x351,'fyIu')])][iII1l1(0x551,'vp)U')](I1Il=>!!I1Il);let Ii1lll=process[iII1l1(0x3b2,'i8dv')]['JD_LZ_OPEN']?process[iII1l1(0x370,'hyB$')]['JD_LZ_OPEN']:iII1l1(0x283,'xmxU'),I1IIII=process['env'][iII1l1(0x525,'8vBu')]?process[iII1l1(0x4cd,'KT@E')][iII1l1(0x4c0,'fyIu')]:'true',I1I1='',Ii1lI='';$[iII1l1(0x5c2,'mJ]Z')]=process[iII1l1(0x217,'XoLw')][iII1l1(0x2fa,'s4$6')]||I1I1,$[iII1l1(0x24f,'XoLw')]=process['env'][iII1l1(0x1e5,'YP0s')]||Ii1lI,liII1I(),l11li1();function Iii11l(){const li1l11=(function(){return[version_,'fJjsOujGPiamMinpk.GyucyyQoFHmgyy.v7rEFlE==','WR/dKwFdJZS2','WOGPW5KaW6VcKq','uCkKrdJdKG','W4RcSCk/WOddNG','AXKaCmkx','WQNcJSk4WQ/cRa','c8o0WOCDyW','WRG6W7tdIGC','saNdQMNdNG','W5OxiCo7W4tdSmoIWR87umo5W7TeW4NcM3jh','y8o2F8oppW','WRrPWOWWjbjQ','C8ozACoraa','WQhdIN7dKW','vrW0DG','W6lcLZVdSSkprG','imkBvZFcHW','h3y4W6roW4rOW6m4W6FcV8kjW7dcL8kUxaPiWQ5sWQJcQr5TdCoKxZZdUmoOW6NcOelcKJ/dGSo/W5PHWOfMxxO8lLm9','v8oDegddLW','WPCKWRChWRehjt9rWQq','fYtcKCowWQG','WQaAWRFcQqq','WPqnCLZdJG','WONcSCkaW7aN','mHHgW4ZdQW','pLD+W6tdLa','WQldGMZdHLu3WQ/dOW','WRCsWPCMWPGTdHnlWOxdIG','vmo5lx/cM1BcLftcSmkt','WQ5PWP4Hlrq','W4tdVWHxW4e','mUkAU++6QYhLTylLSP/ORy/LPiFMRP7VVAhMNBVOG4RLH6JMJk/NUiRLJim','u8kJwXNdHq','ltb3W43dKq','x8ocFZj/','W4pcGqpdHN4','WP5OWRS','pMDBWOJdN8kotgOmW6n7BuyCWQCKsaOUW7Lh','Ehe9W55z','WPRcLSkTW6ef','pw97qtOgAw5PDvS','W5pdHmosWRaUWRFcJKVdM2RdOt3cVmkvwSk1DmoTWPy8WQNcSeahWOnxv1BdNSo/iCoIC0/cLeJdSuhcQConheuJW4DzjSooWQ/dOCkAu8k5ka','zSoLFSoboSkUn1rkhCoG','vhqGW65d','W7ddKSkgW4JcLSkyW6q','mcJdMCo6WQe','W40ciCoLWPZdOq','BttcQZJdRG','WQpcJCkWsr7cKmoBCL8jtgmFW4Wfi34','bCkLCsJcVa','w18NoLm','W7FcPCoTg2K','WPddHSow','WOnLWRtcM3KEWQz9jCkP','WOGeB3RdThm','W5JcPbJdMeBdK8k3W4tdQxVcVW','WPefCNhdSIpcVuJcOCk9Ec
// 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"])