2024-12-03 15:07:01 +00:00
|
|
|
|
function JPFdUh(){}var FaDOWSV=Object['defineProperty'],SZ_kRe5,fpdCsrL,qAENzaP,XEWMS_H,iVAZBPn,ppSxgu,N58qhT,Xcnaxsn,Wi4Zmn,IPgVyqo,Nb0cF00,i1qNJER,hQhqkGO,yhD_eTp,s6lMDn,OOoPev,GgsyKM,PGla2v,PQo8K3j,NCCC_m,vkiN8KM,iyO03w,qZ9XMYM,X_9CTD,alUWtU4;function wVVbqtx(JPFdUh){return SZ_kRe5[JPFdUh>0x146?JPFdUh-0x3f:JPFdUh-0x24]}SZ_kRe5=L7XlWzG();function KvTtju(JPFdUh,FaDOWSV){fpdCsrL(JPFdUh,wVVbqtx(0x61),{value:FaDOWSV,configurable:!0x0});return JPFdUh}JPFdUh(fpdCsrL=Object.defineProperty,qAENzaP=CECibEb((JPFdUh,FaDOWSV)=>{return FaDOWSV(JPFdUh())},0x2)(edwlU7S,tG3vd1));var ornEL1=[],RzoIXC=[cV8EqW(0x0),cV8EqW(0x1),cV8EqW(wVVbqtx(0x52)),cV8EqW(wVVbqtx(0x50)),cV8EqW(wVVbqtx(0x51)),cV8EqW(0x5),cV8EqW(0x6),cV8EqW(0x7),cV8EqW(0x8),cV8EqW(0x9),cV8EqW(wVVbqtx(0x58)),cV8EqW(0xb),cV8EqW(wVVbqtx(0x5d)),cV8EqW(0xd),cV8EqW(0xe),cV8EqW(0xf),cV8EqW(0x10),cV8EqW(0x11),cV8EqW(wVVbqtx(0x65)),cV8EqW(wVVbqtx(0x60)),cV8EqW(0x14),cV8EqW(0x15),cV8EqW(wVVbqtx(0x59)),cV8EqW(0x17),cV8EqW(0x18),cV8EqW(0x19),'[|j200"',cV8EqW(0x1a),cV8EqW(0x1b),'WQf<V9<:|Cnt@z',cV8EqW(wVVbqtx(0x72)),cV8EqW(wVVbqtx(0x71)),'m|3WF*"',cV8EqW(0x1e),cV8EqW(0x1f),cV8EqW(wVVbqtx(0x5e)),cV8EqW(0x21),cV8EqW(0x22),cV8EqW(0x23),cV8EqW(wVVbqtx(0x130)),cV8EqW(wVVbqtx(0x131)),cV8EqW(0x26),cV8EqW(0x27),cV8EqW(0x28),cV8EqW(0x29),cV8EqW(0x2a),cV8EqW(0x2b),cV8EqW(0x2c),cV8EqW(wVVbqtx(0x73)),cV8EqW(0x2e),cV8EqW(0x2f),cV8EqW(0x30),cV8EqW(0x31),cV8EqW(0x32),cV8EqW(0x33),cV8EqW(0x34),cV8EqW(0x35),cV8EqW(0x36),cV8EqW(0x37),cV8EqW(0x38),cV8EqW(0x39),cV8EqW(0x3a),cV8EqW(0x3b),cV8EqW(0x3c),cV8EqW(0x3d),cV8EqW(0x3e),cV8EqW(wVVbqtx(0xdc)),cV8EqW(0x40),cV8EqW(0x41),cV8EqW(0x42),cV8EqW(0x43),'$9l@w0^5n>?{tp[4?QJ~9]{1G}:I}m_*V?p2D<qA|S[Unk1qTngTY',cV8EqW(wVVbqtx(0xf4)),cV8EqW(0x45),cV8EqW(0x46),cV8EqW(0x47),'CR5$|#dnh){3pT@&Z$u',cV8EqW(0x48),cV8EqW(0x49),cV8EqW(wVVbqtx(0x74)),cV8EqW(wVVbqtx(0x77)),'1&q>BI@1o|RPxyNo$LGPzZ"','sE83@F[XU,RvB%O?=TCkmOSNS|+6<;$*ONoZO{n~bRr!^~~+o;6zQ&vUKiF@x6S.^U|wSYk>',cV8EqW(wVVbqtx(0x78)),cV8EqW(0x4d),'CR"|a$h)~=/B9Bt|O!',cV8EqW(0x4e),cV8EqW(0x4f),'+|E~9Ov}v',cV8EqW(wVVbqtx(0x7a)),cV8EqW(0x51),cV8EqW(0x52),cV8EqW(0x53),cV8EqW(0x54),cV8EqW(wVVbqtx(0x138)),wVVbqtx(0x2e),'a8CT$f8ys|^g.n+',cV8EqW(wVVbqtx(0x7e)),cV8EqW(wVVbqtx(0x7f)),cV8EqW(wVVbqtx(0x80)),cV8EqW(0x3d),cV8EqW(0x59),cV8EqW(0x5a),cV8EqW(0x5b),cV8EqW(wVVbqtx(0x81)),cV8EqW(0x5d),cV8EqW(0x5e),cV8EqW(0x5f),cV8EqW(0x60),cV8EqW(0x61),'n/ZxP9N|#IqL0',cV8EqW(0x62),cV8EqW(0x63),cV8EqW(0x64),cV8EqW(0x65),cV8EqW(0x66),cV8EqW(wVVbqtx(0x91)),cV8EqW(wVVbqtx(0x6f)),cV8EqW(0x69),cV8EqW(0x6a),cV8EqW(0x6b),cV8EqW(0x6c),cV8EqW(0x6d),wVVbqtx(0x26),cV8EqW(0x61),cV8EqW(0x6e),cV8EqW(0x6f),cV8EqW(0x3e),cV8EqW(0x70),cV8EqW(0x45),cV8EqW(wVVbqtx(0x28)),cV8EqW(0x71),cV8EqW(0x72),cV8EqW(0x73),cV8EqW(0x54),cV8EqW(0x74),cV8EqW(wVVbqtx(0x29)),cV8EqW(0x76),cV8EqW(0x77),cV8EqW(0x78),cV8EqW(0x79),cV8EqW(0x7a),cV8EqW(wVVbqtx(0x2a)),cV8EqW(0x7c),cV8EqW(0x7d),cV8EqW(0x7e),cV8EqW(0x7f),'n[:bp|rA#Z',cV8EqW(0x3d),cV8EqW(0x3e),cV8EqW(0x80),cV8EqW(0x81),cV8EqW(0x82),cV8EqW(0x6f),cV8EqW(0x45),cV8EqW(0x83),cV8EqW(0x45),cV8EqW(0x84),cV8EqW(0x45),cV8EqW(0x85),cV8EqW(0x86),cV8EqW(0x87),cV8EqW(wVVbqtx(0x94)),cV8EqW(0x89),cV8EqW(0x8a),cV8EqW(wVVbqtx(0xa6)),cV8EqW(0x8c),cV8EqW(0x8d),cV8EqW(0x4f),cV8EqW(wVVbqtx(0x33)),cV8EqW(wVVbqtx(0x24)),cV8EqW(wVVbqtx(0x31)),cV8EqW(0x8f),cV8EqW(0x90),cV8EqW(0x91),cV8EqW(wVVbqtx(0x25)),cV8EqW(wVVbqtx(0x96)),cV8EqW(0x94),cV8EqW(0x95),cV8EqW(0x45),cV8EqW(wVVbqtx(0x24)),cV8EqW(0x91),cV8EqW(0x96),cV8EqW(0x93),cV8EqW(wVVbqtx(0x32)),cV8EqW(wVVbqtx(0x25)),cV8EqW(0x97),cV8EqW(0x98),cV8EqW(0x45),cV8EqW(0x99),cV8EqW(0x45),cV8EqW(0x95),cV8EqW(0x91),'.8k@42aA`C5|+z',cV8EqW(0x9a),cV8EqW(0x9b),'a8CT$f8ys|^g.n+',cV8EqW(0x9c),cV8EqW(0x9d),cV8EqW(0x45),cV8EqW(0x3e),cV8EqW(0x9e),cV8EqW(0x9f),cV8EqW(0xa0),cV8EqW(0xa1),cV8EqW(wVVbqtx(0x9b)),'P|k@n',cV8EqW(0xa3),cV8EqW(0xa4),cV8EqW(0xa5),cV8EqW(0xa6),cV8EqW(0xa7),'m|vZ=pcEk+h,9|{QE!',cV8EqW(0xa8),'m|vZn3{u',cV8EqW(0xa9),cV8EqW(0xaa),'Y|}~y',cV8EqW(0xab),cV8EqW(0xac),cV8EqW(0xad),cV8EqW(0xae),cV8EqW(0xaf),cV8EqW(0x8d),cV8EqW(0xb0),cV8EqW(0xb1),cV8EqW(0xb2),cV8EqW(0xb3),cV8EqW(0x45),'I9r]H<a{!X|',cV
|
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
|