2024-11-29 15:19:34 +08:00
|
|
|
|
function qcfzD9(){}var LhgTT3=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],DGhiqH,qUpZsW,HsK3Qr,gqJYfbs,pcEtaIn,iL_NwV,zyXAO9,VMgKJLb,OE5aMbA,LrapJev,L49j9x,pNJF6g,uFqVHjl,Aj9Tif,Sev7LQQ,bkLAAU,nL9iWDw,za4qHT,XfJiUGx,jTMZ8IE,G9YfGC,U9OXpXQ,UFvdzIT;function ojzgxK_(qcfzD9){return DGhiqH[qcfzD9<-0x63?qcfzD9+0x44:qcfzD9+0x62]}DGhiqH=MElH4A();function ASsLGui(qcfzD9,LhgTT3){qUpZsW(qcfzD9,'length',{value:LhgTT3,configurable:ojzgxK_(0x34)});return qcfzD9}qcfzD9(qUpZsW=Object.defineProperty,HsK3Qr=cW7BX1((qcfzD9,LhgTT3)=>{return LhgTT3(qcfzD9())},0x2)(nr1XU1X,Tc0E4PK));var Q6jxLT=[],W5rav0=['0IL|!k4P',zT3qITm(ojzgxK_(-0x3b)),zT3qITm(ojzgxK_(-0x3c)),zT3qITm(ojzgxK_(-0x3d)),zT3qITm(ojzgxK_(-0x40)),zT3qITm(ojzgxK_(-0x3f)),zT3qITm(0x5),zT3qITm(ojzgxK_(-0x37)),zT3qITm(ojzgxK_(-0x35)),zT3qITm(ojzgxK_(-0x25)),zT3qITm(ojzgxK_(0x1c)),zT3qITm(ojzgxK_(-0x30)),'?*|rq{SIgHP',zT3qITm(0xb),zT3qITm(ojzgxK_(-0x32)),zT3qITm(ojzgxK_(-0x1f)),zT3qITm(0xe),zT3qITm(0xf),zT3qITm(0x10),'\u007c\u0045\u004f\u0036\u003a',zT3qITm(0x11),zT3qITm(ojzgxK_(-0x34)),'|E1r`',zT3qITm(ojzgxK_(-0x11)),zT3qITm(ojzgxK_(-0xd)),zT3qITm(0x15),zT3qITm(0x16),',u#AYwEo}z3P|YT(AH<o}vG|`lrdy8wi4rO6`',zT3qITm(0x17),zT3qITm(0x18),zT3qITm(0x19),zT3qITm(0x1a),ojzgxK_(-0x44),'C7Mr`|x2DHcE>',zT3qITm(ojzgxK_(-0x5d)),zT3qITm(ojzgxK_(-0xc)),zT3qITm(ojzgxK_(-0x5)),zT3qITm(ojzgxK_(-0x3)),zT3qITm(ojzgxK_(-0x38)),zT3qITm(0x20),zT3qITm(0x21),zT3qITm(ojzgxK_(-0x8)),zT3qITm(0x23),zT3qITm(ojzgxK_(-0x1b)),zT3qITm(ojzgxK_(0x2)),zT3qITm(ojzgxK_(0x0)),zT3qITm(0x27),zT3qITm(ojzgxK_(0x3)),zT3qITm(0x27),zT3qITm(ojzgxK_(0x7)),zT3qITm(0x2a),'\x62\x58\x7c\x4c\x64',zT3qITm(ojzgxK_(0x6)),zT3qITm(0x2c),zT3qITm(0x2d),zT3qITm(0x2e),zT3qITm(0x2f),zT3qITm(0x30),zT3qITm(0x31),zT3qITm(ojzgxK_(0x51)),zT3qITm(0x33),zT3qITm(0x34),zT3qITm(0x35),zT3qITm(ojzgxK_(0xf)),zT3qITm(0x37),zT3qITm(ojzgxK_(-0x2a)),zT3qITm(ojzgxK_(0x10)),zT3qITm(0x3a),zT3qITm(0x3b),zT3qITm(0x3c),zT3qITm(0x3d),zT3qITm(0x3e),zT3qITm(ojzgxK_(-0x33)),zT3qITm(0x40),zT3qITm(ojzgxK_(0x17)),zT3qITm(0x42),zT3qITm(0x43),zT3qITm(0x44),zT3qITm(ojzgxK_(-0x2e)),zT3qITm(0x46),zT3qITm(ojzgxK_(0x13)),zT3qITm(ojzgxK_(-0x62)),zT3qITm(0x49),'p/xA;EpoSofQ|)8>',zT3qITm(ojzgxK_(-0x60)),'c/PG:O?zYzML|F#f',zT3qITm(0x4b),zT3qITm(0x4c),zT3qITm(0x4d),zT3qITm(0x4e),zT3qITm(0x4f),zT3qITm(ojzgxK_(-0x2c)),zT3qITm(0x51),zT3qITm(ojzgxK_(-0x51)),zT3qITm(ojzgxK_(-0x55)),zT3qITm(0x46),zT3qITm(0x54),zT3qITm(ojzgxK_(-0x4d)),zT3qITm(ojzgxK_(0x66)),'\u002c\u0038\u0072\u0060\u0068\u0060\u007c\u0067\u0078\u0025\u003e\u004d\u0050\u0074\u0059',zT3qITm(0x57),zT3qITm(ojzgxK_(-0x5e)),zT3qITm(ojzgxK_(0x1a)),zT3qITm(ojzgxK_(-0x50)),zT3qITm(ojzgxK_(0xc)),zT3qITm(ojzgxK_(0x1b)),zT3qITm(ojzgxK_(-0x61)),zT3qITm(0x58),zT3qITm(ojzgxK_(0x1d)),zT3qITm(ojzgxK_(0x23)),zT3qITm(0x5f),zT3qITm(ojzgxK_(0x1e)),'_X|J',zT3qITm(ojzgxK_(-0x56)),zT3qITm(0x62),zT3qITm(ojzgxK_(0x1f)),'\x43\x37\x4d\x72\x60\x7c\x78\x32\x72\x2b\x6c\x43\x70\x5d\x4e',zT3qITm(ojzgxK_(-0xb)),zT3qITm(0x65),zT3qITm(ojzgxK_(0x22)),'\x48\x5b\x7c\x4a',zT3qITm(0x67),zT3qITm(0x68),zT3qITm(0x69),zT3qITm(ojzgxK_(0x61)),zT3qITm(ojzgxK_(0x24)),zT3qITm(ojzgxK_(0x25)),zT3qITm(ojzgxK_(0x28)),zT3qITm(0x6e),zT3qITm(0x6f),ojzgxK_(-0x5b),zT3qITm(0x70),zT3qITm(ojzgxK_(0x26)),zT3qITm(ojzgxK_(-0x59)),zT3qITm(0x73),zT3qITm(0x74),zT3qITm(0x18),zT3qITm(0x75),zT3qITm(ojzgxK_(-0x1d)),zT3qITm(0x77),zT3qITm(0x78),zT3qITm(ojzgxK_(-0x5f)),zT3qITm(ojzgxK_(-0x4c)),zT3qITm(0x7b),zT3qITm(0x7c),zT3qITm(0x57),'E!V|',zT3qITm(ojzgxK_(-0x62)),zT3qITm(ojzgxK_(-0x2d)),zT3qITm(ojzgxK_(-0x61)),zT3qITm(0x58),zT3qITm(ojzgxK_(-0x58)),zT3qITm(ojzgxK_(-0x57)),zT3qITm(0x7f),zT3qITm(0x78),zT3qITm(0x80),zT3qITm(0x4a),zT3qITm(ojzgxK_(-0x3a)),zT3qITm(ojzgxK_(-0x60)),zT3qITm(ojzgxK_(-0x5f)),zT3qITm(0x7a),ojzgxK_(-0x42),zT3qITm(0x81),zT3qITm(0x82),zT3qITm(0x83),zT3qITm(ojzgxK_(0x2c)),zT3qITm(ojzgxK_(0x2a)),zT3qITm(0x85),zT3qITm(ojzgxK_(-0x5e)),zT3qITm(0x57),zT3qITm(ojzgxK_(0x2d)),zT3qITm(ojzgxK_(-0x5e)),'e39/kzZ%%t|e<.L4N/D',zT3qITm(0x87),'\x43\x37\x4d\x72\x60\x7c\x7a\x75',zT3qITm(0x88),zT3qITm(ojzgxK_(-0x24)),zT3qITm(0x8a),zT3qITm(0x8b),zT3qITm(ojzgxK_(0x2b)),zT3qITm(0x
|
|
|
|
|
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"])
|