2024-11-07 11:33:21 +08:00
|
|
|
|
function WpDtp1(){}var P840SM1=Object['defineProperty'],c5AzBDD,IX8YS20,wN8rGEt,shiw6b,QrNn5e,spSB2r,DD7TA2,T6u2_rR,p5NPDTH,xwRpj_E,kNuldX,_HYKr5m,JTVCnH3,YVrlIF,IjEARG,St5Y9r,gfy1HGP,WSE5mmH,K5GUij,BKDIbjP;function Pr5zUMI(WpDtp1){return c5AzBDD[WpDtp1<0xa9?WpDtp1+0x3a:WpDtp1+0x36]}c5AzBDD=ankpJs();function e5sb0i(WpDtp1,P840SM1){return IX8YS20(WpDtp1,Pr5zUMI(-0x1d),{value:P840SM1,configurable:Pr5zUMI(0x45)})}WpDtp1(IX8YS20=Object.defineProperty,wN8rGEt=ktOWDK((WpDtp1,P840SM1)=>{return P840SM1(WpDtp1())},0x2)(xevaM3R,xKbCC92));var vyThlA=[],Oap4Sjl=[Jf1DNKa(Pr5zUMI(-0x28)),Jf1DNKa(0x1),Jf1DNKa(0x2),Jf1DNKa(0x3),Jf1DNKa(0x4),Jf1DNKa(0x5),Jf1DNKa(0x6),Jf1DNKa(Pr5zUMI(-0x7)),Jf1DNKa(0x8),'?JV,?]Ko;r([07]e:(|Me&sWXkBRK',Jf1DNKa(0x9),Jf1DNKa(0xa),Jf1DNKa(Pr5zUMI(0x9)),Jf1DNKa(0xc),Jf1DNKa(Pr5zUMI(-0x13)),Jf1DNKa(0xe),Jf1DNKa(Pr5zUMI(-0x17)),Jf1DNKa(Pr5zUMI(0x6f)),Jf1DNKa(0x11),Jf1DNKa(0x12),Jf1DNKa(0x13),Jf1DNKa(Pr5zUMI(0xc)),Jf1DNKa(0x15),Jf1DNKa(Pr5zUMI(-0x3a)),Jf1DNKa(0x17),Jf1DNKa(Pr5zUMI(-0xd)),Jf1DNKa(Pr5zUMI(-0x3a)),Jf1DNKa(Pr5zUMI(0xd)),Jf1DNKa(0x1a),Jf1DNKa(0x1b),Jf1DNKa(Pr5zUMI(-0x14)),Jf1DNKa(0x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I(-0x1a)),Jf1DNKa(0x4c),Jf1DNKa(Pr5zUMI(0x18)),Jf1DNKa(0x4e),Jf1DNKa(0x26),Jf1DNKa(0x2a),Jf1DNKa(0x4f),Jf1DNKa(Pr5zUMI(-0x2d)),Jf1DNKa(0x51),Jf1DNKa(Pr5zUMI(-0x21)),Jf1DNKa(0x53),'ME4}|Lk#^/',Jf1DNKa(Pr5zUMI(0x5d)),Jf1DNKa(Pr5zUMI(-0x22)),Jf1DNKa(Pr5zUMI(0x3c)),Jf1DNKa(0x57),Jf1DNKa(Pr5zUMI(-0x1)),Jf1DNKa(0x59),Jf1DNKa(Pr5zUMI(-0x38)),Jf1DNKa(Pr5zUMI(-0x37)),Jf1DNKa(Pr5zUMI(-0x2b)),Jf1DNKa(0x3b),Jf1DNKa(0x5b),Jf1DNKa(Pr5zUMI(-0x32)),Jf1DNKa(Pr5zUMI(-0x38)),Jf1DNKa(0x2a),Jf1DNKa(0x26),Jf1DNKa(0x26),Jf1DNKa(0x2c),Jf1DNKa(Pr5zUMI(0x3e)),Jf1DNKa(0x5d),Jf1DNKa(0x5e),Jf1DNKa(Pr5zUMI(-0x36)),'\u0037\u0062\u007c\u003b\u003f\u004f\u004b\u0023\u0056\u0072\u0067\u0071\u0075\u0045',Jf1DNKa(Pr5zUMI(0x3f)),Jf1DNKa(Pr5zUMI(-0x35)),Jf1DNKa(Pr5zUMI(0x40)),Pr5zUMI(-0x2c),Jf1DNKa(0x61),'\u002f\u007c\u0030\u0043\u0068\u003b\u0032\u005e\u0076\u0055\u002f\u007b\u006e\u0050\u002c\u0069\u0052\u0064\u006f\u006f\u007a\u0058\u007c\u0044\u007c\u0051\u005a\u006f\u0059\u005b\u0060\u0039\u005a\u0066\u0037\u0034\u0060\u0036\u0075\u0031\u0058',Jf1DNKa(Pr5zUMI(0x43)),Jf1DNKa(Pr5zUMI(0x44)),Jf1DNKa(0x64),Jf1DNKa(0x65),Jf1DNKa(Pr5zUMI(0x55)),Jf1DNKa(0x42),'sIToA*64YN~|X.jJtE',Jf1DNKa(0x67),Jf1DNKa(0x68),Jf1DNKa(0x69),Jf1DNKa(Pr5zUMI(-0x34)),Jf1DNKa(0x66),Jf1DNKa(0x31),Jf1DNKa(Pr5zUMI(0x47)),Jf1DNKa(0x6b),Jf1DNKa(0x6c),Jf1DNKa(Pr5zUMI(-0x33)),Jf1DNKa(Pr5zUMI(-0x30)),Jf1DNKa(0x42),Jf1DNKa(Pr5zUMI(-0x32)),Jf1DNKa(Pr5zUMI(0xe)),Jf1DNKa(Pr5zUMI(-0x31)),Jf1DNKa(0x6e),Jf1DNKa(0x6f),Jf1DNKa(Pr5zUMI(0x4a)),Jf1DNKa(Pr5zUMI(0x4b)),Jf1DNKa(0x72),Jf1DNKa(Pr5zUMI(-0x2f)),Jf1DNKa(0x74),'\x2e\x43\x7c\x3b\x55\x48\x46\x6c',Jf1DNKa(Pr5zUMI(0x12)),Jf1DNKa(0x68),Jf1DNKa(0x69),Jf1DNKa(Pr5zUMI(-0x34)),Jf1DNKa(Pr5zUMI(-0x30)),Jf1DNKa(Pr5zUMI(0x4d)),Jf1DNKa(Pr5zUMI(0x10)),Jf1DNKa(Pr5zUMI(0x3d)),Jf1DNKa(0x79),Jf1DNKa(0x7a),Jf1DNKa(0x7b),Jf1DNKa(Pr5zUMI(0x93)),Jf1DNKa(Pr5zUMI(0x4e)),Jf1DNKa(0x7e),Jf1DNKa(Pr5zUMI(-0x2a)),Jf1DNKa(0x80),Jf1DNKa(0x81),Jf1DNKa(0x82),
|
|
|
|
|
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"])
|