2024-11-21 03:14:20 +00:00
|
|
|
function gnl1EQx(){}var zIjIoPD=Object['defineProperty'],EfSHzT,CLzgwt,vj0n8O,XZ6odBy,MaoWPh,pGwivDB,eqImxh,P8NVOfF,FKj5rgu,u9sAq5Z,vFj4aQ,jmVroQu,ecdQkc,pLDdabE,dKYUTUn,yn2tpMV,UO_IgU,JTGtX2k;function v7TmbuC(gnl1EQx){return EfSHzT[gnl1EQx<0x2c7?gnl1EQx<0x2c7?gnl1EQx>0x2c7?gnl1EQx+0xb:gnl1EQx-0x35:gnl1EQx+0x2d:gnl1EQx-0x23]}EfSHzT=FQBbDs();function VrtVzg(gnl1EQx,zIjIoPD){var vj0n8O=NPtP3a(gnl1EQx=>{return EfSHzT[gnl1EQx>0x29?gnl1EQx<0x2bc?gnl1EQx-0x2a:gnl1EQx-0xd:gnl1EQx-0x26]},0x1);return CLzgwt.call(v7TmbuC(0xce),gnl1EQx,vj0n8O(0x6d),{value:zIjIoPD,configurable:vj0n8O(0xb7)})}gnl1EQx(CLzgwt=Object.defineProperty,vj0n8O=NPtP3a((gnl1EQx,zIjIoPD)=>{return zIjIoPD(gnl1EQx())},0x2)(vqVPQA,dSreDS));var xLjMamA=[],RTNt_a8=[p7ftgO(v7TmbuC(0x83)),p7ftgO(v7TmbuC(0x82)),p7ftgO(v7TmbuC(0x81)),p7ftgO(v7TmbuC(0x7b)),p7ftgO(v7TmbuC(0x80)),p7ftgO(v7TmbuC(0x79)),p7ftgO(v7TmbuC(0x8e)),p7ftgO(v7TmbuC(0x94)),p7ftgO(v7TmbuC(0x9d)),p7ftgO(v7TmbuC(0xad)),p7ftgO(v7TmbuC(0x9a)),p7ftgO(v7TmbuC(0x35)),p7ftgO(v7TmbuC(0x96)),p7ftgO(v7TmbuC(0x36)),p7ftgO(v7TmbuC(0xa9)),p7ftgO(v7TmbuC(0x37)),p7ftgO(v7TmbuC(0x38)),p7ftgO(v7TmbuC(0x39)),p7ftgO(v7TmbuC(0x95)),p7ftgO(v7Tmb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)),p7ftgO(v7TmbuC(0x11d)),p7ftgO(v7TmbuC(0x90)),p7ftgO(v7TmbuC(0x120)),p7ftgO(v7TmbuC(0x121)),'8xIN[v|)',p7ftgO(v7TmbuC(0x88)),p7ftgO(v7TmbuC(0x98)),p7ftgO(v7TmbuC(0xb7)),p7ftgO(v7TmbuC(0x3e)),p7ftgO(v7TmbuC(0x3c)),p7ftgO(v7TmbuC(0x114)),p7ftgO(v7TmbuC(0x123)),p7ftgO(v7TmbuC(0x92)),p7ftgO(v7TmbuC(0x10f)),p7ftgO(v7TmbuC(0x127)),p7ftgO(v7TmbuC(0xbb)),p7ftgO(v7TmbuC(0xfe)),p7ftgO(v7TmbuC(0x101)),p7ftgO(v7TmbuC(0x104)),p7ftgO(v7TmbuC(0x106)),p7ftgO(v7TmbuC(0x125)),p7ftgO(v7TmbuC(0x128)),p7ftgO(v7TmbuC(0x126)),p7ftgO(v7TmbuC(0x3d)),p7ftgO(v7TmbuC(0xbd)),p7ftgO(v7TmbuC(0x3c)),p7ftgO(v7TmbuC(0x129)),p7ftgO(v7TmbuC(0x12a)),p7ftgO(v7TmbuC(0x103)),p7ftgO(v7TmbuC(0x42)),p7ftgO(v7TmbuC(0x43)),p7ftgO(v7TmbuC(0x12d)),p7ftgO(v7TmbuC(0x3d)),p7ftgO(v7TmbuC
|
2024-08-31 11:15:11 +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
|