KR/jd_krSign.js

13 lines
28 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
小豆签到
cron:15 2,19 * * *
============Quantumultx===============
[task_local]
#小豆签到
15 2,19 * * * jd_krSign.js, tag=小豆签到, enabled=true
*/
const $ = new Env('小豆签到');
var version_='jsjiami.com.v7';const iii1lI=iii1II;(function(II11l1,Iil1lI,IiiliI,iii1iI,llIll,il1iII,iilli){return II11l1=II11l1>>0x9,il1iII='hs',iilli='hs',function(IlllIl,II11lI,lI1IIi,I1l11I,Ilil1l){const i1ilI=iii1II;I1l11I='tfi',il1iII=I1l11I+il1iII,Ilil1l='up',iilli+=Ilil1l,il1iII=lI1IIi(il1iII),iilli=lI1IIi(iilli),lI1IIi=0x0;const iIIiii=IlllIl();while(!![]&&--iii1iI+II11lI){try{I1l11I=-parseInt(i1ilI(0x22c,'f3W]'))/0x1*(parseInt(i1ilI(0x232,'9cwD'))/0x2)+parseInt(i1ilI(0x26b,'&oDx'))/0x3*(parseInt(i1ilI(0x24c,'9cwD'))/0x4)+parseInt(i1ilI(0x285,'K9GR'))/0x5*(parseInt(i1ilI(0x26e,'pFXV'))/0x6)+parseInt(i1ilI(0x220,'Tmx]'))/0x7*(-parseInt(i1ilI(0x1ac,'1aO5'))/0x8)+parseInt(i1ilI(0x1b4,'e1E*'))/0x9+parseInt(i1ilI(0x202,'dZdm'))/0xa*(parseInt(i1ilI(0x255,'9Q%9'))/0xb)+-parseInt(i1ilI(0x256,'f3W]'))/0xc;}catch(iilll){I1l11I=lI1IIi;}finally{Ilil1l=iIIiii[il1iII]();if(II11l1<=iii1iI)lI1IIi?llIll?I1l11I=Ilil1l:llIll=Ilil1l:lI1IIi=Ilil1l;else{if(lI1IIi==llIll['replace'](/[FpKMIXGhgAEQlkxeuDR=]/g,'')){if(I1l11I===II11lI){iIIiii['un'+il1iII](Ilil1l);break;}iIIiii[iilli](Ilil1l);}}}}}(IiiliI,Iil1lI,function(il1iI1,IlllIi,iIIiil,i1l1Ii,I1iIIi,I1iIIl,lI1IIl){return IlllIi='\x73\x70\x6c\x69\x74',il1iI1=arguments[0x0],il1iI1=il1iI1[IlllIi](''),iIIiil='\x72\x65\x76\x65\x72\x73\x65',il1iI1=il1iI1[iIIiil]('\x76'),i1l1Ii='\x6a\x6f\x69\x6e',(0x1366b6,il1iI1[i1l1Ii](''));});}(0x18000,0x208b5,Iii11l,0xc2),Iii11l)&&(version_=Iii11l);const IlIII=$['isNode']()?require(iii1lI(0x1be,'CH2r')):'',ilil1l=$[iii1lI(0x23c,'dZdm')]()?require('./jdCookie.js'):'',illlIi=require('./function/krgetToken'),I1lIii=require(iii1lI(0x218,'C@tG')),IiI1I=require('./function/krgetua'),illlIl=process[iii1lI(0x1d8,'C@tG')]['JD_SIGN_KRAPI']||'';let i11ill=[],IIIIIi='';if($['isNode']()){Object['keys'](ilil1l)[iii1lI(0x26f,'1aO5')](iil1l1=>{const i1ilI1=iii1lI;i11ill[i1ilI1(0x271,'y9Ud')](ilil1l[iil1l1]);});if(process[iii1lI(0x20c,'9oUt')][iii1lI(0x245,'jZKy')]&&process['env'][iii1lI(0x21e,'e1E*')]===iii1lI(0x1c7,'H!$N'))console[iii1lI(0x204,'eFJB')]=()=>{};}else i11ill=[$[iii1lI(0x261,'(T7B')](iii1lI(0x1fa,'9cwD')),$['getdata'](iii1lI(0x1ad,'uj0F')),...i11ili($[iii1lI(0x276,'N^ym')](iii1lI(0x1f6,'a*Vs'))||'[]')[iii1lI(0x1d3,'(T7B')](lllli=>lllli[iii1lI(0x23e,'Tmx]')])][iii1lI(0x269,'&oDx')](iiili1=>!!iiili1);let IIIIIl='';const I1lIil=iii1lI(0x24f,'dZdm');!(async()=>{const Iiilii=iii1lI,ill11i={'slBpH':function(lllill,ill11l){return lllill===ill11l;},'ZORlM':function(I1lIiI,lllili){return I1lIiI==lllili;},'hkKJV':function(IliiiI,Ill11){return IliiiI*Ill11;},'qvApl':function(liiIII,li1i11){return liiIII===li1i11;},'JbmDE':'object','hnYmz':function(iI11I1,il1i1l){return iI11I1(il1i1l);},'dvHEx':function(IlIlll,IIIl1I){return IlIlll+IIIl1I;},'pfMdd':'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取','MeSvg':Iiilii(0x1b9,'9cwD'),'icvUC':function(iil1ii,IlIlli){return iil1ii!==IlIlli;},'HXSCD':function(il1i1i,lil111){return il1i1i(lil111);},'xkTLz':function(i11ilI,ii1ii1){return i11ilI+ii1ii1;},'fhCiN':function(llllI,lllil1){return llllI!==lllil1;},'CXjkh':Iiilii(0x283,'wCZ]'),'SrjjP':function(iil1il){return iil1il();},'CrreI':function(ilil1I,i11il1){return ilil1I!==i11il1;}};if(!i11ill[0x0]){$[Iiilii(0x1b6,'zG9u')]($[Iiilii(0x1d4,'l5dN')],ill11i[Iiilii(0x286,'XH4i')],Iiilii(0x1b9,'9cwD'),{'open-url':ill11i[Iiilii(0x243,'&oDx')]});return;}for(let ii1iiI=0x0;ii1iiI<i11ill[Iiilii(0x1b3,'9oUt')];ii1iiI++){if(ill11i[Iiilii(0x258,']eq)')]('ZbXfn',Iiilii(0x1ce,'l[a('))){if(i11ill[ii1iiI]){IIIIIi=i11ill[ii1iiI],$[Iiilii(0x20a,'1aO5')]=ill11i[Iiilii(0x257,'jZKy')](decodeURIComponent,IIIIIi['match'](/pt_pin=([^; ]+)(?=;?)/)&&IIIIIi[Iiilii(0x1e6,'dZdm')](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$[Iiilii(0x1cf,'jZKy')]=ill11i[Iiilii(0x21a,'9cwD')](ii1iiI,0x1),$['isLogin']=!![],$[Iiilii(0x239,'FII5')]='',message='',console[Iiilii(0x27d,'cIBD')](Iiilii(0x1e9,'))8z')+$[Iiilii(0x205,'y9Ud')]+'】'+($[Iiilii(0x28f,'9cwD')]||$[Iiilii(0x281,'xxdd')])+Iiilii(0x211,'pM8e'));if(!$[Iiilii(0x1e7,'n$ao')]){$[Iiilii(0x26d,'uzd8')]($['name'],Iiilii(0x21c,'n$ao'),Ii
// 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"])