2023-07-28 10:29:22 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const iiilI1=iii1II;(function(lill,Ill1lI,Ii1lI1,IliliI,iliI1I,ii1iII,ll1111){return lill=lill>>0x2,ii1iII='hs',ll1111='hs',function(liIl11,i11IIl,IIl11I,i11IIi,Il1ii1){const l1Ill1=iii1II;i11IIi='tfi',ii1iII=i11IIi+ii1iII,Il1ii1='up',ll1111+=Il1ii1,ii1iII=IIl11I(ii1iII),ll1111=IIl11I(ll1111),IIl11I=0x0;const illII1=liIl11();while(!![]&&--IliliI+i11IIl){try{i11IIi=-parseInt(l1Ill1(0x141,'62T['))/0x1*(parseInt(l1Ill1(0x2fe,'sokK'))/0x2)+parseInt(l1Ill1(0x290,'k!cC'))/0x3+parseInt(l1Ill1(0x173,'ZUuB'))/0x4+parseInt(l1Ill1(0x16e,'cqAW'))/0x5+parseInt(l1Ill1(0x20c,'HOEy'))/0x6+parseInt(l1Ill1(0x380,'5LAB'))/0x7*(parseInt(l1Ill1(0x3e5,'(@FG'))/0x8)+-parseInt(l1Ill1(0x277,'0H7N'))/0x9*(parseInt(l1Ill1(0x252,'sokK'))/0xa);}catch(Il1iii){i11IIi=IIl11I;}finally{Il1ii1=illII1[ii1iII]();if(lill<=IliliI)IIl11I?iliI1I?i11IIi=Il1ii1:iliI1I=Il1ii1:IIl11I=Il1ii1;else{if(IIl11I==iliI1I['replace'](/[CTPeQNWDKpRykuntfHhrL=]/g,'')){if(i11IIi===i11IIl){illII1['un'+ii1iII](Il1ii1);break;}illII1[ll1111](Il1ii1);}}}}}(Ii1lI1,Ill1lI,function(iIiii,IIiIIl,Il1iil,iIiil,IIiIIi,lilI,ll111i){return IIiIIl='\x73\x70\x6c\x69\x74',iIiii=arguments[0x0],iIiii=iIiii[IIiIIl](''),Il1iil='\x72\x65\x76\x65\x72\x73\x65',iIiii=iIiii[Il1iil]('\x76'),iIiil='\x6a\x6f\x69\x6e',(0x1368b3,iIiii[iIiil](''));});}(0x324,0xed963,Iii11l,0xcb),Iii11l)&&(version_=Iii11l);const i11i1=$['isNode']()?require(iiilI1(0x3f5,'7r6m')):'',liIIi1=$[iiilI1(0x28e,'5LAB')]()?require(iiilI1(0x2e7,'$1@F')):'',I1liiI=require(iiilI1(0x3be,'&HG(')),l1I11l=require('./function/krh5st'),iIliii=require(iiilI1(0x20a,'IL(t'));let l1I11i={},iIlii1='',IIiil1='';$[iiilI1(0x2cc,'k!cC')]=![];let l1IlII=0x2,ii1i=![],ilIIl1=[],ii1l='',iIl1I='',liIi='';if($[iiilI1(0x3aa,'wYb6')]()){if(JSON['stringify'](process[iiilI1(0x353,'5rvX')])['indexOf'](iiilI1(0x34a,'EE#('))>-0x1)process['exit'](0x0);Object['keys'](liIIi1)['forEach'](IliIiI=>{ilIIl1['push'](liIIi1[IliIiI]);});if(process[iiilI1(0x1bc,'rr%@')]['JD_DEBUG']&&process[iiilI1(0x136,'3t$S')]['JD_DEBUG']==='false')console[iiilI1(0x1c5,'5LAB')]=()=>{};}else ilIIl1=[$['getdata']('CookieJD'),$[iiilI1(0x128,'4Tpz')](iiilI1(0x25f,'5rvX')),...$[iiilI1(0x39b,'U%KE')]($[iiilI1(0x394,'XkP3')]('CookiesJD')||'[]')['map'](liiiII=>liiiII['cookie'])]['filter'](IIiili=>!!IIiili);let liIIlI=typeof $request!==iiilI1(0x354,'1TrB');liIIlI&&(GetCookie(),$['done']());let IliIil=process['env'][iiilI1(0x3f6,']!]w')]?process[iiilI1(0x42c,'1TrB')]['jd_jinggeng_showFavoriteShop_activityUrl']:'';if(IliIil)activityId=liIIil(''+IliIil,'id'),venderId=liIIil(''+IliIil,iiilI1(0x2c6,'(@FG')),$[iiilI1(0x1d5,'t)jF')]=IliIil[iiilI1(0x17e,'sS)y')](/https?:\/\/([^/]+)/)[0x1];else{console['log']('请填写活动链接');return;}let iliiIi=iiilI1(0x216,'H2n(')+$[iiilI1(0x315,'(WB3')];!(async()=>{const ll111l=iiilI1,IIiiiI={'xeiza':function(i11IlI){return i11IlI();},'hHIug':'活动已结束','HmVNI':function(Ii1I1,i11Il1){return Ii1I1==i11Il1;},'BzchF':ll111l(0x175,'bwiE'),'dmyCy':function(IIIlli,illii1){return IIIlli+illii1;},'DIhKG':ll111l(0x2eb,'(idY'),'caVnx':'gzip,\x20deflate,\x20br','fYOpk':ll111l(0x31a,'H2n('),'mSmHD':ll111l(0x2d8,'0H7N'),'ErHag':function(Iii1i1,IIIlll){return Iii1i1==IIIlll;},'INyWF':function(llli1I,IlilI1){return llli1I(IlilI1);},'niOVC':function(iIIIi,Il1iII){return iIIIi===Il1iII;},'hhQaC':ll111l(0x2ec,'uxi1'),'WZCZp':ll111l(0x20f,'*5Qv'),'tNdWz':function(Iii1iI,lIi1lI){return Iii1iI+lIi1lI;},'bYSrT':function(IIiiil,iIIIl){return IIiiil!==iIIIl;},'OApfH':ll111l(0x203,'OzgH'),'dZpEY':ll111l(0x38f,'0qru'),'jEGUW':ll111l(0x371,'uxi1'),'SOfAK':ll111l(0x242,'#AO#'),'rwNTD':function(IIiiii,liIIll){return IIiiii!=liIIll;},'LCSRc':function(l1IlIi,l1IlIl){return l1IlIi*l1IlIl;},'afohY':ll111l(0x207,'qpop'),'jOLTc':ll111l(0x1eb,'$1@F'),'MAGqE':ll111l(0x3bb,'EE#('),'hFAGK':function(liIIli,illiiI){return liIIli<illiiI;},'Junib':function(liIl,llli11){return liIl===llli11;},'ONTSs':'JMmcy','YCtYW':ll111l(0x17c,'k!cC'),'dSugv':'VcuTl','JANfO':'WxLrD','uhSLC':ll111l(0x196,'5rvX'),'IrEOa':function(Ili11l,I1lill){return Ili11l<I1lill;},'oWMxR':'GtKtQ','vnMwW'
|
|
|
|
|
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"])
|