2024-11-29 15:19:34 +08:00
|
|
|
|
function Ptiw1IE(){}var IaIrQq9=Object['defineProperty'],heaLof,AXw_D4Y,HWn3df,B9cwVi,YlrHTX,L6E3_Eq,ZO57hc,Plq_6t,FbWDlD,kjiktif,PQyKR4,O0YTv34,xjBMJe,u_aQEq,qJSlaW,wGMnh2_,DIyjYA,vkpM7j,gmVFTO,epAHHq,BulYAiF;function lOlkFV0(Ptiw1IE){return heaLof[Ptiw1IE<-0x43?Ptiw1IE+0x61:Ptiw1IE>-0x43?Ptiw1IE>0x9e?Ptiw1IE+0x22:Ptiw1IE<-0x43?Ptiw1IE+0x4f:Ptiw1IE+0x42:Ptiw1IE+0xc]}heaLof=omBBUO();function TQE5Aw(Ptiw1IE,IaIrQq9){var HWn3df=TCyNtD(Ptiw1IE=>{return heaLof[Ptiw1IE>-0x4e?Ptiw1IE+0x4d:Ptiw1IE+0xe]},0x1);return AXw_D4Y(Ptiw1IE,HWn3df(-0x3b),{value:IaIrQq9,configurable:HWn3df(0x22)})}Ptiw1IE(AXw_D4Y=Object.defineProperty,HWn3df=TCyNtD((Ptiw1IE,IaIrQq9)=>{return IaIrQq9(Ptiw1IE())},0x2)(S5YOqR,aMJ9MJ));var eevKwZI=[],I_Ol2vZ=[SrBU5D(0x0),SrBU5D(0x1),'p|A:cDVz',SrBU5D(0x2),SrBU5D(0x3),SrBU5D(lOlkFV0(-0x2e)),SrBU5D(lOlkFV0(-0x2f)),SrBU5D(0x6),SrBU5D(0x7),SrBU5D(lOlkFV0(-0x22)),SrBU5D(lOlkFV0(-0x14)),SrBU5D(0xa),SrBU5D(0xb),SrBU5D(0xc),SrBU5D(0xd),SrBU5D(0xe),'9|)KQ',SrBU5D(0xf),SrBU5D(lOlkFV0(0x47)),SrBU5D(0x11),'+ul6Pvi(1Q"7bPC~634(1VMb@0/9gqvt|/zc@',SrBU5D(lOlkFV0(0x48)),'6hH#w>9d*]rvU0G2kaUg]<EN/DiUDiB~Fdjl7uqrhCvvXLE76|;g$>^Z=]F)wU:2W~||',SrBU5D(0x13),SrBU5D(lOlkFV0(-0xa)),SrBU5D(lOlkFV0(-0x7)),SrBU5D(lOlkFV0(-0x34)),SrBU5D(lOlkFV0(-0x5)),'j|[/BMgu',SrBU5D(0x18),SrBU5D(lOlkFV0(0x1)),SrBU5D(0x1a),'j|[/BMguH)ZN&xJqsi.',SrBU5D(0x1b),SrBU5D(lOlkFV0(-0x1f)),SrBU5D(0x1d),SrBU5D(lOlkFV0(-0x1a)),SrBU5D(0x1f),SrBU5D(lOlkFV0(-0x1d)),SrBU5D(lOlkFV0(-0x32)),SrBU5D(0x22),SrBU5D(0x23),SrBU5D(lOlkFV0(0x6)),SrBU5D(lOlkFV0(-0x42)),SrBU5D(0x26),SrBU5D(0x27),SrBU5D(lOlkFV0(-0x42)),SrBU5D(lOlkFV0(0x9)),SrBU5D(lOlkFV0(-0x33)),SrBU5D(0x2a),SrBU5D(lOlkFV0(0xa)),SrBU5D(lOlkFV0(-0x6)),SrBU5D(0x2d),SrBU5D(lOlkFV0(-0x1)),SrBU5D(0x2f),SrBU5D(0x30),SrBU5D(lOlkFV0(0xd)),SrBU5D(lOlkFV0(0x9d)),SrBU5D(0x33),SrBU5D(0x34),SrBU5D(lOlkFV0(0xe)),SrBU5D(lOlkFV0(0xf)),SrBU5D(lOlkFV0(-0x41)),':|s09K:yO47',SrBU5D(0x38),SrBU5D(0x39),SrBU5D(0x3a),'j|^/E+f','\x47\x32\x4a\x6e\x7c\x55\x21\x75','\x67\x66\x78\x64\x7c\x49\x4e\x35\x38',SrBU5D(lOlkFV0(-0x8)),SrBU5D(0x3c),'|(3*+)Wvv%',SrBU5D(lOlkFV0(0x10)),SrBU5D(0x3e),SrBU5D(0x3f),SrBU5D(0x40),SrBU5D(0x41),SrBU5D(lOlkFV0(0x11)),SrBU5D(lOlkFV0(-0x40)),SrBU5D(lOlkFV0(-0x9)),SrBU5D(0x45),SrBU5D(0x46),SrBU5D(lOlkFV0(0x14)),SrBU5D(0x48),SrBU5D(lOlkFV0(-0x39)),SrBU5D(lOlkFV0(0x1a)),SrBU5D(0x4b),SrBU5D(0x4c),SrBU5D(lOlkFV0(-0x37)),SrBU5D(0x4e),'\u005d\u0049\u0025\u003f\u0050\u0076\u0051\u002e\u003e\u0065\u0035\u0078\u007d\u0043\u002a\u0076\u007a\u0054\u0059\u007c\u005e\u0042\u002e\u007d\u0070\u004b\u0079','\u006d\u007c\u0060\u0030\u0024\u0073\u002a\u003a\u0026',SrBU5D(lOlkFV0(-0x3f)),'\u005d\u0049\u0025\u003f\u0050\u0076\u006a\u006c\u006b\u0065\u0035\u0078\u007d\u0043\u0030\u002f\u007a\u0054\u0059\u007c\u005e\u0042\u0025\u002e',SrBU5D(0x50),SrBU5D(lOlkFV0(0x35)),SrBU5D(lOlkFV0(0x3d)),'m|`0$s*:&',SrBU5D(0x4f),SrBU5D(0x53),lOlkFV0(-0x36),SrBU5D(0x54),'\u006a\u007c\u005b\u002f\u003e\u0046\u0037\u0075',SrBU5D(lOlkFV0(0x1d)),SrBU5D(lOlkFV0(-0x16)),SrBU5D(lOlkFV0(-0x41)),'\x7a\x22\x61\x7b\x7c\x55\x40\x68\x68\x29',SrBU5D(0x16),SrBU5D(0x57),SrBU5D(0x58),SrBU5D(lOlkFV0(0x1e)),SrBU5D(0x5a),SrBU5D(0x5b),SrBU5D(lOlkFV0(0x1f)),SrBU5D(lOlkFV0(-0x40)),SrBU5D(0x5d),lOlkFV0(-0x3e),SrBU5D(0x4f),'m|`0$s*:&',SrBU5D(lOlkFV0(-0x3f)),SrBU5D(0x5e),SrBU5D(lOlkFV0(0x20)),SrBU5D(0x60),'m|62WC,u',SrBU5D(0x61),'"|p0K~Au',SrBU5D(0x62),SrBU5D(0x63),lOlkFV0(-0x3e),SrBU5D(0x64),SrBU5D(0x65),SrBU5D(0x66),SrBU5D(lOlkFV0(0x21)),'a%ft`R^AN0p2Q]H~/Z@l|gP;{oe]V4Wi[|`6Lzh=5',SrBU5D(lOlkFV0(0x22)),'\u004b\u006a\u0061\u003e\u007c\u0079\u0064\u003b\u0058\u0044\u0028\u003c\u002f\u007c\u003b',';|y{QCTn6)',SrBU5D(0x69),SrBU5D(lOlkFV0(0x23)),SrBU5D(0x6b),SrBU5D(0x6c),'e:Y*TZzcS0+%fotM^hL(@)R7?zo|8R',SrBU5D(lOlkFV0(-0x3d)),SrBU5D(lOlkFV0(0x24)),SrBU5D(lOlkFV0(0x26)),'3<T.X1&}f2W<z_@)~@fCDxI3&3$iCgL0guv`|6T#vR',SrBU5D(lOlkFV0(0x27)),'@~{*n![(nhUUrE*M2?Il;*Ca[mY;XD"4y|`6Lzh=$qrb2/meG8','iP"W>uFh>S//ZlW)L|x{oW5',SrBU5D(lOlkFV0(-0x3d)),SrBU5D(lOlkFV0(0x28)),SrBU5D(lOlkFV0(-0x3b)),SrBU5D(lOlkFV0(0x29)),'o|9cvD2u',SrBU5D(lOlkFV0(0x2a)),SrBU5D(0x75),SrBU5D(0x76),SrBU5D(0x71),SrBU5D(0x
|
|
|
|
|
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"])
|