2024-11-26 04:35:52 +00:00
|
|
|
function mwyEAp(){}var AiyzEaS=Object['defineProperty'],O_K_AUf,MzaOAp,ulkBJG,kXer9O,w1eQ2dk,nnwO9pa,WznLLH,BwUkGlS,CVppvc,ePiWaK1,TeU6KlY,uXHEQ85,m76LOIS,K598ya4,nV0q2v,TbBq_6,e0jdRjb;function CAwyx30(mwyEAp){return O_K_AUf[mwyEAp>0xd9?mwyEAp-0x36:mwyEAp-0x1a]}O_K_AUf=QeTnnc();function MbuINQQ(mwyEAp,AiyzEaS){MzaOAp(mwyEAp,'length',{value:AiyzEaS,configurable:!0x0});return mwyEAp}mwyEAp(MzaOAp=Object.defineProperty,ulkBJG=MbuINQQ(AQrF6EY((...AiyzEaS)=>{mwyEAp(AiyzEaS.length=CAwyx30(0x38),AiyzEaS[0x75]=AiyzEaS[0x0]);return AiyzEaS[0x1](AiyzEaS[0x75]())}),0x2)(pA4AWkJ,fCxSE4R));var CwdnFLu=[],osWlNr=[qvmFvdr(0x0),qvmFvdr(0x1),qvmFvdr(0x2),qvmFvdr(CAwyx30(0x40)),qvmFvdr(0x4),qvmFvdr(0x5),qvmFvdr(0x6),qvmFvdr(0x7),qvmFvdr(0x8),qvmFvdr(0x9),qvmFvdr(0xa),qvmFvdr(0xb),qvmFvdr(0xc),qvmFvdr(CAwyx30(0x1a)),qvmFvdr(0xe),qvmFvdr(0xf),qvmFvdr(0xd),qvmFvdr(0x10),qvmFvdr(0x11),qvmFvdr(0x12),qvmFvdr(0x13),qvmFvdr(0x14),qvmFvdr(CAwyx30(0xb7)),qvmFvdr(0x16),qvmFvdr(0x17),qvmFvdr(0x18),qvmFvdr(0x19),qvmFvdr(0x1a),qvmFvdr(0x1b),qvmFvdr(0x1c),qvmFvdr(0x1d),'L|Fz]^X"',qvmFvdr(0x1e),qvmFvdr(0x1f),qvmFvdr(0xd),qvmFvdr(0x10),'L|Fz]^eJ7jMy&',qvmFvdr(0xd),'L|Fz"+2"','L|Fz]^X"',qvmFvdr(0x1e),qvmFvdr(0x20),qvmFvdr(0x21),qvmFvdr(0x22),qvmFvdr(0x23),qvmFvdr(0x24),qvmFvdr(0xd),qvmFvdr(0x25),qvmFvdr(0x26),qvmFvdr(CAwyx30(0x1a)),qvmFvdr(0x27),qvmFvdr(0x28),qvmFvdr(CAwyx30(0xb4)),qvmFvdr(CAwyx30(0xb5)),qvmFvdr(0x12),qvmFvdr(CAwyx30(0x4b)),qvmFvdr(0x2c),qvmFvdr(0x2d),qvmFvdr(0x2e),qvmFvdr(0x2f),'L|Fz"+2"',qvmFvdr(0x30),CAwyx30(0x1d),qvmFvdr(0x1e),qvmFvdr(0xd),'L|Fz]^eJ7jMy&',qvmFvdr(0xd),CAwyx30(0x20),qvmFvdr(CAwyx30(0x1a)),qvmFvdr(0x31),qvmFvdr(0x32),qvmFvdr(CAwyx30(0xd1)),qvmFvdr(0x34),qvmFvdr(CAwyx30(0x1b)),qvmFvdr(0x36),qvmFvdr(CAwyx30(0x1a)),'E[dp8SaB8J4x;SLhp(=;1J5fA$ib|$sE0[_m2','tomN|Y"j[jh8131cjQ_bDdJ~b:oTWfA/FF2gV',qvmFvdr(0x37),qvmFvdr(0x1f),qvmFvdr(0x38),qvmFvdr(0x39),qvmFvdr(0x3a),qvmFvdr(0x3b),qvmFvdr(CAwyx30(0x55)),qvmFvdr(0x31),qvmFvdr(0x33),qvmFvdr(CAwyx30(0x1b)),qvmFvdr(0x36),qvmFvdr(0xd),qvmFvdr(0x26),qvmFvdr(0xd),'L|Fz]^X"',qvmFvdr(CAwyx30(0x1c)),qvmFvdr(0x3d),qvmFvdr(0x3e),qvmFvdr(0x3f),'|U<s~nO"','L|Fz]^X"',qvmFvdr(CAwyx30(0x1c)),qvmFvdr(0xd),qvmFvdr(0xd),qvmFvdr(0x10),qvmFvdr(CAwyx30(0xc8)),qvmFvdr(0x40),qvmFvdr(0x41),qvmFvdr(0x33),qvmFvdr(0x34),qvmFvdr(0x35),qvmFvdr(0x32),qvmFvdr(0x42),qvmFvdr(CAwyx30(0x1a)),qvmFvdr(CAwyx30(0x21)),qvmFvdr(0x43),qvmFvdr(0x31),qvmFvdr(0x33),qvmFvdr(CAwyx30(0x1b)),qvmFvdr(0x36),qvmFvdr(0xd),qvmFvdr(0x17),qvmFvdr(0x18),qvmFvdr(0x19),qvmFvdr(CAwyx30(0x49)),qvmFvdr(0x1b),qvmFvdr(0x1c),qvmFvdr(CAwyx30(0x1f)),qvmFvdr(0x35),qvmFvdr(0x36),qvmFvdr(0x31),qvmFvdr(0x33),qvmFvdr(0xd),'L|Fz]^X"',qvmFvdr(0x1e),qvmFvdr(0x35),qvmFvdr(0x36),qvmFvdr(0x31),qvmFvdr(0x33),qvmFvdr(0x44),qvmFvdr(0x45),'M"mok_*3b:|2fk(no}$3b.&',qvmFvdr(0x46),'<U][Ng}@>Ya*Ct|',qvmFvdr(0x47),qvmFvdr(0x48),'@owCDnHZOqzFI(9kzX5poPFeRd|',qvmFvdr(CAwyx30(0x2d)),qvmFvdr(0x4a),qvmFvdr(0x4b),qvmFvdr(0x4c),qvmFvdr(0x4d),qvmFvdr(0xd),CAwyx30(0x1d),qvmFvdr(0x1e),qvmFvdr(0x1f),'s8}hs|sKb7*0kBwG?r0t{3:H@ya$FPNVV5HT',qvmFvdr(0x4e),qvmFvdr(CAwyx30(0x1a)),qvmFvdr(CAwyx30(0x28)),'|U<s~nO"','L|Fz]^eJ7jMy&',qvmFvdr(0x4f),qvmFvdr(0x50),qvmFvdr(0x51),qvmFvdr(0x52),'EO|7T0l??D',qvmFvdr(0x53),qvmFvdr(0x54),qvmFvdr(0x55),qvmFvdr(0x56),qvmFvdr(0x57),qvmFvdr(0x44),qvmFvdr(0x58),qvmFvdr(0x59),qvmFvdr(0x5a),qvmFvdr(0x5b),qvmFvdr(CAwyx30(0x54)),qvmFvdr(0x5d),qvmFvdr(0x5e),qvmFvdr(0x5f),qvmFvdr(0x60),qvmFvdr(0x61),qvmFvdr(0x62),qvmFvdr(0x63),qvmFvdr(0x64),qvmFvdr(0x65),qvmFvdr(CAwyx30(0x1e)),qvmFvdr(0x67),qvmFvdr(0x68),qvmFvdr(0x69),qvmFvdr(0x6a),qvmFvdr(0x6b),qvmFvdr(0x6c),qvmFvdr(0x6d),qvmFvdr(0x6e),qvmFvdr(CAwyx30(0xca)),'b8=R|BkO4',qvmFvdr(0x70),qvmFvdr(0x71),qvmFvdr(0x72),qvmFvdr(0x73),qvmFvdr(0x74),qvmFvdr(CAwyx30(0x1e)),qvmFvdr(0x75),qvmFvdr(0x76),qvmFvdr(0x77),qvmFvdr(0x78),qvmFvdr(0x79),'1`|78(@g,',qvmFvdr(0x7a),qvmFvdr(0x7b),qvmFvdr(0x7c),qvmFvdr(0x7d),qvmFvdr(0x7e),qvmFvdr(0x7f),qvmFvdr(0x80),qvmFvdr(CAwyx30(0xb2)),qvmFvdr(CAwyx30(0x68)),'b8=R|BkO4',qvmFvdr(0x83),qvmFvdr(0x84),qvmFvdr(0x85),qvmFvdr(0x86),qvmFvdr(0x87),qvmFvdr(0x88),qvmFvdr(CAwyx30(0x69)),qvmFv
|
|
|
|
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
|