mirror of https://github.com/KingRan/KR.git
27 lines
99 KiB
JavaScript
27 lines
99 KiB
JavaScript
|
/*
|
|||
|
集卡抽奖通用活动
|
|||
|
|
|||
|
第一个CK失效会退出脚本
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
|
|||
|
变量:
|
|||
|
//export jd_wxCollectCard_activityId="活动ID、链接均可"
|
|||
|
//export JD_LZ_OPEN="false" //关闭LZ相关活动运行
|
|||
|
//export jd_wxCollectCard_blacklist="" //黑名单 用&隔开 pin值
|
|||
|
活动网址:
|
|||
|
//https://lzkjdz-isv.isvjcloud.com/wxCollectCard/activity/activity?activityId=xxxxxxx
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#集卡抽奖通用活动
|
|||
|
1 1 1 1 * jd_wxCollectCard.js, tag=集卡抽奖通用活动, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('集卡抽奖通用活动')
|
|||
|
var version_='jsjiami.com.v7';const I11Ii1=iii1II;(function(illi11,li111l,l111lI,il1lil,I1iil,iiliii,I1iii){return illi11=illi11>>0x8,iiliii='hs',I1iii='hs',function(li111i,ll1ilI,I1ilI,iilii1,llilil){const l1liIi=iii1II;iilii1='tfi',iiliii=iilii1+iiliii,llilil='up',I1iii+=llilil,iiliii=I1ilI(iiliii),I1iii=I1ilI(I1iii),I1ilI=0x0;const il1lii=li111i();while(!![]&&--il1lil+ll1ilI){try{iilii1=-parseInt(l1liIi(0x3e5,'n#yI'))/0x1+parseInt(l1liIi(0xb9,'5mXY'))/0x2+-parseInt(l1liIi(0x2f2,'5[Ln'))/0x3+-parseInt(l1liIi(0x32b,'!rV$'))/0x4*(parseInt(l1liIi(0x3eb,'Bpw3'))/0x5)+parseInt(l1liIi(0x2c9,'EcG&'))/0x6+-parseInt(l1liIi(0x2cd,'j8j]'))/0x7+parseInt(l1liIi(0x2bf,'ivyD'))/0x8;}catch(illi1i){iilii1=I1ilI;}finally{llilil=il1lii[iiliii]();if(illi11<=il1lil)I1ilI?I1iil?iilii1=llilil:I1iil=llilil:I1ilI=llilil;else{if(I1ilI==I1iil['replace'](/[bYJMIeqhGdFlpTSVyK=]/g,'')){if(iilii1===ll1ilI){il1lii['un'+iiliii](llilil);break;}il1lii[I1iii](llilil);}}}}}(l111lI,li111l,function(lll1ll,illi1l,l1llI,llilii,lll1li,l1ii1l,l111ll){return illi1l='\x73\x70\x6c\x69\x74',lll1ll=arguments[0x0],lll1ll=lll1ll[illi1l](''),l1llI='\x72\x65\x76\x65\x72\x73\x65',lll1ll=lll1ll[l1llI]('\x76'),llilii='\x6a\x6f\x69\x6e',(0x13643a,lll1ll[llilii](''));});}(0xc500,0xc5f68,Iii11l,0xc7),Iii11l)&&(version_=Iii11l);const I1Ii=$[I11Ii1(0x10b,'IWV$')]()?require(I11Ii1(0x385,'EcG&')):'',I1Il=$[I11Ii1(0x258,'rSBj')]()?require(I11Ii1(0x352,'&1ej')):'',l1li1i=require(I11Ii1(0x20b,'46$j')),l1li1l=require(I11Ii1(0x324,'7JwJ')),il1Ill=require(I11Ii1(0x31e,'GvXH')),il1Ili=require('./function/krwxSavePrize');function iii1II(_0x3c8858,_0x287716){const _0x4a669f=Iii11l();return iii1II=function(_0x45c61d,_0x225e7e){_0x45c61d=_0x45c61d-0xb7;let _0xc54bda=_0x4a669f[_0x45c61d];if(iii1II['mKKgYc']===undefined){var _0x41b087=function(_0x5bf783){const _0x2a395b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1de325='',_0x55b47c='';for(let _0x341fd2=0x0,_0x5e7b26,_0x1c3021,_0x11fa5b=0x0;_0x1c3021=_0x5bf783['charAt'](_0x11fa5b++);~_0x1c3021&&(_0x5e7b26=_0x341fd2%0x4?_0x5e7b26*0x40+_0x1c3021:_0x1c3021,_0x341fd2++%0x4)?_0x1de325+=String['fromCharCode'](0xff&_0x5e7b26>>(-0x2*_0x341fd2&0x6)):0x0){_0x1c3021=_0x2a395b['indexOf'](_0x1c3021);}for(let _0x3e3189=0x0,_0x1863c0=_0x1de325['length'];_0x3e3189<_0x1863c0;_0x3e3189++){_0x55b47c+='%'+('00'+_0x1de325['charCodeAt'](_0x3e3189)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x55b47c);};const _0xd16a77=function(_0x2b2ecc,_0x12c26f){let _0x499170=[],_0x45043f=0x0,_0x36b59a,_0x291b42='';_0x2b2ecc=_0x41b087(_0x2b2ecc);let _0x5b1913;for(_0x5b1913=0x0;_0x5b1913<0x100;_0x5b1913++){_0x499170[_0x5b1913]=_0x5b1913;}for(_0x5b1913=0x0;_0x5b1913<0x100;_0x5b1913++){_0x45043f=(_0x45043f+_0x499170[_0x5b1913]+_0x12c26f['charCodeAt'](_0x5b1913%_0x12c26f['length']))%0x100,_0x36b59a=_0x499170[_0x5b1913],_0x499170[_0x5b1913]=_0x499170[_0x45043f],_0x499170[_0x45043f]=_0x36b59a;}_0x5b1913=0x0,_0x45043f=0x0;for(let _0x155e9d=0x0;_0x155e9d<_0x2b2ecc['length'];_0x155e9d++){_0x5b1913=(_0x5b1913+0x1)%0x100,_0x45043f=(_0x45043f+_0x499170[_0x5b1913])%0x100,_0x36b59a=_0x499170[_0x5b1913],_0x499170[_0x5b1913]=_0x499170[_0x45043f],_0x499170[_0x45043f]=_0x36b59a,_0x291b42+=String['fromCharCode'](_0x2b2ecc['charCodeAt'](_0x155e9d)^_0x499170[(_0x499170[_0x5b1913]+_0x499170[_0x45043f])%0x100]);}return _0x291b42;};iii1II['ZQvhIA']=_0xd16a77,_0x3c8858=arguments,iii1II['mKKgYc']=!![];}const _0x583987=_0x4a669f[0x0],_0x54ea04=_0x45c61d+_0x583987,_0xa3fc68=_0x3c8858[_0x54ea04];return!_0xa3fc68?(iii1II['jhcOMK']===undefined&&(iii1II['jhcOMK']=!![]),_0xc54bda=iii1II['ZQvhIA'](_0xc54bda,_0x225e7e),_0x3c8858[_0x54ea04]=_0xc54bda):_0xc54bda=_0xa3fc68,_0xc54bda;},iii1II(_0x3c8858,_0x287716);}let i1IlI1='https://lzkjdz-isv.isvjcloud.com',IIlIli=[],IIlIll='';if($[I11Ii1(0x285,'4HDi')]()){Object['keys'](I1Ii)['forEach'](i1IlIl=>{const l1liIl=I11Ii1;IIlIli[l1liIl(0x426,'(o^R')](I1Ii[i1IlIl]);});if(process['env'][I11Ii1(0x208,'Pt8o')]&&process['env'][I11Ii1(0x3b8,'ivyD')]===I11Ii1(0x4d8,'46$j'))console[I11Ii1(0x197,'&1ej')]=()=>{};}else IIlIli=[$['ge
|
|||
|
// 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"])
|