KR/jd_wxCartKoi.js

23 lines
88 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称购物车锦鲤 · 超级无线
活动链接https://lzkjdz-isv.isvjd.com/wxCartKoi/cartkoi/activity/activity?activityId=<活动id>
变量
//export jd_wxCartKoi_activityId="活动ID、链接均可"
//export JD_LZ_OPEN="false" //关闭LZ相关活动运行
//export jd_wxCartKoi_blacklist="" //黑名单 用&隔开 pin值
活动网址
//https://lzkjdz-isv.isvjcloud.com/wxCartKoi/cartkoi/activity?activityId=xxxxxxx
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#购物车锦鲤通用活动
1 1 1 1 * jd_wxCartKoi.js, tag=购物车锦鲤通用活动, enabled=true
*/
const $ = new Env('购物车锦鲤(超级无线)')
var version_='jsjiami.com.v7';const lIlIil=iii1II;(function(iiil,li1Iil,ill11,i1ii1l,iiIIil,iiIIii,i1liIi){return iiil=iiil>>0x4,iiIIii='hs',i1liIi='hs',function(i1liIl,IiIill,li1Iii,lIII1,llIi11){const Ili1li=iii1II;lIII1='tfi',iiIIii=lIII1+iiIIii,llIi11='up',i1liIi+=llIi11,iiIIii=li1Iii(iiIIii),i1liIi=li1Iii(i1liIi),li1Iii=0x0;const IIi11I=i1liIl();while(!![]&&--i1ii1l+IiIill){try{lIII1=parseInt(Ili1li(0x2d4,'XQ@g'))/0x1*(-parseInt(Ili1li(0x475,'RL&R'))/0x2)+parseInt(Ili1li(0x2d9,'Xx&A'))/0x3*(-parseInt(Ili1li(0x12e,'$4NP'))/0x4)+-parseInt(Ili1li(0x24c,'4eYd'))/0x5+parseInt(Ili1li(0x366,'Xx&A'))/0x6+parseInt(Ili1li(0x3d1,'G5pQ'))/0x7+parseInt(Ili1li(0x451,'suWB'))/0x8*(-parseInt(Ili1li(0x37f,'9c)i'))/0x9)+parseInt(Ili1li(0x359,'K18r'))/0xa;}catch(iiIIlI){lIII1=li1Iii;}finally{llIi11=IIi11I[iiIIii]();if(iiil<=i1ii1l)li1Iii?iiIIil?lIII1=llIi11:iiIIil=llIi11:li1Iii=llIi11;else{if(li1Iii==iiIIil['replace'](/[krVpWDqAxEYTyRhOStNFn=]/g,'')){if(lIII1===IiIill){IIi11I['un'+iiIIii](llIi11);break;}IIi11I[i1liIi](llIi11);}}}}}(ill11,li1Iil,function(IIl1II,iill,iiIIl1,llIi1I,lIlIii,li1Ili,I11lil){return iill='\x73\x70\x6c\x69\x74',IIl1II=arguments[0x0],IIl1II=IIl1II[iill](''),iiIIl1='\x72\x65\x76\x65\x72\x73\x65',IIl1II=IIl1II[iiIIl1]('\x76'),llIi1I='\x6a\x6f\x69\x6e',(0x136439,IIl1II[llIi1I](''));});}(0xc10,0x321bc,Iii11l,0xc3),Iii11l)&&(version_=Iii11l);const iII1l=$['isNode']()?require('./jdCookie'):'',ilI1il=$[lIlIil(0x2cb,')R(2')]()?require(lIlIil(0x1e6,'JYzu')):'',i11Il=require('./function/krgetToken'),i11Ii=require('./function/krh5st'),iII1I=require(lIlIil(0x28c,'G5pQ')),iilli1=require('./function/krwxSavePrize');let ilI1l1={},Iil1l=[],Iil1i='';if($['isNode']()){Object[lIlIil(0x26e,'$4NP')](iII1l)['forEach'](l1I1i=>{const I11lii=lIlIil;Iil1l[I11lii(0x1c9,'Kz7f')](iII1l[l1I1i]);});if(process[lIlIil(0x244,'o20C')]['JD_DEBUG']&&process[lIlIil(0x18d,'PRRp')][lIlIil(0x333,'IdDL')]===lIlIil(0x18e,'$4NP'))console[lIlIil(0x487,'LJof')]=()=>{};}else Iil1l=[$[lIlIil(0x103,'w9uE')](lIlIil(0x32e,'K18r')),$['getdata'](lIlIil(0x4bd,'4eYd')),...i1i1iI($['getdata'](lIlIil(0x4b5,')R(2'))||'[]')[lIlIil(0x2b7,'vp2@')](l1I1l=>l1I1l['cookie'])]['filter'](i11II=>!!i11II);allMessage='',message='',$[lIlIil(0x495,'Z4y2')]=![],$[lIlIil(0x3bb,'ulH*')]=![],$[lIlIil(0x126,'iOuq')]=![];let i1i1i1='',iiiIli='',IllIl=process[lIlIil(0x429,'u#*y')][lIlIil(0x19e,'0%A9')]?process[lIlIil(0x1df,'QN2p')]['jd_wxCartKoi_activityId']:'',IllIi=process[lIlIil(0x43c,'fhhV')][lIlIil(0x3e4,'IdDL')]?process[lIlIil(0x19c,'gZnl')][lIlIil(0x2e4,'YQbT')]:lIlIil(0x182,'4eYd'),IIli='',iII11='';function iii1II(_0x7bff8,_0xfea0be){const _0x2d148d=Iii11l();return iii1II=function(_0x3eba76,_0x5b9670){_0x3eba76=_0x3eba76-0xd7;let _0xe10a6c=_0x2d148d[_0x3eba76];if(iii1II['cqujOB']===undefined){var _0x42f6d6=function(_0x2b9906){const _0x5a1512='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x13c4ff='',_0x57397e='';for(let _0x45d7b5=0x0,_0x26cc57,_0x5ed8ab,_0x4a4534=0x0;_0x5ed8ab=_0x2b9906['charAt'](_0x4a4534++);~_0x5ed8ab&&(_0x26cc57=_0x45d7b5%0x4?_0x26cc57*0x40+_0x5ed8ab:_0x5ed8ab,_0x45d7b5++%0x4)?_0x13c4ff+=String['fromCharCode'](0xff&_0x26cc57>>(-0x2*_0x45d7b5&0x6)):0x0){_0x5ed8ab=_0x5a1512['indexOf'](_0x5ed8ab);}for(let _0x524435=0x0,_0x41cd59=_0x13c4ff['length'];_0x524435<_0x41cd59;_0x524435++){_0x57397e+='%'+('00'+_0x13c4ff['charCodeAt'](_0x524435)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x57397e);};const _0x15973b=function(_0x424c39,_0x4fcd72){let _0xd4bcc9=[],_0x2ce33a=0x0,_0x2b5591,_0x529e78='';_0x424c39=_0x42f6d6(_0x424c39);let _0x2473fc;for(_0x2473fc=0x0;_0x2473fc<0x100;_0x2473fc++){_0xd4bcc9[_0x2473fc]=_0x2473fc;}for(_0x2473fc=0x0;_0x2473fc<0x100;_0x2473fc++){_0x2ce33a=(_0x2ce33a+_0xd4bcc9[_0x2473fc]+_0x4fcd72['charCodeAt'](_0x2473fc%_0x4fcd72['length']))%0x100,_0x2b5591=_0xd4bcc9[_0x2473fc],_0xd4bcc9[_0x2473fc]=_0xd4bcc9[_0x2ce33a],_0xd4bcc9[_0x2ce33a]=_0x2b5591;}_0x2473fc=0x0,_0x2ce33a=0x0;for(let _0x4bb578=0x0;_0x4bb578<_0x424c39['length'];_0x4bb578++){_0x2473fc=(_0x2473fc+0x1)%0x100,_0x2ce33a=(_0x2ce33a+_0xd4bcc9[_0x247
// 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"])