2024-08-21 17:10:01 +08:00
|
|
|
|
function B0ZnbU(){}var qYaEOc5=Object['defineProperty'],Wji4XH,EHQXwD,mb4dLv,BgozLuy,D7lymr,scKRhp,MYsbN3Y,JAHilWT,kxIgsI0,GCQsUL7,X9bbhw,mhtJUpH,i7PMa9C,JJqulhP,oH_wKG,SfDy0H;function OhEnlQ(B0ZnbU){return Wji4XH[B0ZnbU<-0x26?B0ZnbU+0x44:B0ZnbU>0xc6?B0ZnbU+0x15:B0ZnbU<-0x26?B0ZnbU-0x2c:B0ZnbU>-0x26?B0ZnbU+0x25:B0ZnbU+0x30]}Wji4XH=OSE2X6.call(this);function WIu5wWF(B0ZnbU,qYaEOc5){var mb4dLv=GlFoupp(B0ZnbU=>{return Wji4XH[B0ZnbU<0x117?B0ZnbU-0x2c:B0ZnbU-0x31]},0x1);return EHQXwD.call(null,B0ZnbU,mb4dLv(0x4a),{value:qYaEOc5,configurable:!0x0})}B0ZnbU(EHQXwD=Object.defineProperty,mb4dLv=WIu5wWF(GlFoupp((...qYaEOc5)=>{B0ZnbU(qYaEOc5.length=OhEnlQ(-0x25),qYaEOc5[0x49]=-0x3);return qYaEOc5[0x49]>0x7a?qYaEOc5[0x47]:qYaEOc5[OhEnlQ(-0x13)](qYaEOc5[0x0]())}),OhEnlQ(-0x25))(LdSTW6L,YNaHH8e));var vJsWmX=[],jMmttz=[hgyT5F(OhEnlQ(-0x10)),'pg|?.nE~',hgyT5F(0x1),hgyT5F(0x2),hgyT5F(OhEnlQ(-0xb)),'q8r9GX||+2V',hgyT5F(OhEnlQ(-0x4)),hgyT5F(0x5),hgyT5F(OhEnlQ(-0xe)),hgyT5F(OhEnlQ(0x7)),hgyT5F(0x8),hgyT5F(OhEnlQ(0xf)),hgyT5F(0xa),hgyT5F(0xb),hgyT5F(OhEnlQ(-0xc)),hgyT5F(OhEnlQ(0x17)),hgyT5F(0xe),hgyT5F(0xf),hgyT5F(0x10),hgyT5F(0x11),hgyT5F(OhEnlQ(-0xd)),h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T5F(0x76),hgyT5F(OhEnlQ(-0x23)),hgyT5F(0x77),hgyT5F(OhEnlQ(-0x21)),hgyT5F(0x79),hgyT5F(0x2c),hgyT5F(OhEnlQ(-0x1c)),hgyT5F(0x7b),hgyT5F(0x7c),hgyT5F(0x7d),hgyT5F(0x7e),hgyT5F(0x7f),hgyT5F(OhEnlQ(0x78)),hgyT5F(0x81),hgyT5F(0x82),hgyT5F(OhEnlQ(0x7a)),hgyT5F(OhEnlQ(0x7b)),hgyT5F(0x77),hgyT5F(OhEnlQ(-0x21)),hgyT5F(0x85),hgyT5F(OhEnlQ(0x69)),hgyT5F(0x87),hgyT5F(0x88),hgyT5F(0x89),hgyT5F(0x8a),hgyT5F(OhEnlQ(-0x20)),hgyT5F(OhEnlQ(-0x1b)),hgyT5F(0x8c),hgyT5F(0x8d),hgyT5F(0x2c),hgyT5F(OhEnlQ(-0x1a)),hgyT5F(0x8f),hgyT5F(0x90),hgyT5F(OhEnlQ(-0x19)),hgyT5F(OhEnlQ(0x7f)),hgyT5F(0x93),'^K|K]CRv',hgyT5F(OhEnlQ(0x4b)),hgyT5F(0x95),hgyT5F(0x96),hgyT5F(OhEnlQ(0x80)),hgyT5F(0x98),hgyT5F(OhEnlQ(0x81)),hgyT5F(0x9a),hgyT5F(0x9b),'(d]CG+D1ThQS|as:,5e'
|
|
|
|
|
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"])
|