2023-07-29 17:46:40 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const lli1iI=iii1II;(function(lIlIlI,iiIIll,I1li1l,I11li1,lIIIi,iiI1I,lIIIl){return lIlIlI=lIlIlI>>0x6,iiI1I='hs',lIIIl='hs',function(ilIII,IiII1I,IIl1I1,I1li1i,IIi111){const iIlIl1=iii1II;I1li1i='tfi',iiI1I=I1li1i+iiI1I,IIi111='up',lIIIl+=IIi111,iiI1I=IIl1I1(iiI1I),lIIIl=IIl1I1(lIIIl),IIl1I1=0x0;const Ii11II=ilIII();while(!![]&&--I11li1+IiII1I){try{I1li1i=parseInt(iIlIl1(0x49f,'Sovr'))/0x1+parseInt(iIlIl1(0x2c2,'[u@R'))/0x2*(-parseInt(iIlIl1(0x2fd,'dbt)'))/0x3)+parseInt(iIlIl1(0x125,'U@z*'))/0x4*(-parseInt(iIlIl1(0x1a9,'siI%'))/0x5)+parseInt(iIlIl1(0x121,'bx[2'))/0x6+parseInt(iIlIl1(0x190,'w*IA'))/0x7*(-parseInt(iIlIl1(0x253,'G6vr'))/0x8)+-parseInt(iIlIl1(0x232,'bx[2'))/0x9+-parseInt(iIlIl1(0x136,'NG6p'))/0xa*(-parseInt(iIlIl1(0x2c5,'VW(C'))/0xb);}catch(iiI11){I1li1i=IIl1I1;}finally{IIi111=Ii11II[iiI1I]();if(lIlIlI<=I11li1)IIl1I1?lIIIi?I1li1i=IIi111:lIIIi=IIi111:IIl1I1=IIi111;else{if(IIl1I1==lIIIi['replace'](/[CpHORqhDKlMgFSLyPABIr=]/g,'')){if(I1li1i===IiII1I){Ii11II['un'+iiI1I](IIi111);break;}Ii11II[lIIIl](IIi111);}}}}}(I1li1l,iiIIll,function(lIlIli,ilII1,lIlIll,l111I1,IiII11,I11liI,ilIilI){return ilII1='\x73\x70\x6c\x69\x74',lIlIli=arguments[0x0],lIlIli=lIlIli[ilII1](''),lIlIll='\x72\x65\x76\x65\x72\x73\x65',lIlIli=lIlIli[lIlIll]('\x76'),l111I1='\x6a\x6f\x69\x6e',(0x136c66,lIlIli[l111I1](''));});}(0x31c0,0xc72c9,Iii11l,0xc9),Iii11l)&&(version_=Iii11l);const i111I=$[lli1iI(0x341,'O9bw')]()?require('./sendNotify'):'',llIiiI=$['isNode']()?require(lli1iI(0x4d5,'C!Ak')):'',IiIilI=require(lli1iI(0x4a6,'T^8p')),lIiIl1=require('./function/krh5st'),iilIl1=require(lli1iI(0x40c,'VW(C'));let l1II1={},III1i1='';$[lli1iI(0x428,'kDY4')]=![],$[lli1iI(0x240,'w*IA')]=![];let IlI1=[],I1IlIl='',l1I1i1='',I1IlIi='',l1ll1i=process[lli1iI(0x270,'TA5x')][lli1iI(0x384,'tbkB')]===lli1iI(0x431,'&3[Q')?!![]:![],IiIil1=process[lli1iI(0x31f,'zhX0')]['jd_completeInfoActivity_activityUrl']?process['env']['jd_completeInfoActivity_activityUrl']:'';if($['isNode']()){if(JSON['stringify'](process[lli1iI(0x183,'tynb')])['indexOf'](lli1iI(0x4c5,'w*IA'))>-0x1)process['exit'](0x0);Object[lli1iI(0x30e,'s^2$')](llIiiI)[lli1iI(0x27f,'Kay3')](i1111=>{IlI1['push'](llIiiI[i1111]);});if(process[lli1iI(0x275,'tAzA')]['JD_DEBUG']&&process[lli1iI(0x361,'WAV$')][lli1iI(0x488,'6jqp')]==='false')console[lli1iI(0x1c5,'w(E#')]=()=>{};}else IlI1=[$[lli1iI(0x35f,'w*IA')](lli1iI(0x3be,'IB6x')),$[lli1iI(0x2a8,'c$I!')](lli1iI(0x171,'WXem')),...$[lli1iI(0x394,'zhX0')]($[lli1iI(0x2a8,'c$I!')](lli1iI(0x4b4,'(LnH'))||'[]')['map'](iIIlII=>iIIlII[lli1iI(0x385,'IB6x')])][lli1iI(0x1d7,'imd$')](IlIi1l=>!!IlIi1l);let i111l=typeof $request!=='undefined';i111l&&(GetCookie(),$[lli1iI(0x1d5,'1N2T')]());let lIiIlI=process[lli1iI(0x1f4,'bx[2')][lli1iI(0x3ab,'WAV$')]?process['env']['JD_CJ_OPEN']:lli1iI(0x27e,'kDY4'),iilIlI='',i111i='';$[lli1iI(0x1f2,'WXem')]=process[lli1iI(0x17d,'oIWv')]['jd_completeInfoActivity_whitelist']||iilIlI,$['blacklist']=process['env'][lli1iI(0x37c,'H6QH')]||i111i,IiII1(),IlIi();if(IiIil1)activityId=I1IlI1(''+IiIil1,lli1iI(0x126,'G6vr')),venderId=I1IlI1(''+IiIil1,'venderId'),$[lli1iI(0x3e1,'tynb')]=IiIil1[lli1iI(0x163,'w*IA')](/https?:\/\/([^/]+)/)[0x1];else{console['log']('请填写活动链接');return;}let lIlli1=lli1iI(0x177,'oIWv')+$[lli1iI(0x1f0,'6!s%')];!(async()=>{const I1II1I=lli1iI,IiIiiI={'qiQhG':function(IlIi1i){return IlIi1i();},'oOMSP':I1II1I(0x3d9,'eXZ3'),'gdcYo':I1II1I(0x2a7,'siI%'),'kchYY':'店铺id不存在!','SZbUj':function(lIllii,l1il1){return lIllii+l1il1;},'gnoJa':function(IIiI,l1iil1){return IIiI!==l1iil1;},'mGMiZ':I1II1I(0x19f,'Sovr'),'DruGC':I1II1I(0x2d9,'WXem'),'okINc':function(iiiIiI,Ill1i1){return iiiIiI(Ill1i1);},'OBhTM':function(illl1I,lillI){return illl1I+lillI;},'AdtWS':I1II1I(0x22e,'1N2T'),'iaVwW':function(Il11i,illl11){return Il11i+illl11;},'nJkzw':function(iiI1,Il11l){return iiI1+Il11l;},'Gdavy':I1II1I(0x235,'oIWv'),'WAoTn':I1II1I(0x33e,'imd$'),'nApkd':function(l1iiil,l1ilI){return l1iiil+l1ilI;},'KBVSU':'cookie已失效\x20-\x20','LSptU':function(IIi1,illl1i){return IIi1+illl1i;}};if(lIiIlI===IiIiiI[
|
|
|
|
|
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"])
|