2024-09-24 15:55:14 +08:00
|
|
|
|
function xuzE24m(){}var hCyTLl=Object['defineProperty'],KHar7qQ,WOIjWoE,EUnyUn,_sk7qo,_zQzUz,PWZlNxC,q71nLdd,XS1rwYC,PA3yTLM,SwX1w2a,i1go8p,th2oth,YrvVlSv,zG7uCM,Hv7LqU,TwHO8k9,xxfzhe,i8yP3C;function XXBMCnk(xuzE24m){return KHar7qQ[xuzE24m<0x27?xuzE24m-0xd:xuzE24m-0x28]}KHar7qQ=I4b62_();function ARVfSY(xuzE24m,hCyTLl){return WOIjWoE(xuzE24m,'length',{value:hCyTLl,configurable:XXBMCnk(0x86)})}xuzE24m(WOIjWoE=Object.defineProperty,EUnyUn=Q7mmWQ((xuzE24m,hCyTLl)=>{return hCyTLl(xuzE24m())},0x2)(CuXTkz,LohyzP));var AmRHkDV=[],IsFOSZ=[O0ZyK2(0x0),O0ZyK2(XXBMCnk(0x3b)),O0ZyK2(0x2),';d>|y[`V',O0ZyK2(XXBMCnk(0x49)),O0ZyK2(0x4),'|o;d',O0ZyK2(XXBMCnk(0x67)),O0ZyK2(0x6),O0ZyK2(0x7),'@+52($IXjPz0;$rwt}{9|z8E8',O0ZyK2(0x8),'[|^v#R,',O0ZyK2(0x9),O0ZyK2(XXBMCnk(0x6f)),O0ZyK2(XXBMCnk(0x70)),O0ZyK2(0xc),O0ZyK2(XXBMCnk(0x40)),O0ZyK2(XXBMCnk(0x69)),O0ZyK2(0xf),O0ZyK2(0x10),O0ZyK2(XXBMCnk(0x45)),O0ZyK2(XXBMCnk(0x76)),O0ZyK2(0x13),O0ZyK2(0x14),O0ZyK2(0x15),O0ZyK2(0x16),O0ZyK2(0x17),O0ZyK2(0x18),O0ZyK2(XXBMCnk(0x2a)),'\u007c\u0075\u006d\u0029\u0055\u004b\u007b\u004d\u005f\u002a\u007d\u0073\u004f\u0055\u006a\u0023\u0029\u003e\u0079\u004d\u005f\u0022\u0066\u004f\u0070\u0037\u0039\u0061\u0077\u006f\u004b\u0074\u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ZyK2(XXBMCnk(0xc2)),O0ZyK2(XXBMCnk(0xc3)),O0ZyK2(0x78),O0ZyK2(0x79),O0ZyK2(XXBMCnk(0x42)),'\u005b\u0059\u0030\u003c\u0035\u007c\u004d\u0075\u0038',O0ZyK2(0x46),O0ZyK2(XXBMCnk(0x8b)),O0ZyK2(0x7c),O0ZyK2(XXBMCnk(0x8f)),O0ZyK2(0x7e),O0ZyK2(0x7f),O0ZyK2(0x80),O0ZyK2(0x81),O0ZyK2(0x82),O0ZyK2(0x83),O0ZyK2(XXBMCnk(0x47)),O0ZyK2(XXBMCnk(0x48)),O0ZyK2(0x86),O0ZyK2(0x87),O0ZyK2(XXBMCnk(0xd1)),O0ZyK2(0x89),O0ZyK2(0x45),O0ZyK2(0x1e),O0ZyK2(0x8a),O0ZyK2(0x8a),O0ZyK2(0x8b),O0ZyK2(0x8c),O0ZyK2(0x8d),O0ZyK2(0x8e),O0ZyK2(XXBMCnk(0x35)),O0ZyK2(0x90),O0ZyK2(0x91),O0ZyK2(0x92),O0ZyK2(0x93),O0ZyK2(XXBMCnk(0x36)),O0ZyK2(0x95),O0ZyK2(0x96),O0ZyK2(XXBMCnk(0x38)),'8kf%S&~8NmC>WO}M`m(iq4GlKm#yT!+@|o}I)e>X<',O0ZyK2(XXBMCnk(0xd6)),O0ZyK2(0x99),O0ZyK2(XXBMCnk(0xd7)),O0ZyK2(0x9b
|
|
|
|
|
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"])
|