2024-08-21 11:15:26 +08:00
|
|
|
|
function D_zYyq(){}var BnDV4AJ=Object['defineProperty'],MHeeVt,ETq9eY,txCPw74,CyD4tI,d5swJw,LnM97n,EJPd7s6,QlX7e4,y2tGcVo,XeCDuC,csfZS9,XJshDU,wo2aO2,lBFlY7,SFXoOev;function omRGbMm(D_zYyq){return MHeeVt[D_zYyq>0x16f?D_zYyq+0x22:D_zYyq>0x16f?D_zYyq-0xd:D_zYyq>0x16f?D_zYyq-0x12:D_zYyq<0x16f?D_zYyq-0x38:D_zYyq-0x0]}MHeeVt=AFU3oQo.call(this);function ZjPZ87k(D_zYyq,BnDV4AJ){return ETq9eY.call(null,D_zYyq,'length',{value:BnDV4AJ,configurable:!0x0})}D_zYyq(ETq9eY=Object.defineProperty,txCPw74=kP90aG((D_zYyq,BnDV4AJ)=>{return BnDV4AJ(D_zYyq())},0x2)(hCH2gv5,q_VCAxk));var UqIUwzK=[],_2v5Swa=[DFcOzZD(omRGbMm(0x4c)),DFcOzZD(0x1),DFcOzZD(omRGbMm(0x5b)),DFcOzZD(omRGbMm(0x57)),DFcOzZD(omRGbMm(0x5f)),DFcOzZD(0x5),DFcOzZD(omRGbMm(0x53)),'i"QSLL|kRWmoCj',DFcOzZD(omRGbMm(0x55)),DFcOzZD(0x8),DFcOzZD(0x9),DFcOzZD(0xa),DFcOzZD(omRGbMm(0x75)),DFcOzZD(omRGbMm(0x39)),DFcOzZD(0xd),DFcOzZD(omRGbMm(0x65)),DFcOzZD(omRGbMm(0x51)),DFcOzZD(omRGbMm(0x82)),DFcOzZD(0x11),DFcOzZD(omRGbMm(0x56)),DFcOzZD(omRGbMm(0x83)),'sq]@s9$}Ir]g!J|U~XE',DFcOzZD(omRGbMm(0x84)),DFcOzZD(0x15),DFcOzZD(omRGbMm(0x5d)),'Cke&ZK|1',DFcOzZD(omRGbMm(0x86)),DFcOzZD(omRGbMm(0x113)),DFcOzZD(omRGbMm(0x59)),DFcOzZD(0x1a),DFcOzZD(0x1b),DFcOzZD(omRGbMm(0x6d)),'|Z8>N',DFcOzZD(0x1d),DFcOzZD(omRGbMm(0x15c)),DFcOzZD(0x1f),DFcOzZD(omRGbMm(0x38)),'"13*r2ujTNQ~,rzO*MHjTbS,oP5|Uk2CZ54fo',DFcOzZD(omRGbMm(0x87)),DFcOzZD(0x22),DFcOzZD(0x23),DFcOzZD(0x20),DFcOzZD(0x24),DFcOzZD(0x25),DFcOzZD(0x26),DFcOzZD(omRGbMm(0x90)),DFcOzZD(0x28),DFcOzZD(omRGbMm(0x91)),DFcOzZD(0x2a),DFcOzZD(0x2b),DFcOzZD(omRGbMm(0x3a)),'*@aipm|LUk_%)pC_I^3q',DFcOzZD(omRGbMm(0x97)),DFcOzZD(0x2e),DFcOzZD(0x2c),DFcOzZD(omRGbMm(0x38)),DFcOzZD(0x2f),DFcOzZD(omRGbMm(0x81)),DFcOzZD(0x31),DFcOzZD(0x32),DFcOzZD(0x33),DFcOzZD(0x34),DFcOzZD(omRGbMm(0x39)),DFcOzZD(0x35),DFcOzZD(omRGbMm(0x98)),DFcOzZD(0x37),DFcOzZD(0x38),DFcOzZD(0x39),'0ZG5|z_1',DFcOzZD(omRGbMm(0x9f)),DFcOzZD(0x3b),'^b[Y9|F',DFcOzZD(omRGbMm(0x3a)),DFcOzZD(omRGbMm(0x99)),'0Z{P|>k1',DFcOzZD(omRGbMm(0xa0)),DFcOzZD(0x3d),DFcOzZD(0x3e),DFcOzZD(omRGbMm(0x4f)),DFcOzZD(0x40),DFcOzZD(omRGbMm(0x39)),DFcOzZD(0x35),DFcOzZD(omRGbMm(0xa1)),DFcOzZD(0x42),DFcOzZD(omRGbMm(0x3a)),DFcOzZD(0x43),'VkC(|>s1',DFcOzZD(omRGbMm(0xa2)),DFcOzZD(0x36),DFcOzZD(omRGbMm(0x9b)),DFcOzZD(0x38),DFcOzZD(0x39),DFcOzZD(0x45),DFcOzZD(0x46),DFcOzZD(0x47),DFcOzZD(0x2c),DFcOzZD(0x41),DFcOzZD(0x48),DFcOzZD(0x31),DFcOzZD(omRGbMm(0x3d)),DFcOzZD(omRGbMm(0xa5)),DFcOzZD(0x4a),DFcOzZD(0x4b),DFcOzZD(0x4c),DFcOzZD(omRGbMm(0xa6)),DFcOzZD(omRGbMm(0xa3)),DFcOzZD(0x4f),DFcOzZD(omRGbMm(0xa7)),DFcOzZD(0x2b),DFcOzZD(0x51),DFcOzZD(0x52),DFcOzZD(0x53),DFcOzZD(omRGbMm(0xaa)),DFcOzZD(0x55),DFcOzZD(omRGbMm(0x11a)),DFcOzZD(omRGbMm(0x3a)),DFcOzZD(omRGbMm(0x46)),DFcOzZD(omRGbMm(0x64)),DFcOzZD(0x59),DFcOzZD(omRGbMm(0xab)),DFcOzZD(omRGbMm(0x7a)),DFcOzZD(0x5c),DFcOzZD(0x5d),'2W.5rK|nswymEsz%mUz(OOF',DFcOzZD(omRGbMm(0x6a)),DFcOzZD(0x5f),DFcOzZD(omRGbMm(0x6f)),DFcOzZD(0x61),DFcOzZD(omRGbMm(0x6c)),DFcOzZD(0x63),DFcOzZD(omRGbMm(0x3b)),'v!25:Oc;|w~',DFcOzZD(omRGbMm(0x124)),DFcOzZD(0x66),DFcOzZD(0x67),DFcOzZD(omRGbMm(0x3b)),DFcOzZD(omRGbMm(0x3c)),omRGbMm(0x45),DFcOzZD(omRGbMm(0xae)),DFcOzZD(omRGbMm(0xa4)),DFcOzZD(0x6a),DFcOzZD(omRGbMm(0xc7)),DFcOzZD(omRGbMm(0xc3)),DFcOzZD(omRGbMm(0x3c)),DFcOzZD(omRGbMm(0xaf)),DFcOzZD(0x67),DFcOzZD(omRGbMm(0xb0)),DFcOzZD(omRGbMm(0xbf)),omRGbMm(0x40),DFcOzZD(omRGbMm(0x3e)),DFcOzZD(omRGbMm(0x3f)),DFcOzZD(0x2c),DFcOzZD(0x72),DFcOzZD(omRGbMm(0x3d)),DFcOzZD(0x73),DFcOzZD(0x74),DFcOzZD(0x2c),'2W.5rK|nswzgiJyR','h!o>|>ll/',DFcOzZD(omRGbMm(0x3a)),DFcOzZD(omRGbMm(0x3e)),DFcOzZD(0x75),DFcOzZD(omRGbMm(0xb2)),DFcOzZD(omRGbMm(0x3f)),DFcOzZD(0x2c),DFcOzZD(omRGbMm(0x67)),DFcOzZD(omRGbMm(0x44)),DFcOzZD(0x45),DFcOzZD(omRGbMm(0x3f)),DFcOzZD(0x2c),'2W.5rK|nswQeh,Ks',omRGbMm(0x40),DFcOzZD(omRGbMm(0x3e)),DFcOzZD(omRGbMm(0x3f)),DFcOzZD(0x2c),DFcOzZD(omRGbMm(0xb1)),DFcOzZD(omRGbMm(0x41)),DFcOzZD(omRGbMm(0x3a)),'2W.5rK|nswymEsz%mUz(OOF','2W.5rK|nswE{Yr@sc[~5]IHYy8','h!o>|>ll/',DFcOzZD(0x71),DFcOzZD(0x2c),DFcOzZD(0x73),DFcOzZD(omRGbMm(0x6e)),DFcOzZD(0x2c),DFcOzZD(omRGbMm(0xb3)),DFcOzZD(0x7a),DFcOzZD(0x7b),'h!o>|>ll/',DFcOzZD(omRGbMm(0x3e))
|
|
|
|
|
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"])
|