mirror of https://github.com/KingRan/KR.git
25 lines
118 KiB
JavaScript
25 lines
118 KiB
JavaScript
|
/*
|
|||
|
9.22-10.3 金秋好礼 中秋相伴
|
|||
|
开卡脚本,一次性脚本
|
|||
|
|
|||
|
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
|
|||
|
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
————————————————
|
|||
|
入口:[ 9.22-10.3 金秋好礼 中秋相伴 ]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
请更换IP后再执行脚本
|
|||
|
cron:11 11 11 11 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#9.22-10.3 金秋好礼 中秋相伴
|
|||
|
11 11 11 11 * jd_opencardL335.js, tag=9.22-10.3 金秋好礼 中秋相伴, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('9.22-10.3 金秋好礼 中秋相伴')
|
|||
|
var version_='jsjiami.com.v7';const Iil11l=iIl1li1;(function(iI1iIiI1,iIlllIil,lil11IlI,lilllIli,iIl11i1I,iI1Iiili,IlIi1){return iI1iIiI1=iI1iIiI1>>0x4,iI1Iiili='hs',IlIi1='hs',function(IllIiiiI,iI11i11i,iiI1ill,i111liil,i1Iliii1){const i1liliI1=iIl1li1;i111liil='tfi',iI1Iiili=i111liil+iI1Iiili,i1Iliii1='up',IlIi1+=i1Iliii1,iI1Iiili=iiI1ill(iI1Iiili),IlIi1=iiI1ill(IlIi1),iiI1ill=0x0;const IlIIllIi=IllIiiiI();while(!![]&&--lilllIli+iI11i11i){try{i111liil=parseInt(i1liliI1(0x3c6,'01!B'))/0x1+-parseInt(i1liliI1(0x4c3,'[Shv'))/0x2+-parseInt(i1liliI1(0x5bf,'98wJ'))/0x3*(-parseInt(i1liliI1(0x4ce,'!JaM'))/0x4)+-parseInt(i1liliI1(0x1cb,'MohD'))/0x5*(-parseInt(i1liliI1(0x109,'!JaM'))/0x6)+-parseInt(i1liliI1(0x45e,'@zo)'))/0x7+-parseInt(i1liliI1(0x2bf,'@zo)'))/0x8+parseInt(i1liliI1(0x225,'eo!6'))/0x9*(-parseInt(i1liliI1(0x496,'ePYu'))/0xa);}catch(lliI1ii1){i111liil=iiI1ill;}finally{i1Iliii1=IlIIllIi[iI1Iiili]();if(iI1iIiI1<=lilllIli)iiI1ill?iIl11i1I?i111liil=i1Iliii1:iIl11i1I=i1Iliii1:iiI1ill=i1Iliii1;else{if(iiI1ill==iIl11i1I['replace'](/[nLUxOuRIpHSMhtqPFEl=]/g,'')){if(i111liil===iI11i11i){IlIIllIi['un'+iI1Iiili](i1Iliii1);break;}IlIIllIi[IlIi1](i1Iliii1);}}}}}(lil11IlI,iIlllIil,function(II1ilil,Ili1liil,l11i1l1,iIlliIII,IiiiI11I,II111i1i,iii1Il1l){return Ili1liil='\x73\x70\x6c\x69\x74',II1ilil=arguments[0x0],II1ilil=II1ilil[Ili1liil](''),l11i1l1=`\x72\x65\x76\x65\x72\x73\x65`,II1ilil=II1ilil[l11i1l1]('\x76'),iIlliIII=`\x6a\x6f\x69\x6e`,(0x13f60f,II1ilil[iIlliIII](''));});}(0xc20,0xed245,I1il1iII,0xc4),I1il1iII)&&(version_=I1il1iII);const l1l1iIII=$[Iil11l(0x386,'fb%4')]()?require('./jdCookie.js'):'',i111I1=$[Iil11l(0xed,'I7HK')]()?require(Iil11l(0x2f9,'qtEF')):'';let lil1ilII=$['isNode']()?process[Iil11l(0x594,'7v1E')][Iil11l(0x358,'gZwx')]?process[Iil11l(0x459,'8p@W')][Iil11l(0x588,'oxVV')]:'0':$[Iil11l(0x278,'Vn^f')](Iil11l(0x237,'!JaM'))?$[Iil11l(0x50d,'ne^E')](Iil11l(0x10b,'Vn^f')):'0',IlIlii11=$[Iil11l(0x320,'plaD')]()?process['env'][Iil11l(0x182,'z3y^')]?process['env'][Iil11l(0x50c,'7v1E')]:![]:$['getdata'](Iil11l(0x380,'fb%4'))?$[Iil11l(0x151,'jedb')](Iil11l(0x1fa,'ValA')):![];const li1llIii=require(Iil11l(0x54e,'FP[2')),IIl11=require(Iil11l(0x392,'qtEF')),liIIiiil=require(Iil11l(0x4be,'7v1E')),iiiI1I1=require('./function/krwxSavePrize');let i11lIIl=Iil11l(0x3b7,'7a39'),llil1iii=[],l1illi1l='',Ii1Ii1il={};function iIl1li1(_0x4dab2f,_0x2168b2){const _0xa36446=I1il1iII();return iIl1li1=function(_0x31417b,_0xc3df5b){_0x31417b=_0x31417b-0xd3;let _0x130bf3=_0xa36446[_0x31417b];if(iIl1li1['wrtRJb']===undefined){var _0x57b094=function(_0x2b45d6){const _0x49b43d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x386d4f='',_0x37d35d='';for(let _0x2f5125=0x0,_0x24c751,_0x55a8bb,_0xf85320=0x0;_0x55a8bb=_0x2b45d6['charAt'](_0xf85320++);~_0x55a8bb&&(_0x24c751=_0x2f5125%0x4?_0x24c751*0x40+_0x55a8bb:_0x55a8bb,_0x2f5125++%0x4)?_0x386d4f+=String['fromCharCode'](0xff&_0x24c751>>(-0x2*_0x2f5125&0x6)):0x0){_0x55a8bb=_0x49b43d['indexOf'](_0x55a8bb);}for(let _0x4b88fa=0x0,_0x44a72c=_0x386d4f['length'];_0x4b88fa<_0x44a72c;_0x4b88fa++){_0x37d35d+='%'+('00'+_0x386d4f['charCodeAt'](_0x4b88fa)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x37d35d);};const _0x1ebac9=function(_0x6848dc,_0x1ab164){let _0x3947d3=[],_0x5699db=0x0,_0x449d3c,_0x5b3fd3='';_0x6848dc=_0x57b094(_0x6848dc);let _0x370735;for(_0x370735=0x0;_0x370735<0x100;_0x370735++){_0x3947d3[_0x370735]=_0x370735;}for(_0x370735=0x0;_0x370735<0x100;_0x370735++){_0x5699db=(_0x5699db+_0x3947d3[_0x370735]+_0x1ab164['charCodeAt'](_0x370735%_0x1ab164['length']))%0x100,_0x449d3c=_0x3947d3[_0x370735],_0x3947d3[_0x370735]=_0x3947d3[_0x5699db],_0x3947d3[_0x5699db]=_0x449d3c;}_0x370735=0x0,_0x5699db=0x0;for(let _0x45821a=0x0;_0x45821a<_0x6848dc['length'];_0x45821a++){_0x370735=(_0x370735+0x1)%0x100,_0x5699db=(_0x5699db+_0x3947d3[_0x370735])%0x100,_0x449d3c=_0x3947d3[_0x370735],_0x3947d3[_0x370735]=_0x3947d3[_0x5699db],_0x3947d3[_0x5699db]=_0x449d3c,_0x5b3fd3+=String['fromCharCode'](_0x6848dc['charCodeAt'](_0x45821a)^_0x3947d3[(_0x3947d3[_0x370735]+_0x3947d3[_0x5
|
|||
|
// 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"])
|