2024-09-24 01:54:22 +00:00
|
|
|
|
function _0xF1ECA10(){}var _0xDEBCC39=Object['defineProperty'],_0x00989DD,_0x7CA13EC,_0x056B18,_0x0BAA0DC,_0xC9DDBA3,_0x1D4E7B2,_0x731144C,_0x426E52,_0x30C4F63,_0xCB63F7A,_0xE3EA9F9,_0x63797C,_0xDA73E32,_0x529561,_0xB2E6217,_0xE5054C3,_0x685F4C2,_0x345444E,_0x74892F,_0xFB37E94,_0xB6913D,_0xE09ACAD,_0x809E442;function _0x6180E7(_0xF1ECA10){return _0x00989DD[_0xF1ECA10<0x12?_0xF1ECA10-0x27:_0xF1ECA10-0x13]}_0x00989DD=_0x207C07();function _0x4E82C9(_0xF1ECA10,_0xDEBCC39){var _0x056B18=_0x2576829(_0xF1ECA10=>{return _0x00989DD[_0xF1ECA10>0x10c?_0xF1ECA10+0x1d:_0xF1ECA10>0x32?_0xF1ECA10-0x33:_0xF1ECA10+0x4e]},0x1);return _0x7CA13EC(_0xF1ECA10,'length',{value:_0xDEBCC39,configurable:_0x056B18(0x70)})}_0xF1ECA10(_0x7CA13EC=Object.defineProperty,_0x056B18=_0x4E82C9(_0x2576829((..._0xDEBCC39)=>{_0xF1ECA10(_0xDEBCC39.length=0x2,_0xDEBCC39._0xA18185=0x82);if(_0xDEBCC39._0xA18185>0xb7){return _0xDEBCC39[_0xDEBCC39._0xA18185-0x178]}else{var _0x7CA13EC=_0x2576829(_0xDEBCC39=>{return _0x00989DD[_0xDEBCC39>0xf4?_0xDEBCC39-0x35:_0xDEBCC39>0xf4?_0xDEBCC39+0x64:_0xDEBCC39-0x1b]},0x1);return _0xDEBCC39[0x1](_0xDEBCC39[_0xDEBCC39._0xA18185-_0x7CA13EC(0x21)]())}}),_0x6180E7(0x37))(_0x7DE7914,_0xE8F139));var _0xF4E535=[],_0x466A9DB=[_0x0E1C57(_0x6180E7(0x2b)),_0x0E1C57(_0x6180E7(0x2a)),_0x0E1C57(0x2),_0x0E1C57(0x3),_0x0E1C57(0x4),_0x0E1C57(_0x6180E7(0x4e)),_0x0E1C57(0x6),_0x0E1C57(0x7),_0x0E1C57(_0x6180E7(0x3e)),_0x0E1C57(_0x6180E7(0x39)),_0x0E1C57(0xa),_0x0E1C57(_0x6180E7(0x34)),_0x0E1C57(_0x6180E7(0x32)),_0x0E1C57(_0x6180E7(0x35)),_0x0E1C57(0xe),_0x0E1C57(_0x6180E7(0x30)),_0x0E1C57(0x10),_0x0E1C57(0x11),_0x0E1C57(0x12),_0x0E1C57(0x13),_0x0E1C57(0x14),_0x0E1C57(_0x6180E7(0x52)),_0x0E1C57(0x16),_0x0E1C57(0x17),_0x0E1C57(0x18),_0x0E1C57(_0x6180E7(0x53)),_0x0E1C57(_0x6180E7(0x55)),_0x0E1C57(_0x6180E7(0x56)),_0x0E1C57(0x1c),_0x0E1C57(_0x6180E7(0x57)),_0x0E1C57(0x1e),_0x0E1C57(0x1f),_0x0E1C57(0x20),_0x0E1C57(_0x6180E7(0x5b)),_0x0E1C57(0x22),_0x0E1C57(0x23),_0x0E1C57(_0x6180E7(0x40)),_0x0E1C57(0x25),_0x0E1C57(0x26),_0x0E1C57(_0x6180E7(0x5a)),_0x0E1C57(_0x6180E7(0x5c)),_0x0E1C57(_0x6180E7(0x47)),_0x0E1C57(0x2a),_0x0E1C57(_0x6180E7(0x5f)),_0x0E1C57(0x2c),_0x0E1C57(_0x6180E7(0x4a)),_0x0E1C57(_0x6180E7(0x76)),_0x0E1C57(_0x6180E7(0x61)),_0x0E1C57(0x30),_0x0E1C57(_0x6180E7(0x62)),_0x0E1C57(0x32),_0x0E1C57(0x33),_0x0E1C57(0x34),_0x0E1C57(0x35),_0x0E1C57(0x36),_0x0E1C57(0x1f),_0x0E1C57(_0x6180E7(0x65)),_0x0E1C57(0x38),_0x0E1C57(0x39),_0x0E1C57(_0x6180E7(0x27)),_0x0E1C57(0x3b),'S18K/^oDWM~JR/"iK65DW[LRX&cHKo88##~/d46eZO#Cx`pSlPM&3zUyKOW4@&$y]msm5:PYo$8L~:sin3}8bh%Jowovyv3rap|Lr"RI}','eK;`{i=Ol]fdw"G/faq}KcdnHv|rv!zN_f".y&FL9?Gkl#nFQl4Qj',_0x0E1C57(0x3c),_0x0E1C57(0x3d),_0x0E1C57(0x3e),_0x0E1C57(0x3f),_0x0E1C57(_0x6180E7(0x13)),_0x0E1C57(0x40),_0x0E1C57(0x41),_0x0E1C57(0x20),_0x0E1C57(_0x6180E7(0x29)),'EW|TD?zy7eQH)',_0x0E1C57(0x42),'al$cA.uf|',_0x0E1C57(_0x6180E7(0x66)),_0x0E1C57(0x44),_0x0E1C57(0x45),_0x0E1C57(0x46),_0x0E1C57(_0x6180E7(0x7f)),_0x0E1C57(0x48),_0x0E1C57(0x49),_0x0E1C57(0x4a),_0x0E1C57(0x4b),_0x0E1C57(_0x6180E7(0x14)),_0x0E1C57(_0x6180E7(0x13)),_0x0E1C57(0x4c),'`tpt~7irmqsQ[?Am$2mv6#0NOX?}WMtVH|FkG(.$.tDjP&kos$+K.xS:6,Kr?t=kmQmv6#0NOX?}WMtVH|FkG(.$.tDjP&kos$+K.xS:6,Kr?t=kmQmv6#0NOX?}WMtVH|FkG(.$}',_0x0E1C57(0x4d),_0x0E1C57(_0x6180E7(0x14)),_0x0E1C57(_0x6180E7(0x15)),_0x0E1C57(0x49),_0x0E1C57(_0x6180E7(0x20)),_0x0E1C57(_0x6180E7(0x7a)),'|EZcr<)',_0x6180E7(0x21),_0x0E1C57(0x50),_0x0E1C57(_0x6180E7(0x6d)),_0x0E1C57(_0x6180E7(0x6b)),_0x0E1C57(_0x6180E7(0x22)),'|EZcg<)',_0x0E1C57(_0x6180E7(0x83)),_0x0E1C57(0x55),_0x0E1C57(0x56),_0x0E1C57(0x57),_0x0E1C57(_0x6180E7(0x3f)),_0x0E1C57(_0x6180E7(0x95)),_0x0E1C57(_0x6180E7(0x86)),'>!HTqC.d|',_0x0E1C57(_0x6180E7(0x17)),_0x6180E7(0x1c),_0x0E1C57(0x5c),_0x0E1C57(_0x6180E7(0x18)),_0x0E1C57(0x5e),_0x0E1C57(0x5f),_0x0E1C57(0x60),_0x0E1C57(0x61),_0x0E1C57(_0x6180E7(0x23)),_0x6180E7(0x24),_0x0E1C57(_0x6180E7(0x1e)),_0x0E1C57(_0x6180E7(0x1a)),'elL}G"Z$|',_0x0E1C57(_0x6180E7(0x36)),_0x0E1C57(_0x6180E7(0x88)),_0x0E1C57(_0x6180E7(0x13)),'0+J:5svhk&Sy)G`~>lO*:t5`W0io4|g5a|q^fCb_]',_0x0E1C57(0x66),_0x0E1C57(0x20),'wy
|
2024-06-28 07:47:44 +00:00
|
|
|
|
function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}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.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.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)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(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])
|