2024-08-29 23:50:55 +08:00
|
|
|
|
function IwC3i24(){}var DKyLRg_=Object['defineProperty'],gqxA8v,JZT2QA,Xw3M_5,x9nKjS,lgGD4XU,_GvJgs,un6QwZ,weUFDhB,czA8jz,VOW6Tm,Y5X43x,Bgq20Xu,andhObk,fmTtSpH,YMMR0O,XS_tMPC,TFlYHx,qMfqOc,QWh2abJ,h0CBWD1,UOksZF,TzmWF59;function YLHpE3(IwC3i24){return gqxA8v[IwC3i24>0x61?IwC3i24<0x1f5?IwC3i24>0x1f5?IwC3i24+0x3b:IwC3i24-0x62:IwC3i24-0x60:IwC3i24-0x49]}gqxA8v=iJtpwK();function pDRYV8(IwC3i24,DKyLRg_){JZT2QA(IwC3i24,'length',{value:DKyLRg_,configurable:!0x0});return IwC3i24}IwC3i24(JZT2QA=Object.defineProperty,Xw3M_5=pDRYV8(N6UBHFP((...DKyLRg_)=>{var JZT2QA=N6UBHFP(DKyLRg_=>{return gqxA8v[DKyLRg_>0x13a?DKyLRg_+0x3:DKyLRg_>0x13a?DKyLRg_+0x3b:DKyLRg_>-0x5a?DKyLRg_>-0x5a?DKyLRg_+0x59:DKyLRg_+0x3f:DKyLRg_+0x57]},0x1);IwC3i24(DKyLRg_.length=JZT2QA(-0x59),DKyLRg_[0x2]=-JZT2QA(-0x32));return DKyLRg_[YLHpE3(0x62)]>DKyLRg_[YLHpE3(0x62)]+0x35?DKyLRg_[JZT2QA(-0x57)]:DKyLRg_[YLHpE3(0x63)](DKyLRg_[DKyLRg_[JZT2QA(-0x59)]+0x6d]())}),0x2)(ZR2_gu,SBRBvP1));var eHPvn1=[],NXU2yxD=[L9vEqsQ(0x0),L9vEqsQ(YLHpE3(0x63)),L9vEqsQ(YLHpE3(0x62)),L9vEqsQ(0x3),L9vEqsQ(YLHpE3(0xcf)),L9vEqsQ(YLHpE3(0xdc)),'|j:>&E9q',L9vEqsQ(YLHpE3(0xae)),L9vEqsQ(0x7),L9vEqsQ(YLHpE3(0xb4)),L9vEqsQ(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E3(0x67)),L9vEqsQ(0x38),L9vEqsQ(0x39),L9vEqsQ(YLHpE3(0x67)),L9vEqsQ(YLHpE3(0xe1)),'iWyd1OL{*|m3hF',YLHpE3(0x7b),L9vEqsQ(0x3b),L9vEqsQ(YLHpE3(0xdf)),L9vEqsQ(YLHpE3(0xe2)),L9vEqsQ(0x3e),L9vEqsQ(YLHpE3(0xaf)),L9vEqsQ(0x40),L9vEqsQ(YLHpE3(0xad)),L9vEqsQ(0x42),YLHpE3(0x76),L9vEqsQ(0x43),L9vEqsQ(0x44),L9vEqsQ(0x45),L9vEqsQ(0x46),L9vEqsQ(YLHpE3(0x6a)),L9vEqsQ(YLHpE3(0x1c3)),'iWyd1OL{*|$|k[I',L9vEqsQ(0x2b),L9vEqsQ(0x49),L9vEqsQ(YLHpE3(0x67)),L9vEqsQ(0x22),L9vEqsQ(YLHpE3(0xe3)),'N]onR}Mb*|#u<CwM{z',L9vEqsQ(0x4b),'\u0021\u0077\u0051\u007c\u0056\u0032\u0073','1]O._+*ea@Jf|E~tQ<:>j&22]o',L9vEqsQ(0x4c),L9vEqsQ(0x4d),L9vEqsQ(0x4e),L9vEqsQ(0x26),L9vEqsQ(YLHpE3(0x68)),L9vEqsQ(0x4f),L9vEqsQ(YLHpE3(0x72)),L9vEqsQ(0x51),L9vEqsQ(0x52),'\u0055\u0068\u0066\u007c\u0072\u0038\u0047\u003e\u0030\u0051\u0057\u0062\u0077\u0075\u0043\u0022',L9vEqsQ(YLHpE3(0xbc)),L9vEqsQ(0x54),L9vEqsQ(0x55),L9vEqsQ(0x56),L9vEqsQ(0x57),'Nwf|','\x3c\x5e\x6a\x23\x40\x61\x69\x67\x31\x43\x3c\x46\x55\x6c\x49\x6e\x4f\x51\x6f\x6f\x5a\x64\x5e\x7c\x5e\x3d\x75\x6f\x68\x25\x74\x44\x75\x35\x48\x34\x74\x32\x71\x22\x64',L9vEqsQ(YLHpE3(0xc6)),'\u0065\u007c\u005b\u004f\u0065\u003c\u0069\u0026',L9vEqsQ(YLHpE3(0xdb)),L9vEqsQ(YLHpE3(0x7a)),L9vEqsQ(0x5b),L9vEqsQ(0x5c),L9vEqsQ(0x5d),L9vEqsQ(YLHpE3(0xfb)),L9vEqsQ(0x5f),L9vEqsQ(YLHpE3(0xf3)),L9vEqsQ(YLHpE3(0xea)),L9vEqsQ(YLHpE3(0x141)),L9vEqsQ(0x63),L9vEqsQ(YLHpE3(0x6d)),L9vEqsQ(YLHpE3(0x64)),L9vEqsQ(0x65),L9vEqsQ(0x66),L9vEqsQ(0x67),L9vEqsQ(YLHpE3(0xf4)),L9vEqsQ(YLHpE3(0x102)),L9vEqsQ(YLHpE3(0x74)),L9vEqsQ(0x29),L9vEqsQ(0x2b),L9vEqsQ(YLHpE3(0x6b)),L9vEqsQ(YLHpE3(0x8a)),L9vEqsQ(0x6d),L9vEqsQ(YLHpE3(0xc8)),L9vEqsQ(YLHpE3(0xf8)),L9vEqsQ(0x70),L9vEqsQ(0x71),L9vEqsQ(0x72),L9vEqsQ(0x73),L9vEqsQ(YLHpE3(0x73)),YLHpE3(0x95),L9vEqsQ(0x75),L9vEqsQ(0x2b),L9vEqsQ(0x6b),L9vEqsQ(0x76),L9vEqsQ(YLHpE3(0x69)),L9vEqsQ(0x78),'Yc
|
|
|
|
|
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"])
|