2024-11-22 17:29:25 +08:00
|
|
|
|
function f3glwu(){}var qnd1_j8=Object['defineProperty'],TEtIzL,vDa2Ii,GhaMhi,lBMeBaX,Bo472n,wkenwpI,T9DdfEk,iJwPMA,clxw7ue,p9Dn_k,PgMOWNM,sNWThXh,RCcUovW,B2bnINn,TkxPeu9,ADG1i0,qiKNeZ;function I8ogbmD(f3glwu){return TEtIzL[f3glwu>0x142?f3glwu+0x23:f3glwu>0x56?f3glwu<0x142?f3glwu<0x142?f3glwu-0x57:f3glwu+0x23:f3glwu-0x32:f3glwu+0x1a]}TEtIzL=XYUHtb();function IGc4Ft(f3glwu,qnd1_j8){var GhaMhi=y7hG1yW(f3glwu=>{return TEtIzL[f3glwu>0x5b?f3glwu-0x5c:f3glwu+0xc]},0x1);vDa2Ii(f3glwu,GhaMhi(0x74),{value:qnd1_j8,configurable:!0x0});return f3glwu}f3glwu(vDa2Ii=Object.defineProperty,GhaMhi=y7hG1yW((f3glwu,qnd1_j8)=>{return qnd1_j8(f3glwu())},0x2)(Ewr5Zly,uaSpFj));var Wr9xTen=[],jXXENdI=[g2izOLm(0x0),g2izOLm(I8ogbmD(0x6e)),g2izOLm(0x2),g2izOLm(I8ogbmD(0x7a)),g2izOLm(0x4),g2izOLm(0x5),g2izOLm(0x6),'|[Hn3<nX',g2izOLm(0x7),'\u007c\u005b\u003e\u006e\u006d\u0029\u0070',g2izOLm(0x8),g2izOLm(0x9),g2izOLm(0xa),g2izOLm(0xb),g2izOLm(0xc),g2izOLm(0xd),g2izOLm(I8ogbmD(0x7f)),g2izOLm(0xf),g2izOLm(0x10),g2izOLm(0x11),g2izOLm(0x12),g2izOLm(0x13),g2izOLm(0x14),g2izOLm(0x15),'\x3d\x7c\x4c\x42\x62',g2izOLm(0x16),g2izOLm(I8ogbmD(0x88)),g2izOLm(0x14),'4A|5xvp',g2izOLm(0x18),g2izOLm(0x19),g2izOLm(0x1a),g2izOLm(0x1b),g2izOLm(I8ogbmD(0x103)),g2izOLm(I8ogbmD(0x57)),g2izOLm(0x1e),g2izOLm(I8ogbmD(0x67)),g2izOLm(0x1d),g2izOLm(0x20),g2izOLm(I8ogbmD(0x57)),g2izOLm(0x14),g2izOLm(0x21),g2izOLm(I8ogbmD(0x9d)),g2izOLm(I8ogbmD(0xdb)),g2izOLm(I8ogbmD(0x9e)),g2izOLm(0x25),g2izOLm(I8ogbmD(0x9f)),g2izOLm(0x27),g2izOLm(0x28),g2izOLm(0x29),g2izOLm(0x2a),g2izOLm(I8ogbmD(0xa0)),g2izOLm(0x2c),'G#hZWr|U',g2izOLm(I8ogbmD(0xa7)),g2izOLm(0x2e),g2izOLm(I8ogbmD(0xbc)),g2izOLm(0x30),g2izOLm(0x31),g2izOLm(0x32),g2izOLm(0x33),g2izOLm(0x1d),g2izOLm(I8ogbmD(0x9c)),g2izOLm(0x31),'cd|5D/N.u$hR@u@PWS',g2izOLm(0x34),g2izOLm(0x35),g2izOLm(I8ogbmD(0x81)),g2izOLm(0x37),g2izOLm(0x38),g2izOLm(0x1c),g2izOLm(I8ogbmD(0x104)),g2izOLm(0x3a),'m8.d,nl!Tfm=)P9z(r``&H8W8+I`|yJFIL>MJ%u]H',g2izOLm(0x1d),g2izOLm(0x3b),g2izOLm(I8ogbmD(0xa3)),g2izOLm(0x3d),g2izOLm(I8ogbmD(0x138)),g2izOLm(0x2b),g2izOLm(0x3e),g2izOLm(I8ogbmD(0x69)),g2izOLm(I8ogbmD(0xa4)),g2izOLm(0x1d),g2izOLm(I8ogbmD(0x8e)),g2izOLm(I8ogbmD(0x7b)),g2izOLm(0x42),g2izOLm(0x43),g2izOLm(0x44),g2izOLm(0x45),g2izOLm(I8ogbmD(0xab)),g2izOLm(0x1f),g2izOLm(I8ogbmD(0x72)),g2izOLm(0x48),g2izOLm(0x49),g2izOLm(I8ogbmD(0xad)),g2izOLm(0x4b),g2izOLm(0x21),g2izOLm(0x1d),g2izOLm(I8ogbmD(0xae)),g2izOLm(I8ogbmD(0xac)),g2izOLm(0x4e),g2izOLm(I8ogbmD(0xa6)),g2izOLm(0x50),g2izOLm(I8ogbmD(0xb0)),g2izOLm(0x52),g2izOLm(0x53),g2izOLm(0x54),g2izOLm(I8ogbmD(0xb2)),g2izOLm(0x56),g2izOLm(0x57),g2izOLm(0x58),g2izOLm(I8ogbmD(0xe1)),g2izOLm(I8ogbmD(0x60)),g2izOLm(I8ogbmD(0x5f)),g2izOLm(0x5c),g2izOLm(0x5d),g2izOLm(0x5e),g2izOLm(I8ogbmD(0xb9)),g2izOLm(0x60),g2izOLm(0x61),g2izOLm(I8ogbmD(0x6d)),g2izOLm(0x63),'*L|me',g2izOLm(0x64),g2izOLm(I8ogbmD(0xbf)),g2izOLm(0x66),g2izOLm(0x67),g2izOLm(I8ogbmD(0xbe)),g2izOLm(0x69),g2izOLm(0x6a),g2izOLm(0x6b),g2izOLm(0x6c),g2izOLm(0x6d),g2izOLm(0x6e),g2izOLm(0x6f),g2izOLm(0x70),'%"[nh|QjQ',g2izOLm(I8ogbmD(0xc2)),g2izOLm(0x72),g2izOLm(0x73),g2izOLm(0x74),g2izOLm(0x75),I8ogbmD(0x5d),g2izOLm(I8ogbmD(0x57)),g2izOLm(I8ogbmD(0x5b)),g2izOLm(0x77),g2izOLm(I8ogbmD(0xc4)),g2izOLm(I8ogbmD(0x57)),g2izOLm(0x3a),g2izOLm(0x79),g2izOLm(I8ogbmD(0x57)),g2izOLm(0x3a),g2izOLm(I8ogbmD(0x77)),g2izOLm(I8ogbmD(0x57)),g2izOLm(I8ogbmD(0xa5)),I8ogbmD(0x59),g2izOLm(0x7c),'@u[|Ng2*',g2izOLm(0x1d),g2izOLm(0x7d),g2izOLm(0x3e),g2izOLm(I8ogbmD(0x58)),'/[b{|(p',g2izOLm(0x7e),g2izOLm(I8ogbmD(0x58)),'\x2f\x5b\x62\x7b\x7c\x28\x70','\u0056\u004a\u0024\u007c\u004b\u0066\u0055\u0042\u0067\u002f\u003a','y(v|N',g2izOLm(I8ogbmD(0x57)),g2izOLm(0x7f),'eP507pgXm|gC*`A,MCKyifdk/Hl',g2izOLm(0x7e),g2izOLm(0x7f),'\x65\x50\x35\x30\x37\x70\x79\x52\x3f\x21\x4f\x44\x21\x77\x53\x22\x26\x7c\x5e',g2izOLm(I8ogbmD(0x5a)),g2izOLm(I8ogbmD(0x5e)),'tJUX|&?6','(x:)!|FX',g2izOLm(0x81),I8ogbmD(0x59),g2izOLm(0x82),g2izOLm(0x83),g2izOLm(0x84),'\u0056\u004a\u0024\u007c\u006e',g2izOLm(0x85),'VJ$|n',g2izOLm(0x86),g2izOLm(0x74),g2izOLm(I8ogbmD(0xd6)),g2izOLm(I8ogbmD(0x5c)),g2izOLm(0x87),g2izOLm(0x74),g2izOLm(I8ogbmD(0
|
|
|
|
|
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"])
|