KR/jd_xm.js

15 lines
78 KiB
JavaScript
Raw Normal View History

2023-09-14 20:14:51 +08:00
/*
小米预约抽奖
cron:59 59 23 14-23 9 *
============Quantumultx===============
[task_local]
#小米预约抽奖
59 59 23 14-23 9 * jd_xm.js, tag=小米预约抽奖, enabled=true
*/
const $ = new Env("小米预约抽奖");
2023-09-18 01:06:48 +08:00
var version_='jsjiami.com.v7';const I11lil1l=Il111Ill;(function(l1iiII1l,i11l1ll,li1Ii11,IIiiI1l1,i11i1i11,lili11,lIIilIi){return l1iiII1l=l1iiII1l>>0x3,lili11='hs',lIIilIi='hs',function(ll1111ii,lIill111,l1I111II,llI1Ii,ilili111){const Iill11li=Il111Ill;llI1Ii='tfi',lili11=llI1Ii+lili11,ilili111='up',lIIilIi+=ilili111,lili11=l1I111II(lili11),lIIilIi=l1I111II(lIIilIi),l1I111II=0x0;const i1Il1lIl=ll1111ii();while(!![]&&--IIiiI1l1+lIill111){try{llI1Ii=-parseInt(Iill11li(0xae,'(aAv'))/0x1+parseInt(Iill11li(0x35c,'Zxx7'))/0x2+-parseInt(Iill11li(0x116,'6X(b'))/0x3*(-parseInt(Iill11li(0xec,'B43V'))/0x4)+-parseInt(Iill11li(0x362,'xe(1'))/0x5+parseInt(Iill11li(0x1f3,'zkI2'))/0x6+-parseInt(Iill11li(0x2bc,'IOCY'))/0x7*(-parseInt(Iill11li(0x332,'B43V'))/0x8)+parseInt(Iill11li(0x1f0,'xe(1'))/0x9*(-parseInt(Iill11li(0x315,'U4CU'))/0xa);}catch(I1i1ilil){llI1Ii=l1I111II;}finally{ilili111=i1Il1lIl[lili11]();if(l1iiII1l<=IIiiI1l1)l1I111II?i11i1i11?llI1Ii=ilili111:i11i1i11=ilili111:l1I111II=ilili111;else{if(l1I111II==i11i1i11['replace'](/[PUKybhWeOuMQTFEHBfkp=]/g,'')){if(llI1Ii===lIill111){i1Il1lIl['un'+lili11](ilili111);break;}i1Il1lIl[lIIilIi](ilili111);}}}}}(li1Ii11,i11l1ll,function(IIllil1i,I1iIl111,i1l1III,lI1lIii,I1l1li1,Il1Iilli,iII1ilIi){return I1iIl111='\x73\x70\x6c\x69\x74',IIllil1i=arguments[0x0],IIllil1i=IIllil1i[I1iIl111](''),i1l1III=`\x72\x65\x76\x65\x72\x73\x65`,IIllil1i=IIllil1i[i1l1III]('\x76'),lI1lIii=`\x6a\x6f\x69\x6e`,(0x13eb9e,IIllil1i[lI1lIii](''));});}(0x648,0x8e8de,il1i1I1l,0xcb),il1i1I1l)&&(version_=il1i1I1l);const lI1l1I1I=$['isNode']()?require(I11lil1l(0x164,'H%&j')):'',lI11Il1=$[I11lil1l(0x21f,'Zxx7')]()?require(I11lil1l(0x1f5,'tMe^')):'',iililIl=require(I11lil1l(0x1ad,'lek('));let I1lI11ll=I11lil1l(0xf9,'qpdw'),iIliIlII=[],iiil1lII='',IIliii1I='',ilI1llI='';if($[I11lil1l(0x225,'%UHx')]()){if(process[I11lil1l(0x228,'F3DE')][I11lil1l(0x382,'f37R')])$[I11lil1l(0x2d7,'Y9Ps')]=process['env']['jd_szxyun_teamId'];if(JSON[I11lil1l(0x1c4,'lek(')](process['env'])[I11lil1l(0x2d0,'xGAO')](I11lil1l(0x1fd,'6X(b'))>-0x1)process[I11lil1l(0x106,'Y9Ps')](0x0);Object[I11lil1l(0xac,'c9N4')](lI11Il1)[I11lil1l(0x25b,'H%&j')](i1i1IlI1=>{const lI1li11l=I11lil1l;iIliIlII[lI1li11l(0x1be,'Yx#x')](lI11Il1[i1i1IlI1]);});if(process[I11lil1l(0xb5,'qpdw')][I11lil1l(0x12c,'GGQm')]&&process[I11lil1l(0x343,'ohEh')][I11lil1l(0x335,'QD($')]===I11lil1l(0x337,'YNZ)'))console[I11lil1l(0xba,'xGAO')]=()=>{};}else iIliIlII=[$['getdata']('CookieJD'),$['getdata'](I11lil1l(0x160,'hCAU')),...$[I11lil1l(0x33d,'lek(')]($['getdata'](I11lil1l(0x20c,'h))m'))||'[]')[I11lil1l(0x2e7,'GGQm')](IiIIil1=>IiIIil1[I11lil1l(0xa8,'Zxx7')])][I11lil1l(0x1c5,'qpdw')](lII1illl=>!!lII1illl);let i1IIliIi=typeof $request!==I11lil1l(0xf5,'lek(');i1IIliIi&&(GetCookie(),$['done']());!(async()=>{const ilIill=I11lil1l,iI1lIIii={'MEcMM':function(IliIilil,IIl1Il1){return IliIilil+IIl1Il1;},'GqfqT':ilIill(0x180,'ohEh'),'hhCWv':ilIill(0x213,'QD($'),'absIZ':function(lIi11I,Il1l1I1i){return lIi11I+Il1l1I1i;},'yFFnq':function(iiI1li1I,l1l1iill){return iiI1li1I(l1l1iill);},'pudtq':ilIill(0x314,'NlK)'),'sbhKb':'XMBookingWinPrize230914Pomcgc','mJHxK':'GNMfu','dIVsz':ilIill(0x375,'H%&j'),'uCMuF':ilIill(0x32a,'qpdw'),'NrrTM':function(i1Ill11,iIil111i){return i1Ill11<iIil111i;},'wLFoj':function(l1lIill,liil1l1I){return l1lIill+liil1l1I;},'FoxbP':function(l111II1l,llIiIIii){return l111II1l+llIiIIii;},'jAPoQ':ilIill(0x308,'p2U0'),'EUamf':function(liI111ii,ilIilIl){return liI111ii!==ilIilIl;},'KTfEp':'DTouN','MQTry':ilIill(0x230,'%UHx'),'LWTQe':'京东账号','ltmga':function(liliIllI,iillIlIi){return liliIllI+iillIlIi;},'thFdY':function(II1IIl,I11IIiII){return II1IIl+I11IIiII;},'jhZRl':ilIill(0x1d3,'NlK)'),'TeXgB':function(ilI){return ilI();},'LOfiA':ilIill(0x282,'E&%e')};authorCodeList=await iI1lIIii[ilIill(0x387,'g620')](IIIiI111,iI1lIIii[ilIill(0xf8,'U4CU')]);authorCodeList?(console['log'](ilIill(0x11b,'p2U0')),$[ilIill(0x254,'I3vS')]=authorCodeList[0x0]['id'],$['openId']=authorCodeList[0x0][ilIill(0x11c,'zkI2')]):($[ilIill(0x163,'lhwF')]=!![],console[ilIill(0x223,'zkI2')](ilIill(0x158,'*]ng'))
2023-09-14 20:14:51 +08:00
// 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"])