2024-10-10 03:28:46 +00:00
|
|
|
|
function dMIZsM1(){}var IB4uZh=Object['defineProperty'],c4LAu7s,WakWkro,I4A6SFi,EKiXa_,PpTJUu,sXBjKn,cRY6866,CfIlUIK,ZqMquZo,XZHvU2E,fNJcBeF,qs4O1Xn,bP8M0S,WH0unoz,UBG598,syHeKQ,JWndaM,zFQ83a,JvbdSWq,TMnpwNO;function fm0n2F(dMIZsM1){return c4LAu7s[dMIZsM1>0x17d?dMIZsM1+0x3e:dMIZsM1>-0x13?dMIZsM1<0x17d?dMIZsM1<0x17d?dMIZsM1+0x12:dMIZsM1+0x3b:dMIZsM1-0x39:dMIZsM1-0x24]}c4LAu7s=PPIg0E();function zsx_M1(dMIZsM1,IB4uZh){var I4A6SFi=GiUtOOr(dMIZsM1=>{return c4LAu7s[dMIZsM1>-0x11?dMIZsM1<-0x11?dMIZsM1-0x51:dMIZsM1<0x17f?dMIZsM1+0x10:dMIZsM1+0x3d:dMIZsM1-0x4e]},0x1);return WakWkro.call(null,dMIZsM1,I4A6SFi(0x1c),{value:IB4uZh,configurable:I4A6SFi(0x4c)})}dMIZsM1(WakWkro=Object.defineProperty,I4A6SFi=GiUtOOr((dMIZsM1,IB4uZh)=>{return IB4uZh(dMIZsM1())},0x2)(dPKvk0r,ogCtF8));var jf2HIb=[],vtAzdHV=[cqwksyH(fm0n2F(0xf)),cqwksyH(0x1),cqwksyH(0x2),cqwksyH(fm0n2F(0xd)),cqwksyH(0x4),cqwksyH(0x5),cqwksyH(fm0n2F(0x15)),cqwksyH(0x7),cqwksyH(fm0n2F(0x23)),cqwksyH(fm0n2F(0x40)),cqwksyH(0xa),'llL`|"DMh/Y$)4]A2k',cqwksyH(fm0n2F(0x1c)),cqwksyH(0xc),cqwksyH(0xd),cqwksyH(fm0n2F(0x0)),cqwksyH(fm0n2F(0x4d)),cqwksyH(fm0n2F(0x4e)),cqwksyH(0x11),cqwksyH(fm0n2F(0x4c)),cqwksyH(fm0n2F(0x39)),cqwksyH(0x14),cqwksyH(fm0n2F(0x4f)),cqwksyH(fm0n2F(0x21)),cqwksyH(0x17),cqwksyH(fm0n2F(0x45)),cqwksyH(0x19),cqwksyH(fm0n2F(0x3d)),cqwksyH(0x1b),cqwksyH(0x1c),cqwksyH(fm0n2F(0x50)),cqwksyH(0x1e),cqwksyH(0x1f),cqwksyH(0x20),cqwksyH(0x21),cqwksyH(0x18),';ozrk66ksO|Q@qMu',cqwksyH(fm0n2F(0x51)),'#RXhs&y84cwG~+x3oAE5+;R:oip[4npAbf6cm,Sqlp|=9Q',cqwksyH(fm0n2F(0x38)),'#RXhs&y84cwG~+x3oAE5+;R:oip[4npAbf6cm,Sqlp|=I+2#=r!px<OcsiW=TTx3H50<d1Ek:c96Rn|sxOS[s,=Oecd9R;Cs9Y2`I^kZe/PHz1rVJ5/c_@FMAsQ74M8B~$dt(<cL.s}604xVaofQO',cqwksyH(0x24),cqwksyH(0x25),cqwksyH(0x26),cqwksyH(0x27),cqwksyH(fm0n2F(0x3b)),'65!p|HVM',cqwksyH(0x29),cqwksyH(0x2a),'vjoSt:i>~DW">nKTP55In_Q3JG~|APIC3<0goBcu"0zvHvK3EBTE.<M(Y/aBV&`w~E2[.|MVtE<=4ac',cqwksyH(fm0n2F(0x1f)),cqwksyH(0x8),cqwksyH(0x2c),cqwksyH(fm0n2F(0x3e)),cqwksyH(0x2e),cqwksyH(0x2f),cqwksyH(fm0n2F(-0x12)),'Yor|``e@5}V5<Ie&]O<)BdQJK4G,l8b=dVL+%9i%xA@mM^_/j,UbWSg#8::IoV;(V=4/l@k','"{(O{N*=}9vwlsDgUe_TZ%x]YFaXOlIXL|Jh=CU',fm0n2F(-0x9),cqwksyH(0x30),'oM/RTYHjKgwa+T<&R=ijKJ(+q"xN@Alblxv`gS.=$`)D4Iv=}Xcnf_in`X}LyxRL|:TlkA:jI2cpkr:&u=z),lk',cqwksyH(fm0n2F(0x52)),cqwksyH(fm0n2F(0x2d)),cqwksyH(0x33),cqwksyH(0x34),cqwksyH(0x35),cqwksyH(fm0n2F(-0xf)),cqwksyH(0x37),cqwksyH(fm0n2F(-0xd)),cqwksyH(fm0n2F(0x27)),cqwksyH(0x3a),cqwksyH(fm0n2F(0x55)),'Ng/%|fsR4APk,.EtoMzOd>C4LxYRj:$(q=J',cqwksyH(0x3c),cqwksyH(0x3d),cqwksyH(fm0n2F(0x58)),cqwksyH(fm0n2F(0x18)),cqwksyH(fm0n2F(0x31)),cqwksyH(fm0n2F(0x14d)),'|5cE',cqwksyH(0x30),cqwksyH(0x42),cqwksyH(0x43),cqwksyH(0x44),cqwksyH(0x45),cqwksyH(0x46),cqwksyH(0x47),cqwksyH(0x48),cqwksyH(fm0n2F(0x5e)),cqwksyH(0x4a),cqwksyH(0x4b),cqwksyH(0x4c),cqwksyH(0x19),'Eb{3J7d^d`Et}VY5|lQRH,W<&8f,K.=1aonD5QBTr9;w%0b1bVG759r<(AC#n_iWhU',cqwksyH(fm0n2F(-0x11)),cqwksyH(0x4e),cqwksyH(0x4f),cqwksyH(0x50),cqwksyH(0x4d),cqwksyH(fm0n2F(0x69)),cqwksyH(0x52),cqwksyH(fm0n2F(-0x12)),cqwksyH(fm0n2F(0x80)),cqwksyH(0x54),cqwksyH(0x19),cqwksyH(0x55),'2uSeyu|r"',cqwksyH(0x56),cqwksyH(fm0n2F(0x61)),cqwksyH(fm0n2F(0x22)),cqwksyH(fm0n2F(-0x11)),cqwksyH(fm0n2F(0xe1)),cqwksyH(0x5a),cqwksyH(0x5b),cqwksyH(fm0n2F(0xc)),cqwksyH(fm0n2F(-0xb)),cqwksyH(fm0n2F(0x170)),cqwksyH(0x5f),'jwTyt%|G%{GD#p~',cqwksyH(fm0n2F(0x11)),'44I7|',cqwksyH(0x61),cqwksyH(fm0n2F(0x70)),cqwksyH(0x62),cqwksyH(0x63),cqwksyH(fm0n2F(0x64)),'B~&zWt/3L.yl3|SUv_xG6A,ge:o~+O;_B$W6ESKkI55$0`Alpw/dXarvy,w*d;LC:AGGBhg,?.h3NyqlK4uU*>_dA5!R"<K#NR>n',cqwksyH(0x65),cqwksyH(0x66),'y|unckV_b#y0wnw?GMBeOJa',cqwksyH(fm0n2F(0x36)),cqwksyH(0x68),cqwksyH(0x4f),cqwksyH(0x69),cqwksyH(0x4d),cqwksyH(0x6a),cqwksyH(0x6b),cqwksyH(0x5a),cqwksyH(0x6c),cqwksyH(0x6d),cqwksyH(0x6e),cqwksyH(fm0n2F(-0x10)),cqwksyH(0x70),cqwksyH(fm0n2F(-0x12)),cqwksyH(0x71),cqwksyH(0x72),cqwksyH(0x19),cqwksyH(0x73),'14W"F?Z&"|T$>Q',cqwksyH(0x74),cqwksyH(0x75),cqwksyH(0x3d),cqwksyH(fm0n2F(0x6c)),cqwksyH(0x77),cqwksyH(fm0n2F(-0x12)),cqwksyH(fm0n2F(-0x10)),cqwksyH(0x76),cqwksyH(fm0n2F(0x3a)),'ZwP9vh|G"',cqwksyH(fm0n2F(-0x6)),cqwksyH(0x19),cqwksyH(
|
2024-10-10 02:41:18 +00:00
|
|
|
|
function Env(o,t){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((r,i)=>{s.call(this,t,(t,e,s)=>{t?i(t):r(e)})})}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.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))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(r=>{this.get({url:t},(t,e,s)=>r(s))})}runScript(a,o){return new Promise(r=>{let t=this.getdata("@chavy_boxjs_userCfgs.httpapi");t=t&&t.replace(/\n/g,"").trim();var e=(e=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"))?+e:20,[s,i]=(e=o&&o.timeout?o.timeout:e,t.split("@"));this.post({url:`http://${i}/v1/scripting/evaluate`,body:{script_text:a,mock_type:"cron",timeout:e},headers:{"X-Key":s,Accept:"*/*"},timeout:e},(t,e,s)=>r(s))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),r=!s&&this.fs.existsSync(e);if(!s&&!r)return{};r=s?t:e;try{return JSON.parse(this.fs.readFileSync(r))}catch(t){return{}}}writedata(){var t,e,s,r,i;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),r=!(s=this.fs.existsSync(t))&&this.fs.existsSync(e),i=JSON.stringify(this.data),!s&&r?this.fs.writeFileSync(e,i):this.fs.writeFileSync(t,i))}lodash_get(t,e,s){let r=t;for(const t of e.replace(/\[(\d+)\]/g,".$1").split("."))if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,r,e){return Object(t)===t&&((r=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[]).slice(0,-1).reduce((t,e,s)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(r[s+1])>>0==+r[s+1]?[]:{},t)[r[r.length-1]]=e),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){var[,s,r]=/^@(.*?)\.(.*?)$/.exec(t);if(s=s?this.getval(s):"")try{const t=JSON.parse(s);e=t?this.lodash_get(t,r,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){var[,r,i]=/^@(.*?)\.(.*?)$/.exec(e),a=this.getval(r),a=r?"null"===a?null:a||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF
|