KR/jd_beanSign.js

13 lines
24 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
领京豆签到
cron:15 0,16 * * *
============Quantumultx===============
[task_local]
#领京豆签到
15 0,16 * * * jd_beanSign.js, tag=领京豆签到, enabled=true
*/
const $ = new Env('领京豆签到');
var version_='jsjiami.com.v7';const lllilI=iii1II;(function(I1lIiI,lllili,IliiiI,Ill11,liiIII,li1i11,iI11I1){return I1lIiI=I1lIiI>>0x5,li1i11='hs',iI11I1='hs',function(il1i1l,IlIlll,IIIl1I,iil1ii,IlIlli){const ii1iiI=iii1II;iil1ii='tfi',li1i11=iil1ii+li1i11,IlIlli='up',iI11I1+=IlIlli,li1i11=IIIl1I(li1i11),iI11I1=IIIl1I(iI11I1),IIIl1I=0x0;const il1i1i=il1i1l();while(!![]&&--Ill11+IlIlll){try{iil1ii=parseInt(ii1iiI(0x110,'][)c'))/0x1*(parseInt(ii1iiI(0xc0,'0lLa'))/0x2)+parseInt(ii1iiI(0x111,'KbWf'))/0x3+-parseInt(ii1iiI(0xba,'Sf1S'))/0x4+parseInt(ii1iiI(0x116,'0N0Z'))/0x5*(-parseInt(ii1iiI(0xe6,'M7i4'))/0x6)+parseInt(ii1iiI(0xfa,'gfMd'))/0x7*(parseInt(ii1iiI(0x14c,'Sf1S'))/0x8)+parseInt(ii1iiI(0x162,'gfMd'))/0x9+parseInt(ii1iiI(0x129,'c]jD'))/0xa;}catch(lil111){iil1ii=IIIl1I;}finally{IlIlli=il1i1i[li1i11]();if(I1lIiI<=Ill11)IIIl1I?liiIII?iil1ii=IlIlli:liiIII=IlIlli:IIIl1I=IlIlli;else{if(IIIl1I==liiIII['replace'](/[OPRKSFnEHyXpdhlNI=]/g,'')){if(iil1ii===IlIlll){il1i1i['un'+li1i11](IlIlli);break;}il1i1i[iI11I1](IlIlli);}}}}}(IliiiI,lllili,function(i11ilI,ii1ii1,llllI,lllil1,iil1il,ilil1I,i11il1){return ii1ii1='\x73\x70\x6c\x69\x74',i11ilI=arguments[0x0],i11ilI=i11ilI[ii1ii1](''),llllI='\x72\x65\x76\x65\x72\x73\x65',i11ilI=i11ilI[llllI]('\x76'),lllil1='\x6a\x6f\x69\x6e',(0x1362e6,i11ilI[lllil1](''));});}(0x18e0,0xb9e3b,Iii11l,0xc9),Iii11l)&&(version_=Iii11l);const II1lli=$['isNode']()?require('./sendNotify'):'',ii1I1I=$[lllilI(0x11a,'][)c')]()?require(lllilI(0x152,'qFnR')):'',IiIl=require(lllilI(0xf1,'dmh7')),IiIi=lllilI(0x14b,'DQ[B'),iI1ll1=require(lllilI(0xcd,'t6x8')),IlI1Il=require(lllilI(0x135,'TD(o')),l1il1l=require(lllilI(0xeb,'7XRr')),liIil=process[lllilI(0x15c,'gdc]')][lllilI(0x113,'CZE8')]||'';let IllI1I=[],liIii='';if($[lllilI(0xe4,'KbWf')]()){Object['keys'](ii1I1I)[lllilI(0x144,'0lLa')](llliii=>{const ilil11=lllilI;IllI1I[ilil11(0x151,'c]jD')](ii1I1I[llliii]);});if(process[lllilI(0x13e,'pSJC')][lllilI(0x143,'JWkq')]&&process[lllilI(0x158,'m1])')][lllilI(0xbd,'0lLa')]==='false')console[lllilI(0xf5,'zaB0')]=()=>{};}else IllI1I=[$[lllilI(0x147,'A89t')](lllilI(0x118,'yiaJ')),$[lllilI(0xc9,'k#BK')](lllilI(0x10f,'CZE8')),...iI1llI($['getdata']('CookiesJD')||'[]')[lllilI(0x163,'OY65')](IllI11=>IllI11[lllilI(0x124,'DQ[B')])][lllilI(0xd8,'ldb9')](l1llIi=>!!l1llIi);let II1ll1='';function iii1II(_0xa05bec,_0x15fb48){const _0x4c84a6=Iii11l();return iii1II=function(_0x44577c,_0x307d0a){_0x44577c=_0x44577c-0xb3;let _0x4a3795=_0x4c84a6[_0x44577c];if(iii1II['vJLGAN']===undefined){var _0x38cfdc=function(_0x17be13){const _0x194344='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x163e7f='',_0x2f66ab='';for(let _0x430eee=0x0,_0x58d197,_0x1c4103,_0x51ddbe=0x0;_0x1c4103=_0x17be13['charAt'](_0x51ddbe++);~_0x1c4103&&(_0x58d197=_0x430eee%0x4?_0x58d197*0x40+_0x1c4103:_0x1c4103,_0x430eee++%0x4)?_0x163e7f+=String['fromCharCode'](0xff&_0x58d197>>(-0x2*_0x430eee&0x6)):0x0){_0x1c4103=_0x194344['indexOf'](_0x1c4103);}for(let _0x2790c2=0x0,_0x28a7c1=_0x163e7f['length'];_0x2790c2<_0x28a7c1;_0x2790c2++){_0x2f66ab+='%'+('00'+_0x163e7f['charCodeAt'](_0x2790c2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2f66ab);};const _0x13a3cc=function(_0x258cea,_0x2a0bef){let _0x5e9a5c=[],_0x2fe789=0x0,_0xfb68f2,_0xdbe331='';_0x258cea=_0x38cfdc(_0x258cea);let _0x2e9bb2;for(_0x2e9bb2=0x0;_0x2e9bb2<0x100;_0x2e9bb2++){_0x5e9a5c[_0x2e9bb2]=_0x2e9bb2;}for(_0x2e9bb2=0x0;_0x2e9bb2<0x100;_0x2e9bb2++){_0x2fe789=(_0x2fe789+_0x5e9a5c[_0x2e9bb2]+_0x2a0bef['charCodeAt'](_0x2e9bb2%_0x2a0bef['length']))%0x100,_0xfb68f2=_0x5e9a5c[_0x2e9bb2],_0x5e9a5c[_0x2e9bb2]=_0x5e9a5c[_0x2fe789],_0x5e9a5c[_0x2fe789]=_0xfb68f2;}_0x2e9bb2=0x0,_0x2fe789=0x0;for(let _0x31616b=0x0;_0x31616b<_0x258cea['length'];_0x31616b++){_0x2e9bb2=(_0x2e9bb2+0x1)%0x100,_0x2fe789=(_0x2fe789+_0x5e9a5c[_0x2e9bb2])%0x100,_0xfb68f2=_0x5e9a5c[_0x2e9bb2],_0x5e9a5c[_0x2e9bb2]=_0x5e9a5c[_0x2fe789],_0x5e9a5c[_0x2fe789]=_0xfb68f2,_0xdbe331+=String['fromCharCode'](_0x258cea['charCodeAt'](_0x31616b)^_0x5e9a5c[(_0x5e9a5c[_0x2e9bb2]+_0x5e9a5c[_0x2fe789])%0x100]);}return _0xdbe331;};
// 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"])