2024-10-11 14:47:15 +08:00
|
|
|
|
function bJtyvQH(){}var mxOhmi=Object['defineProperty'],f9IA1s,LdS3saG,F7jH4Nw,TpuHzk,HpXZWJ,Jytgdm,d6DAgSa,_WFiz_n,jfsg3iS,OtHHAg,gWF53ff,mDhKov,_jYEWXH,nb9qZH,nuPt_a,a5PYyiH,Z5uLAJu,xU_SwC,l1EoKbk;function vZUB4S(bJtyvQH){return f9IA1s[bJtyvQH<0x7a?bJtyvQH>-0x54?bJtyvQH>-0x54?bJtyvQH>-0x54?bJtyvQH+0x53:bJtyvQH-0x38:bJtyvQH+0xb:bJtyvQH+0x3c:bJtyvQH-0x47]}f9IA1s=D5CiUXm();function XdPF3N(bJtyvQH,mxOhmi){return LdS3saG(bJtyvQH,vZUB4S(-0x4c),{value:mxOhmi,configurable:vZUB4S(0x2)})}bJtyvQH(LdS3saG=Object.defineProperty,F7jH4Nw=reW9OT((bJtyvQH,mxOhmi)=>{return mxOhmi(bJtyvQH())},0x2)(gCYc9Ru,vD1XZT));var OKTh1e=[],q5r6KW=['\x4a\x61\x7c\x77\x30\x60\x2f\x41',ZfZ776(vZUB4S(-0x4a)),ZfZ776(vZUB4S(-0x46)),ZfZ776(0x2),ZfZ776(0x3),ZfZ776(vZUB4S(-0x4b)),ZfZ776(0x5),ZfZ776(vZUB4S(-0x42)),ZfZ776(vZUB4S(-0x2c)),ZfZ776(vZUB4S(-0x2d)),ZfZ776(vZUB4S(-0x2a)),ZfZ776(0xa),ZfZ776(vZUB4S(-0xd)),ZfZ776(vZUB4S(-0x40)),ZfZ776(0xd),ZfZ776(vZUB4S(-0x37)),ZfZ776(vZUB4S(-0x27)),ZfZ776(0x10),ZfZ776(0x11),ZfZ776(0x12),ZfZ776(0x13),ZfZ776(0x14),ZfZ776(vZUB4S(-0x25)),ZfZ776(0x16),ZfZ776(0x17),ZfZ776(0x18),'\x35\x71\x30\x21\x46\x4f\x5b\x49\x50\x64\x63\x23\x32\x46\x7b\x25\x21\x2b\x39\x49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fZ776(0x47),ZfZ776(0x48),ZfZ776(0x49),ZfZ776(0x23),ZfZ776(0x4a),ZfZ776(0x4b),ZfZ776(0x4c),ZfZ776(0x4d),ZfZ776(0x4e),ZfZ776(0x4f),ZfZ776(0x50),ZfZ776(0x51),ZfZ776(0x52),ZfZ776(0x53),ZfZ776(0x54),ZfZ776(0x55),ZfZ776(vZUB4S(-0x3d)),ZfZ776(0x57),ZfZ776(0x2a),ZfZ776(0x2a),ZfZ776(vZUB4S(-0x2e)),ZfZ776(0x59),ZfZ776(vZUB4S(-0x2)),ZfZ776(0x5b),ZfZ776(vZUB4S(-0x3)),ZfZ776(0x5c),ZfZ776(0x55),ZfZ776(0x5d),ZfZ776(0x5e),ZfZ776(0x5f),ZfZ776(0x60),ZfZ776(0x61),ZfZ776(vZUB4S(-0x44)),ZfZ776(0x5e),ZfZ776(0x29),ZfZ776(0x63),ZfZ776(vZUB4S(0x4)),ZfZ776(0x65),ZfZ776(0x66),ZfZ776(0x67),ZfZ776(0x68),ZfZ776(vZUB4S(-0x3e)),ZfZ776(vZUB4S(0x1e)),ZfZ776(vZUB4S(0x4a)),ZfZ776(0x6b),ZfZ776(0x5e),ZfZ776(0x28),ZfZ776(vZUB4S(0x0)),ZfZ776(0x6c),ZfZ776(vZUB4S(0x8)),ZfZ776(vZUB4S(0x1)),ZfZ776(vZUB4S(-0x51)),ZfZ776(0x6f),ZfZ776(0x70),ZfZ776(vZUB4S(0x9)),ZfZ776(0x72),ZfZ776(0x2a),ZfZ776(0x2a),'(EDQ<|#q',ZfZ776(0x73),ZfZ776(0x74),ZfZ776(0x75),ZfZ776(0x76),ZfZ776(vZUB4S(0xa)),ZfZ776(0x78),'8uZ+%&~~^6p|mK',ZfZ776(vZUB4S(-0x10)),ZfZ776(0x7a),'\u007e\u004d\u0056\u0023\u007c\u002f\u0071\u0037',ZfZ776(vZUB4S(0xc)),ZfZ776(0x7c),ZfZ776(0x7d),ZfZ776(vZUB4S(0x10)),ZfZ776(0x7f),ZfZ776(vZUB4S(0xf)),ZfZ776(vZUB4S(0x11)),'\x3e\x77\x55\x59\x4a\x46\x4f\x7c\x6c\x2c\x52\x37\x25\x30\x47\x58\x7e\x5a\x69','lnf|![Tq',ZfZ776(0x82),ZfZ776(0x83),ZfZ776(vZUB4S(-0x9)),ZfZ776(vZUB4S(-0x7)),ZfZ776(0x86),ZfZ776(0x87),ZfZ776(0x88),ZfZ776(vZUB4S(0x15)),ZfZ776(0x8a),ZfZ776(vZUB4S(0x16)),ZfZ776(0x8c),ZfZ776(vZUB4S(-0x43)),ZfZ776(vZUB4S(0x19)),ZfZ776(0x8c),ZfZ776(0x8e),ZfZ776(0x8f),ZfZ776(0x90),ZfZ776(vZUB4S(-0x30)),ZfZ776(vZUB4S(-0x52)),ZfZ776(vZUB4S(-0x53)),ZfZ776(0x92),ZfZ776(0x2a),ZfZ776(vZUB4S(0x1b)),ZfZ776(vZUB4S(-0x35)),ZfZ776(0x95),ZfZ776(0x96),ZfZ776(0x97),ZfZ776(0x6f),ZfZ776(0x98),ZfZ776(0x99),ZfZ776(0x63),ZfZ776(0x9a),ZfZ776(0x9b),ZfZ7
|
|
|
|
|
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"])
|