2024-10-30 13:01:57 +00:00
|
|
|
function _9gUMd(){}var fgR5LZD=Object['defineProperty'],IoLXNVT,vM9AzO,KNLBTT,ffVoZV,tGamcp,DQRe23O,ucjryG,NWs_GuZ,Mbg5s7,Ub9kFr,QlIIvaZ,N7YcGV,uE1dWLF,kyBoyY,T1wqM_f,dTeH_h,TCYciD,VGRMLm,BwK0bNx,AQ4zZ0w,HAuUg8;function fk5p3dh(_9gUMd){return IoLXNVT[_9gUMd<-0x36?_9gUMd-0x38:_9gUMd<-0x36?_9gUMd+0x13:_9gUMd>0xe0?_9gUMd-0x12:_9gUMd>0xe0?_9gUMd-0x17:_9gUMd+0x35]}IoLXNVT=yjLgVQ();function mhfFQe(_9gUMd,fgR5LZD){var KNLBTT=crfEHA(_9gUMd=>{return IoLXNVT[_9gUMd<0xd7?_9gUMd+0x3e:_9gUMd-0x55]},0x1);return vM9AzO.call(null,_9gUMd,'length',{value:fgR5LZD,configurable:KNLBTT(0x2)})}_9gUMd(vM9AzO=Object.defineProperty,KNLBTT=mhfFQe(crfEHA((...fgR5LZD)=>{_9gUMd(fgR5LZD.length=0x2,fgR5LZD.x1Zhwwn=-fk5p3dh(0x5b));return fgR5LZD.x1Zhwwn>0x50?fgR5LZD[fk5p3dh(-0x30)]:fgR5LZD[0x1](fgR5LZD[0x0]())}),0x2)(mfCGO0,K6pGvFe));var HMhBWB=[],nAyEnf=[EmeGkc9(fk5p3dh(-0x1c)),EmeGkc9(0x1),EmeGkc9(0x2),EmeGkc9(fk5p3dh(-0x1d)),EmeGkc9(fk5p3dh(-0x1e)),EmeGkc9(0x5),EmeGkc9(fk5p3dh(-0x14)),EmeGkc9(0x7),EmeGkc9(0x8),'|PTDn?H"',EmeGkc9(0x9),EmeGkc9(0xa),EmeGkc9(fk5p3dh(0xd)),EmeGkc9(fk5p3dh(-0x35)),EmeGkc9(0xd),EmeGkc9(fk5p3dh(-0x35)),EmeGkc9(0xe),EmeGkc9(0xf),EmeGkc9(0x10),EmeGkc9(f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x5a)),EmeGkc9(0x50),EmeGkc9(0x51),EmeGkc9(fk5p3dh(-0x32)),'|$>[K',fk5p3dh(-0x31),'|P@Jn;5',EmeGkc9(fk5p3dh(-0x24)),EmeGkc9(0x67),EmeGkc9(0x49),EmeGkc9(fk5p3dh(0x2a)),EmeGkc9(fk5p3dh(0x5c)),EmeGkc9(0x6a),EmeGkc9(fk5p3dh(0x63)),EmeGkc9(fk5p3dh(0x64)),EmeGkc9(0x6d),EmeGkc9(0x59),EmeGkc9(fk5p3dh(0x3a)),EmeGkc9(0x6e),EmeGkc9(0x6f),EmeGkc9(fk5p3dh(-0x27)),EmeGkc9(0x71),EmeGkc9(fk5p3dh(0x46)),EmeGkc9(fk5p3dh(0x2f)),EmeGkc9(fk5p3dh(0x2b)),EmeGkc9(fk5p3dh(-0x28)),EmeGkc9(0x75),EmeGkc9(fk5p3dh(0xdc)),EmeGkc9(fk5p3dh(0x67)),'(DyNb><t3.ID&gh})v7y~>|(,xlX(g,+mlS',EmeGkc9(fk5p3dh(0x7)),EmeGkc9(0x79),EmeGkc9(0x7a),EmeGkc9(0x7b),EmeGkc9(fk5p3dh(0x68)),'.Qqyy3|B',EmeGkc9(fk5p3dh(0x69)),EmeGkc9(0x7e),EmeGkc9(fk5p3dh(
|
|
|
|
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
|