2023-07-28 10:29:22 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const Ii1li1=iii1II;(function(liIill,lli1li,ll1I,Ii1lii,lii11,liIili,Ii1lil){return liIill=liIill>>0x4,liIili='hs',Ii1lil='hs',function(ll11,lliI1,iiI11l,iiI11i,Il1II1){const liIilI=iii1II;iiI11i='tfi',liIili=iiI11i+liIili,Il1II1='up',Ii1lil+=Il1II1,liIili=iiI11l(liIili),Ii1lil=iiI11l(Ii1lil),iiI11l=0x0;const iiilI=ll11();while(!![]&&--Ii1lii+lliI1){try{iiI11i=-parseInt(liIilI(0x350,'(Q#e'))/0x1*(parseInt(liIilI(0x5d6,'(Q#e'))/0x2)+parseInt(liIilI(0x3b9,'e77K'))/0x3*(parseInt(liIilI(0x406,'9k)C'))/0x4)+parseInt(liIilI(0x4e0,'cXZC'))/0x5*(parseInt(liIilI(0x38e,'1!JN'))/0x6)+parseInt(liIilI(0x4f4,']yip'))/0x7+-parseInt(liIilI(0x327,'%(kh'))/0x8+-parseInt(liIilI(0x430,'ympf'))/0x9+parseInt(liIilI(0x34c,'Eo]D'))/0xa;}catch(Il1IIi){iiI11i=iiI11l;}finally{Il1II1=iiilI[liIili]();if(liIill<=Ii1lii)iiI11l?lii11?iiI11i=Il1II1:lii11=Il1II1:iiI11l=Il1II1;else{if(iiI11l==lii11['replace'](/[BlJHLgWIxkwyUFGQqhYMT=]/g,'')){if(iiI11i===lliI1){iiilI['un'+liIili](Il1II1);break;}iiilI[Ii1lil](Il1II1);}}}}}(ll1I,lli1li,function(IIiIl1,ilII11,l11ii,Il1IIl,l11il,lli1lI,Ii1liI){return ilII11='\x73\x70\x6c\x69\x74',IIiIl1=arguments[0x0],IIiIl1=IIiIl1[ilII11](''),l11ii='\x72\x65\x76\x65\x72\x73\x65',IIiIl1=IIiIl1[l11ii]('\x76'),Il1IIl='\x6a\x6f\x69\x6e',(0x1368b9,IIiIl1[Il1IIl](''));});}(0xbc0,0x1fca1,Iii11l,0xbe),Iii11l)&&(version_=Iii11l);const Il111=$[Ii1li1(0x4bb,'3yHo')]()?require(Ii1li1(0x208,'WAIl')):'',lIiIli=$[Ii1li1(0x5e6,'cjoC')]()?require(Ii1li1(0x206,'13bR')):'',IiIII=require('./function/krgetToken'),IiIiii=require('./function/krh5st'),lIiIll=require(Ii1li1(0x2ad,'lMxy')),lIlliI=require(Ii1li1(0x533,'glnK')),{JSDOM:iIIlI1}=lIlliI;let IiIiil={},IlIi='';$['activityEnd']=![],$['maxHelpTimes']=0x0,$[Ii1li1(0x437,'gh&h')]=[],$['helpEnd']=![],$[Ii1li1(0x298,'NZZf')]=0x0,$['isGetAward']=![];let IlIl=[],IiII1='',l1IIi='',l1IIl='';if($[Ii1li1(0x5b2,'%yg[')]()){if(JSON[Ii1li1(0x4cd,'e77K')](process[Ii1li1(0x34e,'(@Xt')])[Ii1li1(0x612,'Z920')](Ii1li1(0x36a,'Ckd6'))>-0x1)process['exit'](0x0);Object[Ii1li1(0x2d3,'wTxz')](lIiIli)[Ii1li1(0x583,'1!JN')](IIi1=>{const iiil1=Ii1li1;IlIl[iiil1(0x358,'e77K')](lIiIli[IIi1]);});if(process[Ii1li1(0x45f,'gh&h')][Ii1li1(0x493,'e77K')]&&process[Ii1li1(0x5b4,'WAIl')][Ii1li1(0x214,'gh&h')]==='false')console[Ii1li1(0x234,'e77K')]=()=>{};}else IlIl=[$['getdata'](Ii1li1(0x4e4,'t8%]')),$['getdata'](Ii1li1(0x308,')S8m')),...$['toObj']($[Ii1li1(0x47e,'dUj9')](Ii1li1(0x316,'lMxy'))||'[]')['map'](illl1i=>illl1i['cookie'])]['filter'](l1iiii=>!!l1iiii);let l1I1il=process[Ii1li1(0x3b5,'kDfi')][Ii1li1(0x1dc,']4Yn')]?process[Ii1li1(0x40b,'gqVs')][Ii1li1(0x270,'e77K')]:'';if(l1I1il)activityId=illl11(''+l1I1il,'id'),venderId=illl11(''+l1I1il,Ii1li1(0x1f9,'pAU(')),$[Ii1li1(0x2c3,'dUj9')]=l1I1il[Ii1li1(0x564,'%yg[')](/https?:\/\/([^/]+)/)[0x1];else{console['log']('请填写活动链接');return;}let III1ii=Ii1li1(0x5ec,'1!JN')+$[Ii1li1(0x5c9,'%(kh')],l1I1ii=typeof $request!==Ii1li1(0x3cb,'9k)C');l1I1ii&&(GetCookie(),$[Ii1li1(0x47c,'mY!7')]());!(async()=>{const liIil1=Ii1li1,iiiIi1={'XpsHr':function(Il11I,li1lll){return Il11I!=li1lll;},'xqxPd':'随机抽取到的收货地址信息格式存在错误(参数不足或过多)','RXOkQ':function(lill1,IiIIl){return lill1<IiIIl;},'qxqgq':function(IiIIi,li1lli){return IiIIi==li1lli;},'rDSzj':liIil1(0x38d,')S8m'),'yxLMc':function(iiiIl1,I1i1I){return iiiIl1+I1i1I;},'smHFb':liIil1(0x1cb,'To8s'),'MUtPm':liIil1(0x41f,'5XL^'),'QtiFs':function(IIl1,l1ili){return IIl1+l1ili;},'tUnJO':function(i1Ii11,l1iill){return i1Ii11+l1iill;},'nClza':function(l1ill,lIi1I1){return l1ill+lIi1I1;},'JCCmr':liIil1(0x45a,'8m44'),'WvASJ':liIil1(0x4fa,'(@Xt'),'KXwxB':'https://bean.m.jd.com/','DOmCt':function(l1iili,illIIi){return l1iili*illIIi;},'eYjVZ':function(iiIi,iiIl){return iiIi==iiIl;},'KaOFL':function(Iil1I,illIIl){return Iil1I===illIIl;},'tDInx':liIil1(0x61a,'gqVs'),'eAFmf':liIil1(0x5d7,'Ckd6'),'LVHTJ':function(iiiIlI,I1i11){return iiiIlI!=I1i11;},'JnNkv':function(Ill1ii,IllII){return Ill1ii!==IllII;},'ENwVn':liIil1(0x376,'(@Xt'),'COdre':function(Ill1il,IIlI){return Ill1il
|
|
|
|
|
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"])
|