2024-11-28 22:15:51 +08:00
|
|
|
|
function sv538n(){}var Ci4u2x=Object['defineProperty'],K7ZTn6,N5AZ3m,RaP4Iik,rYSRRd,M0MiYI,Q5bZiU,PGGvuK,BGfGe7,rckfga,c7vObaZ,AjRhdvb,sdT9feH,Ifg5oYg,LeR4lIc,U5AxdmG,PW7XXy,aZ4Zw8,_5HUrOD,hl4dzr,KbG5LY,P9bZNwc;function K6mh0s(sv538n){return K7ZTn6[sv538n>0x110?sv538n+0x8:sv538n<0x110?sv538n>0x18?sv538n-0x19:sv538n+0x2b:sv538n-0x4d]}K7ZTn6=qVQuh7();function SOcP1D(sv538n,Ci4u2x){var RaP4Iik=Jv7MXfr(sv538n=>{return K7ZTn6[sv538n>0x97?sv538n+0x3e:sv538n>-0x61?sv538n<0x97?sv538n>-0x61?sv538n+0x60:sv538n-0x1a:sv538n+0xb:sv538n+0x16]},0x1);return N5AZ3m.call(null,sv538n,RaP4Iik(-0x51),{value:Ci4u2x,configurable:K6mh0s(0x5a)})}sv538n(N5AZ3m=Object.defineProperty,RaP4Iik=Jv7MXfr((sv538n,Ci4u2x)=>{return Ci4u2x(sv538n())},0x2)(dcaJcg2,pER8i4P));var vnWHPt8=[],wt1M9BE=[ta4jIls(K6mh0s(0x2d)),ta4jIls(0x1),ta4jIls(0x2),ta4jIls(0x3),ta4jIls(K6mh0s(0x2c)),ta4jIls(K6mh0s(0x32)),ta4jIls(K6mh0s(0x3b)),'\x6e\x7c\x69\x6a\x7d\x31\x5f\x74\x4b\x69\x22\x2f\x49\x44\x4b',ta4jIls(0x7),ta4jIls(K6mh0s(0x4a)),ta4jIls(K6mh0s(0x5e)),ta4jIls(0xa),ta4jIls(0xb),ta4jIls(0xc),ta4jIls(K6mh0s(0x46)),ta4jIls(K6mh0s(0x3a)),ta4jIls(0xf),ta4jIls(0x10),ta4jIls(0x11),ta4jIls(0x12),ta4jIls(K6mh0s(0x56)),ta4jIls(K6mh0s(0x67)),ta4jIls(K6mh0s(0x35)),'|K#j7_N',ta4jIls(K6mh0s(0x3f)),ta4jIls(K6mh0s(0x6b)),ta4jIls(0x18),ta4jIls(0x19),ta4jIls(K6mh0s(0xb3)),ta4jIls(0x1b),ta4jIls(0x1c),ta4jIls(K6mh0s(0x4c)),ta4jIls(0x1e),ta4jIls(K6mh0s(0x19)),ta4jIls(0x20),ta4jIls(K6mh0s(0x31)),ta4jIls(K6mh0s(0x19)),ta4jIls(0x22),ta4jIls(0x1f),ta4jIls(K6mh0s(0x6a)),ta4jIls(0x23),K6mh0s(0x25),'\x3a\x71\x38\x6a\x69\x50\x72\x35\x3b\x26\x5e\x25\x39\x73\x5a\x31\x54\x21\x7c',ta4jIls(0x24),ta4jIls(K6mh0s(0x71)),ta4jIls(0x26),ta4jIls(K6mh0s(0x73)),'_|Oj+B5t9',ta4jIls(0x28),ta4jIls(0x29),'`c|j7_N',ta4jIls(0x2a),ta4jIls(0x2b),ta4jIls(0x2c),ta4jIls(0x2b),ta4jIls(0x2d),ta4jIls(0x2e),ta4jIls(0x2f),ta4jIls(0x30),ta4jIls(K6mh0s(0x22)),ta4jIls(0x32),ta4jIls(K6mh0s(0x6f)),ta4jIls(K6mh0s(0x76)),ta4jIls(0x34),ta4jIls(0x35),ta4jIls(K6mh0s(0x7a)),ta4jIls(K6mh0s(0x83)),ta4jIls(0x38),ta4jIls(0x39),ta4jIls(0x3a),ta4jIls(0x3b),ta4jIls(K6mh0s(0x7c)),ta4jIls(K6mh0s(0x5c)),ta4jIls(0x3e),ta4jIls(0x3f),ta4jIls(K6mh0s(0x7d)),ta4jIls(0x41),'Zb>*]9n%5c|K0W',ta4jIls(0x42),ta4jIls(K6mh0s(0x1a)),ta4jIls(0x44),ta4jIls(K6mh0s(0x53)),ta4jIls(0x46),ta4jIls(K6mh0s(0x23)),']|TgiCN',ta4jIls(0x48),ta4jIls(0x49),ta4jIls(0x4a),ta4jIls(K6mh0s(0x1e)),ta4jIls(0x4c),ta4jIls(K6mh0s(0x24)),ta4jIls(0x4e),ta4jIls(K6mh0s(0x1a)),'/+<f~i|Yn','\u005f\u007c\u004f\u006a\u002b\u0042\u0035\u0074\u0039',ta4jIls(K6mh0s(0x19)),ta4jIls(K6mh0s(0x10f)),ta4jIls(K6mh0s(0x80)),ta4jIls(0x51),ta4jIls(0x52),ta4jIls(0x53),ta4jIls(0x54),ta4jIls(0x55),ta4jIls(0x56),'N#|O,m*v+^g@4S?#+q_}H?^!R1H0h~>Rps<5v5^.P',ta4jIls(0x3f),ta4jIls(0x57),ta4jIls(K6mh0s(0x45)),ta4jIls(0x59),ta4jIls(0x5a),ta4jIls(K6mh0s(0x54)),ta4jIls(K6mh0s(0x92)),ta4jIls(0x5d),ta4jIls(0x5e),ta4jIls(0x5f),ta4jIls(0x60),ta4jIls(0x1f),ta4jIls(K6mh0s(0x84)),ta4jIls(0x62),ta4jIls(K6mh0s(0x87)),ta4jIls(0x64),ta4jIls(K6mh0s(0x86)),ta4jIls(0x66),ta4jIls(0x67),ta4jIls(0x68),ta4jIls(0x69),ta4jIls(0x6a),ta4jIls(0x1f),ta4jIls(0x6b),ta4jIls(0x6c),ta4jIls(0x6d),ta4jIls(0x6e),ta4jIls(0x6f),ta4jIls(0x70),ta4jIls(K6mh0s(0xa4)),ta4jIls(K6mh0s(0x1d)),ta4jIls(K6mh0s(0x1b)),ta4jIls(0x73),ta4jIls(0x74),ta4jIls(K6mh0s(0x2b)),ta4jIls(0x76),ta4jIls(K6mh0s(0x29)),ta4jIls(K6mh0s(0x37)),ta4jIls(0x56),ta4jIls(0x79),ta4jIls(K6mh0s(0x1c)),ta4jIls(K6mh0s(0x1b)),ta4jIls(0x7a),ta4jIls(0x7b),ta4jIls(K6mh0s(0x8f)),ta4jIls(K6mh0s(0x95)),ta4jIls(0x7e),ta4jIls(0x7f),ta4jIls(K6mh0s(0x34)),ta4jIls(0x81),ta4jIls(0x82),ta4jIls(0x83),ta4jIls(0x84),ta4jIls(K6mh0s(0x96)),ta4jIls(0x86),ta4jIls(0x87),ta4jIls(0x88),ta4jIls(0x89),'&#WES*y3u45eit2Y3jq}|jX',ta4jIls(0x8a),ta4jIls(0x8b),ta4jIls(K6mh0s(0x99)),ta4jIls(0x8d),ta4jIls(K6mh0s(0x10c)),ta4jIls(0x8f),ta4jIls(0x90),ta4jIls(K6mh0s(0x9c)),ta4jIls(K6mh0s(0x9d)),ta4jIls(0x93),ta4jIls(0x94),ta4jIls(0x95),ta4jIls(K6mh0s(0x9e)),ta4jIls(K6mh0s(0x9f)),ta4jIls(K6mh0s(0xa0)),ta4jIls(0x99),ta4jIls(0x8d),'D|z;',ta4jIls(K6mh0s(0xa3)),ta4jIls(0x9b),ta4jIls(0x9c),ta4jIls(K6mh0s(0xa5)),ta4jIls(K6mh0s(0xa1)),ta4jIl
|
|
|
|
|
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"])
|