2024-11-22 17:29:25 +08:00
|
|
|
function KlQEcq(){}var PRuQQJ=Object['defineProperty'],NOu0V1e,O6P7WM,nkBGhq,DSPyeUC,L0DpMTZ,o7X1kuz,PtV7vQ,vQwWSj,Vf2N4v,GGwgua,xRHCQwm,sQ1hUQY,M9bYTA,clyhKx,F3qmBJ,IvFQqP,d6xRfWc,H7P2OUz,v4WluOO,i5RQFLJ;function J_Nxh2(KlQEcq){return NOu0V1e[KlQEcq>0x106?KlQEcq-0x34:KlQEcq<0x5b?KlQEcq-0x27:KlQEcq-0x5c]}NOu0V1e=wFJ4Ji();function w04awZQ(KlQEcq,PRuQQJ){return O6P7WM(KlQEcq,'length',{value:PRuQQJ,configurable:!0x0})}KlQEcq(O6P7WM=Object.defineProperty,nkBGhq=Fqprhi((KlQEcq,PRuQQJ)=>{return PRuQQJ(KlQEcq())},0x2)(hUUIuTl,h7EUqH));var AdgfDqH=[],E_LEpjV=[c0QRJlC(0x0),c0QRJlC(0x1),c0QRJlC(J_Nxh2(0x68)),c0QRJlC(0x3),'%8#Cc|"H',c0QRJlC(0x4),c0QRJlC(J_Nxh2(0x6a)),c0QRJlC(J_Nxh2(0x71)),c0QRJlC(J_Nxh2(0x6d)),c0QRJlC(J_Nxh2(0x70)),c0QRJlC(J_Nxh2(0x94)),c0QRJlC(J_Nxh2(0x6f)),c0QRJlC(0xb),c0QRJlC(0xc),c0QRJlC(J_Nxh2(0x72)),c0QRJlC(J_Nxh2(0x78)),c0QRJlC(0xf),c0QRJlC(0x10),c0QRJlC(0x11),'VSAM}|U',c0QRJlC(0x12),c0QRJlC(J_Nxh2(0x84)),c0QRJlC(0x14),c0QRJlC(J_Nxh2(0x5e)),c0QRJlC(J_Nxh2(0x6e)),'TH;/x^8l`_wm!x@|/%El`Ks!VcMI6R^~zMdCV',c0QRJlC(0x17),c0QRJlC(J_Nxh2(0x85)),c0QRJlC(0x19),c0QRJlC(0x16),c0QRJlC(0x1a),c0QRJlC(0x1b),c0QRJlC(0x1c),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x22),c0QRJlC(J_Nxh2(0xd8)),'\u005d\u0040\u0062\u0072\u0064\u0024\u0072\u006e\u0067\u002b\u0035\u0062\u0074\u0068\u004e\u0076\u0036\u0038\u004b\u006d\u0033\u004f\u007c\u005b\u004d\u0028\u005d\u0074\u006c\u0047\u0034\u0043\u0056\u003a','BM,q>/C|pk,',c0QRJlC(J_Nxh2(0x62)),c0QRJlC(0x47),c0QRJlC(0x48),c0QRJlC(0x49),c0QRJlC(0x4a),c0QRJlC(0x4b),c0QRJlC(0x4c),c0QRJlC(J_Nxh2(0x5e)),c0QRJlC(0x23),c0QRJlC(0x23),c0QRJlC(0x4d),c0QRJlC(0x4e),c0QRJlC(0x4a),c0QRJlC(J_Nxh2(0xa6)),c0QRJlC(J_Nxh2(0x61)),c0QRJlC(J_Nxh2(0x5f)),c0QRJlC(0x52),c0QRJlC(J_Nxh2(0xa3)),c0QRJlC(0x4d),c0QRJlC(0x4e),c0QRJlC(J_Nxh2(0x5c)),c0QRJlC(J_Nxh2(0x92)),c0QRJlC(J_Nxh2(0x5f)),c0QRJlC(0x15),c0QRJlC(0x23),c0QRJlC(J_Nxh2(0x7c)),c0QRJlC(J_Nxh2(0x60)),c0QRJlC(0x45),c0QRJlC(0x57),c0QRJlC(0x58),c0QRJlC(J_Nxh2(0xb1)),c0QRJlC(J_Nxh2(0xaf)),']@brd$rng+5bthNv68Km3O|[M(]tlG4CV:',c0QRJlC(0x5b),c0QRJlC(0x5c),c0QRJlC(0x5d),c0QRJlC(J_Nxh2(0x60)),c0QRJlC(0x45),c0QRJlC(0x5e),c0QRJlC(J_Nxh2(0xb2)),'\u004d\u007a\u003c\u0038\u007c\u007c\u0024\u003a',c0QRJlC(J_Nxh2(0xb4)),c0QRJlC(0x61),c0QRJlC(J_Nxh2(0xb6)),'\u005d\u0040\u0062\u0072\u0064\u0024\u0072\u006e\u0067\u002b\u0035\u0062\u0074\u0068\u004e\u0076\u0036\u0038\u004b\u006d\u0033\u004f\u007c\u005b\u004d\u0028\u005d\u0074\u006c\u0047\u0034\u0043\u0056\u003a',c0QRJlC(0x23),c0QRJlC(J_Nxh2(0x5c)),c0QRJlC(J_Nxh2(0x5c)),c0QRJlC(0x63),'l/kfnPq|`D?_A#@G&lYc0sS(:(vOY~o4)RWCfDiNu%]2:',c0QRJlC(0x23),c0QRJlC(0x64),c0QRJlC(0x65),c0QRJlC(0x66),c0QRJlC(0x67),'\u0028\u0037\u0022\u0063\u0063\u007c\u006f\u0050\u0023\u006f\u0041\u0038\u003a',c0QRJlC(J_Nxh2(0x9f)),c0QRJlC(0x68),c0QRJlC(0x69),c0QRJlC(J_Nxh2(0xbd)),c0QRJlC(J_Nxh2(0xbe)),c0QRJlC(0x6c),c0QRJlC(0x6d),c0QRJlC(J_Nxh2(0xb5)),c0QRJlC(J_Nxh2(0xc1)),c0QRJlC(J_Nxh2(0x9c)),c0QRJlC(0x71),c0QRJlC(J_Nxh2(0xc0)),c0QRJlC(J_Nxh2(0x9d)),c0QRJlC(0x74),c0QRJlC(0x75),'5W+Mz|pr4o}drKPRzW+M%28gg<y9
|
|
|
|
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"])
|