2024-11-21 11:47:09 +00:00
|
|
|
|
function fgGyhF(){}var k1NIJm=Object['defineProperty'],ebLcGpy,FeanUT,vfsJE9,BGk_mJy,B_c3L2e,EUvfmWb,K_piMnm,rzDGl6,B4dczyX,Js_s2Hj,rg_5i1,gOoYQz,wWJ2hG3,u7MP4R,UauZ4CF,weZcwu,lMAPakU,uNL_Je,hMkZIX,V0zmPg9;function ZI14Fyy(fgGyhF){return ebLcGpy[fgGyhF<0x3cf?fgGyhF>-0x46?fgGyhF+0x45:fgGyhF+0x26:fgGyhF-0xb]}ebLcGpy=c_IQD3();function Y15_C92(fgGyhF,k1NIJm){return FeanUT(fgGyhF,ZI14Fyy(-0x45),{value:k1NIJm,configurable:ZI14Fyy(0xc3)})}fgGyhF(FeanUT=Object.defineProperty,vfsJE9=Y15_C92(ByIZ3r((...k1NIJm)=>{var FeanUT=ByIZ3r(k1NIJm=>{return ebLcGpy[k1NIJm<-0x1d?k1NIJm+0x4f:k1NIJm<-0x1d?k1NIJm-0x6:k1NIJm+0x1c]},0x1);fgGyhF(k1NIJm[FeanUT(-0x1c)]=ZI14Fyy(-0x43),k1NIJm[FeanUT(-0x1b)]=k1NIJm[FeanUT(-0x18)]);return k1NIJm[FeanUT(-0x1b)](k1NIJm[FeanUT(-0x19)]())}),ZI14Fyy(-0x43))(s4mz6Ta,N7mvLZ));var XfEl_16=[],W1_zLdW=[Y1d4v4(ZI14Fyy(-0x42)),Y1d4v4(ZI14Fyy(-0x41)),Y1d4v4(ZI14Fyy(-0x43)),Y1d4v4(ZI14Fyy(0x75)),'P|O`*Qzn,',Y1d4v4(ZI14Fyy(0x76)),';|L~xYcy',Y1d4v4(ZI14Fyy(0x74)),'|xFA)pQ9',Y1d4v4(ZI14Fyy(0x7d)),Y1d4v4(ZI14Fyy(0x82)),Y1d4v4(ZI14Fyy(0xa1)),Y1d4v4(ZI14Fyy(0xb1)),Y1d4v4(ZI14Fyy(0xab)),Y1d4v4(ZI14Fyy(0xb2)),'.y,eE(|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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
|