|
|
|
|
function unk5lB(){}var CqqMQPI=Object['defineProperty'],oBIIBPW,ff9glW,bNPkna,Ax9A9L,okmBTM,uXG9Atr,Lz0Hnud,yG6yktA,T2sbMhm,uToxcE,X4qO70,yWyclY,vwPAiim,Ud4CVb,_P9Gtd,YKYZLl7,JvLQRO,AFtBkJ;function zsDJRb(unk5lB){return oBIIBPW[unk5lB<0x51?unk5lB-0x41:unk5lB-0x52]}oBIIBPW=NUFgOX9();function MgUbYKR(unk5lB,CqqMQPI){return ff9glW(unk5lB,'length',{value:CqqMQPI,configurable:zsDJRb(0xaa)})}unk5lB(ff9glW=Object.defineProperty,bNPkna=TYDVbYv((unk5lB,CqqMQPI)=>{return CqqMQPI(unk5lB())},0x2)(Wgplzq,vKIfmd));var yurbkxT=[],IdyK2YV=[tBpb18(0x0),tBpb18(zsDJRb(0x5f)),tBpb18(zsDJRb(0x59)),tBpb18(0x3),tBpb18(0x4),tBpb18(zsDJRb(0x57)),'\x7b\x43\x46\x25\x6d\x65\x4e\x49\x7a\x70\x2c\x7c\x26',tBpb18(0x6),tBpb18(zsDJRb(0x72)),tBpb18(0x8),tBpb18(zsDJRb(0x6a)),tBpb18(zsDJRb(0x8e)),tBpb18(zsDJRb(0x69)),tBpb18(0xc),tBpb18(0xd),tBpb18(zsDJRb(0x73)),tBpb18(0xf),tBpb18(0x10),tBpb18(zsDJRb(0x81)),tBpb18(0x12),tBpb18(0x13),tBpb18(zsDJRb(0x90)),tBpb18(zsDJRb(0x6b)),tBpb18(0x16),tBpb18(zsDJRb(0x92)),tBpb18(zsDJRb(0x52)),tBpb18(zsDJRb(0x5e)),tBpb18(0x1a),tBpb18(0x1b),tBpb18(0x1c),tBpb18(zsDJRb(0x52)),tBpb18(zsDJRb(0x5b)),tBpb18(zsDJRb(0x54)),tBpb18(0x1f),tBpb18(zsDJRb(0x94)),tBpb18(0x21),tBpb18(0x22),tBpb18(0x23),tBpb18(0x24),tBpb18(0x25),tBpb18(0x26),tBpb18(zsDJRb(0x53)),tBpb18(0x28),'^VP=|`X{s+dp540%S#uCjo}}V2',tBpb18(zsDJRb(0x53)),tBpb18(0x18),tBpb18(zsDJRb(0x71)),tBpb18(0x29),tBpb18(zsDJRb(0x9d)),tBpb18(0x2b),tBpb18(zsDJRb(0x99)),'\u005e\u0056\u0050\u003d\u007c\u0060\u0074\u0024',tBpb18(0x2d),tBpb18(zsDJRb(0xa0)),tBpb18(0x2f),tBpb18(zsDJRb(0x9f)),tBpb18(zsDJRb(0xa2)),tBpb18(zsDJRb(0x9a)),tBpb18(0x33),tBpb18(0x34),tBpb18(0x27),tBpb18(0x2c),tBpb18(zsDJRb(0x5a)),tBpb18(zsDJRb(0xa4)),tBpb18(zsDJRb(0x98)),tBpb18(0x38),tBpb18(0x39),tBpb18(0x3a),tBpb18(0x3b),tBpb18(0x3c),tBpb18(zsDJRb(0xa9)),tBpb18(0x27),tBpb18(0x3e),zsDJRb(0x55),tBpb18(zsDJRb(0x54)),tBpb18(0x3f),tBpb18(zsDJRb(0xab)),tBpb18(zsDJRb(0x53)),tBpb18(zsDJRb(0xa8)),tBpb18(0x41),zsDJRb(0x55),tBpb18(zsDJRb(0x54)),'>V+W|S,',tBpb18(0x42),tBpb18(0x43),tBpb18(0x25),tBpb18(0x44),tBpb18(0x45),tBpb18(zsDJRb(0x82)),tBpb18(0x47),tBpb18(zsDJRb(0xac)),tBpb18(zsDJRb(0xb5)),tBpb18(zsDJRb(0x77)),tBpb18(0x4b),tBpb18(0x4c),tBpb18(0x4d),tBpb18(0x4e),tBpb18(zsDJRb(0x58)),tBpb18(0x50),tBpb18(zsDJRb(0xd6)),tBpb18(0x52),tBpb18(zsDJRb(0xae)),tBpb18(zsDJRb(0x80)),tBpb18(zsDJRb(0x56)),tBpb18(zsDJRb(0x56)),tBpb18(0x55),tBpb18(zsDJRb(0x53)),tBpb18(0x54),tBpb18(0x56),tBpb18(zsDJRb(0x83)),tBpb18(zsDJRb(0x7b)),tBpb18(zsDJRb(0xaf)),tBpb18(zsDJRb(0xb0)),tBpb18(zsDJRb(0x75)),tBpb18(0x5c),tBpb18(zsDJRb(0xb1)),tBpb18(0x5e),tBpb18(0x5f),tBpb18(0x60),tBpb18(0x61),tBpb18(zsDJRb(0xb2)),tBpb18(0x63),tBpb18(zsDJRb(0x91)),tBpb18(zsDJRb(0xb3)),tBpb18(0x66),tBpb18(zsDJRb(0x9b)),tBpb18(0x68),tBpb18(zsDJRb(0xa6)),'um3G,4o|XP|CN7fsBVDV2w7Yq6yoPE',tBpb18(0x6a),tBpb18(0x6b),tBpb18(0x6c),'\u004c\u007c\u0022\u004e\u006b\u0066\u0063\u006a\u0030',tBpb18(zsDJRb(0xc4)),tBpb18(0x6e),tBpb18(zsDJRb(0xbd)),tBpb18(0x70),tBpb18(0x71),tBpb18(0x72),tBpb18(zsDJRb(0x6d)),tBpb18(zsDJRb(0x6f)),tBpb18(0x75),tBpb18(0x76),tBpb18(0x77),tBpb18(0x27),tBpb18(0x78),tBpb18(0x79),tBpb18(zsDJRb(0x8a)),tBpb18(0x7b),tBpb18(0x7c),tBpb18(0x7d),tBpb18(0x7e),tBpb18(zsDJRb(0x8c)),tBpb18(zsDJRb(0x64)),tBpb18(0x81),tBpb18(0x82),tBpb18(zsDJRb(0x87)),tBpb18(0x84),tBpb18(0x85),tBpb18(0x86),tBpb18(0x87),tBpb18(zsDJRb(0xc2)),'$T.cu73&QD(}Q!L`a|Vb]z#o0B<t#j6UFbhxgpu>dT,H)@]U^$MLF$!j`=%#*vq`xs]G3)E~n<XP#gosQ~k:_p;?NwKOx`0$&IPwK".YR|)|sJ0$9/rO{w9NEVKOCQZ;z<jmU3)%<W,I>`OL=PsKiT@}}q+f@Qe]ilJLfJ^!g6YuU;t$6B`0nKtox=0!F`i%)Opc?,x>C[cA!A%$MQ.NBk,!x|T{hM,1#V`]0N%kf|o^A)0^9OOL7w{s_^!vE$YG#_4SeN5k8!V/a!>jrVC03#}H}(4"2aF1`bj]0N%kf|i^hg*^9/5G+wL:g^!vMf6%ol/K)SNkh!.A,3>j?[fKt#CC}qp4UI9Y1Ngx8&uART.$m[>$uQY0EPN]9<KO+WcG3bFwM_z|~W2E!x[rjVIG)H*og=WC$_@G3sg/l@Bj{=o|dJ2$/<:2oHtNg=m!97{QZMtReNX^)T.Kf;Ua$QXLTKb}>Tc}o;yd&lJL%@5k+td_DW*$=<9R"wk!p*Ocm#6%;[PvM_5ks!lItx2;hlUKRzok@?NZ@@8r)52S(ZvDn<_S<[i`,O}R0C#|w*do3HXs1[k"1bh0Z?C(I3[@C:jm`nHrsuH:3[`B&4ax"dZr1u%_9H_%PqXG5spjS:h~H#uYahK:Gb;}uVsH+dnympu#7yDEM',tBpb18(0x89),tBpb18(0x46),tBpb18(0x8a),tBpb18(0x8b),'&U*mRb)j92!{^3|',tBpb18(zsDJRb(0xb8)),tBpb18(0x8d),tB
|
|
|
|
|
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"])
|