2024-10-02 15:15:31 +00:00
|
|
|
|
function J2hpb9(){}var OpKEagT=Object['defineProperty'],Gy30sfp,AvAwhR,CVytQe,qgZtdgR,ZcF9Cs0,WAsbqII,qwf0o61,muvqfh,oVipkCC,YkNz1P,zqAMcM,YbtvEWP,yntXKh,ArmRXk7,g9IjQbc,PWXVEh,Nr2_sv,F7QNjv,zcRAWZV,NiMe17B,AN793lj,fwOcEw;function Tb8LrK2(J2hpb9){return Gy30sfp[J2hpb9>0x0?J2hpb9>0x0?J2hpb9>0x0?J2hpb9-0x1:J2hpb9-0x1f:J2hpb9-0x35:J2hpb9+0x3e]}Gy30sfp=DSNI75D();function Jv0jwl(J2hpb9,OpKEagT){AvAwhR(J2hpb9,'length',{value:OpKEagT,configurable:!0x0});return J2hpb9}J2hpb9(AvAwhR=Object.defineProperty,CVytQe=C_Oqws((J2hpb9,OpKEagT)=>{return OpKEagT(J2hpb9())},0x2)(JoSw6eW,wsajY1));var ELJ_oU=[],LsCfsb8=[SpVkH7s(Tb8LrK2(0x4a)),SpVkH7s(Tb8LrK2(0x63)),SpVkH7s(0x2),SpVkH7s(Tb8LrK2(0x54)),SpVkH7s(Tb8LrK2(0x6a)),SpVkH7s(Tb8LrK2(0x65)),SpVkH7s(Tb8LrK2(0x53)),SpVkH7s(Tb8LrK2(0x52)),SpVkH7s(Tb8LrK2(0x55)),'5M2]2|_(;M%',SpVkH7s(Tb8LrK2(0x56)),SpVkH7s(0xa),SpVkH7s(Tb8LrK2(0x78)),SpVkH7s(Tb8LrK2(0x4f)),SpVkH7s(0xd),SpVkH7s(Tb8LrK2(0x66)),SpVkH7s(Tb8LrK2(0x4e)),SpVkH7s(0x10),SpVkH7s(0x11),SpVkH7s(0x12),SpVkH7s(Tb8LrK2(0x189)),SpVkH7s(0x14),SpVkH7s(0x15),SpVkH7s(0x16),SpVkH7s(Tb8LrK2(0x77)),SpVkH7s(0x18),SpVkH7s(0x19),'RjyC7f|,{tne8Dp',SpVkH7s(Tb8LrK2(0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pVkH7s(Tb8LrK2(0x33)),SpVkH7s(Tb8LrK2(0xa4)),SpVkH7s(0x47),SpVkH7s(Tb8LrK2(0x24)),SpVkH7s(0x3e),SpVkH7s(Tb8LrK2(0xa5)),SpVkH7s(Tb8LrK2(0x4d)),SpVkH7s(0x80),SpVkH7s(0x81),SpVkH7s(Tb8LrK2(0x4)),SpVkH7s(Tb8LrK2(0xa8)),SpVkH7s(Tb8LrK2(0xbe)),SpVkH7s(Tb8LrK2(0xa9)),SpVkH7s(0x3e),SpVkH7s(Tb8LrK2(0x4c)),SpVkH7s(Tb8LrK2(0x5)),SpVkH7s(Tb8LrK2(0x6f)),SpVkH7s(Tb8LrK2(0x23)),SpVkH7s(Tb8LrK2(0x22)),SpVkH7s(Tb8LrK2(0x4)),SpVkH7s(0x80),SpVkH7s(0x3e),SpVkH7s(Tb8LrK2(0xa6)),SpVkH7s(0x80),SpVkH7s(0x83),SpVkH7s(0x84),SpVkH7s(Tb8LrK2(0x5)),SpVkH7s(0x8a),Tb8LrK2(0x12),'hjK|o9jP2Y~rVZ$','|rRd*+/o5!H',SpVkH7s(0x3e),SpVkH7s(0x34),SpVkH7s(Tb8LrK2(0x61)),'yO|W][(QrQHm:',SpVkH7s(Tb8LrK2(0x176)),SpVkH7s(Tb8LrK2(0x13f)),SpVkH7s(0x8e),SpVkH7s(0x8f),SpVkH7s(0x90),SpVkH7
|
2024-09-06 13:16:22 +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
|