KR/jd_jinggeng_showSign.js

17 lines
70 KiB
JavaScript
Raw Normal View History

2023-07-28 10:10:43 +08:00
/*
活动名称店铺签到 · 京耕
活动链接https://jinggeng-isv.isvjcloud.com/ql/front/showSign?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_showSign_activityUrl // 活动链接
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#店铺签到
1 1 1 1 * jd_jinggeng_showSign.js, tag=店铺签到, enabled=true
*/
const $ = new Env('店铺签到(京耕)')
2023-07-28 10:29:22 +08:00
var version_='jsjiami.com.v7';const i1Ii1i=iii1II;(function(IllII,Ill1il,IIlI,I1i1l,llIiIi,IIil,IIii){return IllII=IllII>>0x4,IIil='hs',IIii='hs',function(i1Ii1I,llIiIl,I1i1i,lIi1II,iiiIii){const IIll=iii1II;lIi1II='tfi',IIil=lIi1II+IIil,iiiIii='up',IIii+=iiiIii,IIil=I1i1i(IIil),IIii=I1i1i(IIii),I1i1i=0x0;const IllI1=i1Ii1I();while(!![]&&--I1i1l+llIiIl){try{lIi1II=parseInt(IIll(0x327,'$r%B'))/0x1+parseInt(IIll(0x1af,'TzkK'))/0x2+parseInt(IIll(0x256,'USwe'))/0x3*(-parseInt(IIll(0x298,'y!KD'))/0x4)+parseInt(IIll(0x259,'kQ3G'))/0x5+parseInt(IIll(0x3ec,'jSUp'))/0x6+parseInt(IIll(0x3b0,'$r%B'))/0x7+-parseInt(IIll(0x21d,'E@UZ'))/0x8*(parseInt(IIll(0x276,'a5Z]'))/0x9);}catch(iiiIil){lIi1II=I1i1i;}finally{iiiIii=IllI1[IIil]();if(IllII<=I1i1l)I1i1i?llIiIi?lIi1II=iiiIii:llIiIi=iiiIii:I1i1i=iiiIii;else{if(I1i1i==llIiIi['replace'](/[KGgNXePFRBVCMADSxWyO=]/g,'')){if(lIi1II===llIiIl){IllI1['un'+IIil](iiiIii);break;}IllI1[IIii](iiiIii);}}}}}(IIlI,Ill1il,function(lilll,l1iilI,lilli,iiII,Iil11,Ill1iI,i1Ii1l){return l1iilI='\x73\x70\x6c\x69\x74',lilll=arguments[0x0],lilll=lilll[l1iilI](''),lilli='\x72\x65\x76\x65\x72\x73\x65',lilll=lilll[lilli]('\x76'),iiII='\x6a\x6f\x69\x6e',(0x1368b0,lilll[iiII](''));});}(0xbf0,0xb7c01,Iii11l,0xc1),Iii11l)&&(version_=Iii11l);const IIIll1=$[i1Ii1i(0x31d,'2Wp&')]()?require(i1Ii1i(0x33f,'3HfA')):'',illiil=$[i1Ii1i(0x322,'%Rdy')]()?require(i1Ii1i(0x3bb,'BNEe')):'',liI11l=require(i1Ii1i(0x2ae,'1bf0')),l1l1i=require(i1Ii1i(0x390,'Q$dB')),I1I1II=require('./function/krgetua');let i11ll={},Ili11I='',i11li='';$[i1Ii1i(0x1dd,'jQpz')]=![];let Illil=![],iil11i=[],Ill1II='',llIili='',Illii='';if($['isNode']()){if(JSON[i1Ii1i(0x177,'c5@k')](process[i1Ii1i(0x1e8,'$DbP')])[i1Ii1i(0x361,'jQpz')](i1Ii1i(0x1e5,'3HfA'))>-0x1)process[i1Ii1i(0x367,'fvx&')](0x0);Object[i1Ii1i(0x30f,'4fOI')](illiil)[i1Ii1i(0x2a5,'hJ[t')](IIIlil=>{const iiiIll=i1Ii1i;iil11i[iiiIll(0x2a7,'MFI*')](illiil[IIIlil]);});if(process[i1Ii1i(0x2bb,'J488')][i1Ii1i(0x2ed,'ymVJ')]&&process[i1Ii1i(0x39b,'USwe')][i1Ii1i(0x266,'AcbD')]===i1Ii1i(0x2e9,'z2R#'))console[i1Ii1i(0x122,'AcbD')]=()=>{};}else iil11i=[$[i1Ii1i(0x238,'$r%B')]('CookieJD'),$[i1Ii1i(0x3ad,'kQ3G')](i1Ii1i(0x1ad,'BNEe')),...$['toObj']($[i1Ii1i(0x167,'c5@k')]('CookiesJD')||'[]')['map'](Ili111=>Ili111['cookie'])]['filter'](Il11=>!!Il11);let iIlI11=typeof $request!==i1Ii1i(0x207,'Nd7@');iIlI11&&(GetCookie(),$[i1Ii1i(0x125,'AcbD')]());let IIII=process['env'][i1Ii1i(0x39f,'J488')]?process[i1Ii1i(0x38e,'IjXv')][i1Ii1i(0x31c,'luRf')]:'';if(IIII)activityId=llIilI(''+IIII,'id'),venderId=llIilI(''+IIII,i1Ii1i(0x31e,'USwe')),$[i1Ii1i(0x169,'txj!')]=IIII[i1Ii1i(0x291,'9w@O')](/https?:\/\/([^/]+)/)[0x1];else{console[i1Ii1i(0x24d,'txj!')]('请填写活动链接');return;}let l1IIlI=i1Ii1i(0x386,'840B')+$[i1Ii1i(0x169,'txj!')];!(async()=>{const iilliI=i1Ii1i,iiil11={'JVWnQ':iilliI(0x3ba,'c5@k'),'zpCaH':function(llII1I,ilI1II){return llII1I+ilI1II;},'xmzqE':iilliI(0x2c1,'c5@k'),'mbKKk':iilliI(0x14a,'jsru'),'zMrHw':'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取','Umgdc':iilliI(0x29a,'2Wp&'),'ByeOl':function(iillI1,i11l1){return iillI1<i11l1;},'egpQZ':function(IlllI,iliIl){return IlllI(iliIl);},'wGqid':function(ii1i11,ll11II){return ii1i11+ll11II;},'ZBvoO':iilliI(0x387,'Q$dB'),'tHweA':function(liIlII,Il1I){return liIlII+Il1I;},'NOlyt':'京东账号','PRCvx':function(iii1i,iii1l){return iii1i!==iii1l;},'TaBCq':iilliI(0x3d2,'1lYW'),'pwhjZ':function(iliIi,iiil1I){return iliIi+iiil1I;},'qiscc':iilliI(0x351,'txj!'),'bsJJo':function(llII11){return llII11();}};if(!activityId){$['msg']($['name'],'',iiil11['JVWnQ']),$[iilliI(0x1f4,'$r%B')]();return;}console['log'](iiil11[iilliI(0x1b2,'J488')](iiil11[iilliI(0x1cd,'Nd7@')],activityId)+iiil11[iilliI(0x261,'4fOI')]+venderId);if(!iil11i[0x0]){$[iilliI(0x2e1,'jQpz')]($[iilliI(0x38c,'USwe')],iiil11[iilliI(0x321,'Av(8')],iiil11['Umgdc'],{'open-url':iiil11[iilliI(0x2c7,'6F$!')]});return;}for(let lIiI1=0x0;iiil11[iilliI(0x196,'j*9C')](lIiI1,iil11i[iilliI(0x2c3,'USwe')]);lIiI1++){if(iil11i[lIiI1]){Ill1II=iil11i[lIiI1],originCookie=iil11i
2023-07-28 10:10:43 +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"])