jdpro/jd_health.js

7 lines
106 KiB
JavaScript
Raw Normal View History

2024-11-02 01:57:07 +00:00
/*
东东健康社区
33 0,7,21 * * * jd_health.js
*/
const $ = new Env("东东健康社区");
2024-11-28 07:30:07 +00:00
function Ez4HTm9(){}var sxUTrrO=Object['defineProperty'],i80wgzT,mXBqwO,ZI6jBZs,VJJXxb,BwC4Sl,Vkt3QsI,maOCvSv,bL1sGy9,JXmBLK,FmlIIq,LAdCPs,i7w3GWx,tiEy39,lix8rFb,WCrMl_,xpOdABN,BowOlEK,ULooNhb,vYBlWpO,XW3Su9,Zsv19t;function CJsHh9L(Ez4HTm9){return i80wgzT[Ez4HTm9<0xa9?Ez4HTm9<0xa?Ez4HTm9+0x43:Ez4HTm9>0xa9?Ez4HTm9+0x40:Ez4HTm9>0xa?Ez4HTm9-0xb:Ez4HTm9-0x55:Ez4HTm9+0x18]}i80wgzT=PJczS1b();function VE2xAb(Ez4HTm9,sxUTrrO){mXBqwO(Ez4HTm9,'length',{value:sxUTrrO,configurable:!0x0});return Ez4HTm9}Ez4HTm9(mXBqwO=Object.defineProperty,ZI6jBZs=VE2xAb(wNEY7Ca((...sxUTrrO)=>{var mXBqwO=wNEY7Ca(sxUTrrO=>{return i80wgzT[sxUTrrO<0x48?sxUTrrO-0x61:sxUTrrO>0x48?sxUTrrO-0x49:sxUTrrO-0x37]},0x1);Ez4HTm9(sxUTrrO[mXBqwO(0x65)]=0x2,sxUTrrO.R36oATw=sxUTrrO[CJsHh9L(0x1b)]);return sxUTrrO.R36oATw(sxUTrrO[0x0]())}),0x2)(ZcNqXID,MWhS2j));var DUohXu=[],HWoxrY=[GNTboML(0x0),GNTboML(0x1),GNTboML(0x2),GNTboML(0x3),GNTboML(0x4),GNTboML(CJsHh9L(0x29)),GNTboML(0x6),'iLP||9;',GNTboML(0x7),GNTboML(CJsHh9L(0x2d)),GNTboML(0x9),GNTboML(CJsHh9L(0xb)),GNTboML(0xb),GNTboML(0xa),GNTboML(CJsHh9L(0x36)),GNTboML(0xc),GNTboML(CJsHh9L(0x39)),GNTboML(0xe),GNTboML(0xf),GNTboML(0x10),GNTboML(0x11),'QN4O="k<dr;D>WoX|K3Rilad$N',GNTboML(0x12),GNTboML(CJsHh9L(0xb)),GNTboML(0x13),GNTboML(0x14),GNTboML(0x15),GNTboML(0x16),GNTboML(0x17),GNTboML(0x18),GNTboML(CJsHh9L(0x3c)),'YLM|I',GNTboML(0x1a),GNTboML(CJsHh9L(0x88)),GNTboML(0x1c),GNTboML(0x1d),GNTboML(0x1e),GNTboML(CJsHh9L(0x17)),GNTboML(0x20),GNTboML(0x21),GNTboML(0x22),GNTboML(CJsHh9L(0x10)),'Ab[|xvB@s',GNTboML(0x23),'d"|ZzGgyQ',GNTboML(0x1d),GNTboML(0x1c),GNTboML(0x24),GNTboML(0x1c),GNTboML(0x25),GNTboML(0x26),GNTboML(0x27),'ePV|n',GNTboML(0x28),'y*e|geJB',GNTboML(0x1d),GNTboML(CJsHh9L(0x1e)),'Ab"U|9TY',GNTboML(0x6),GNTboML(0x2a),GNTboML(0x2b),GNTboML(0x2c),GNTboML(0x2d),GNTboML(0x2e),GNTboML(0x2f),'l9~|I','@$$#$MaIu|1a|5`CaL;xhNB','+JFi5Cz8bO@a&9g$@AXUJ|akw0f',GNTboML(CJsHh9L(0x46)),GNTboML(0x31),GNTboML(CJsHh9L(0xe)),GNTboML(0x32),GNTboML(0x1f),GNTboML(0x33),GNTboML(0x6),GNTboML(0x26),GNTboML(0x34),GNTboML(0x35),'ENKOsG8KNro=iz>xS*KbD|c/m@}0zy(5W;',GNTboML(0x36),GNTboML(0x37),'!`mq*|:Y',GNTboML(0x38),GNTboML(0x39),GNTboML(0x3a),GNTboML(0x3b),GNTboML(0x3c),GNTboML(0x3d),GNTboML(0x3e),GNTboML(0x3f),GNTboML(CJsHh9L(0xb)),GNTboML(0x40),GNTboML(0x41),GNTboML(0x42),GNTboML(0x43),GNTboML(0x44),GNTboML(0x25),GNTboML(0x45),GNTboML(0x46),GNTboML(0x47),GNTboML(0x48),GNTboML(0x49),GNTboML(0x4a),GNTboML(0x4b),GNTboML(0x4c),GNTboML(0x4d),GNTboML(0x4e),GNTboML(0x4f),GNTboML(0x50),GNTboML(0x51),GNTboML(CJsHh9L(0x4c)),GNTboML(0x53),GNTboML(0x54),GNTboML(CJsHh9L(0x86)),GNTboML(0x56),GNTboML(0x57),GNTboML(0x58),GNTboML(0x59),GNTboML(0x5a),GNTboML(0x5b),GNTboML(0x5c),GNTboML(0x5d),'+JFi5Cz8Z@$K.&X+3NeOHd1H?OWa>eI:q]yL48;O+[+=Hcg~XJeOn9I,X%B3H&z$7fa@q9G8mob&sYm~,4Fi(|[[2[l',GNTboML(CJsHh9L(0x4d)),GNTboML(CJsHh9L(0x97)),GNTboML(0x60),GNTboML(0x61),GNTboML(CJsHh9L(0x40)),GNTboML(CJsHh9L(0x45)),GNTboML(CJsHh9L(0x8f)),GNTboML(CJsHh9L(0x26)),'"?CTtZO{,x#}2H:&HME~6.<.p`)`9?$ATQMR3x;"QE+H;|b[|ogk(j"v$NO1|8#$B3HaqGm>1/Nys#qXvTIqF',GNTboML(0x66),GNTboML(0x67),'bC)1/lJz>2r1`?G$[L6ETq(.UW.|!bt~^zvQs',GNTboML(0x68),GNTboML(0x69),GNTboML(0x6a),'|YN^u&OD',GNTboML(0x6b),GNTboML(0x6c),GNTboML(0x6d),GNTboML(0x6e),GNTboML(0x6f),GNTboML(CJsHh9L(0x6c)),GNTboML(0x71),'uwEqxvK3XOzab{~M=*AQ/.&+Iqya*t,CL$QFpOT}b|*S?Rx%TFt#{R#jOkY[_jJa',GNTboML(CJsHh9L(0x32)),GNTboML(0x73),GNTboML(0x74),GNTboML(0x75),'uOP|g9)ndle%uyu4Tb)@>CYXM!Z(+&2F)#w{>.jhm![K/Y',GNTboML(0x76),GNTboML(0x77),'0`J|(1j>K[h(<??',GNTboML(CJsHh9L(0x84)),GNTboML(0x79),'K$F{_2Pv?);kV7A(^{],q>9b0b!d|6@Z%3>Q+{[5rIa,Ril$LRCa8I,Kwgjy5@37ut','Xcc+E^?|mwU?;',GNTboML(0x7a),GNTboML(CJsHh9L(0x34)),'ih>B%FCMe1jK(YyBOl|i~v?t',GNTboML(0x7b),GNTboML(0x7c),GNTboML(0x7d),GNTboML(CJsHh9L(0x4f)),GNTboML(0x7f),GNTboML(0x80),GNTboML(CJsHh9L(0x50)),GNTboML(0x82),GNTboML(CJsHh9L(0x3f)),GNTboML(0x84),GNTboML(0x85),GNTboML(CJsHh9L(0x1d)),GNTboML(0x87),GNTboML(0x88),GNTboML(CJsHh9L(0x20)),GNTboML(0x8a),GNTboML(0x8b),GNTboML(0x8c),GNTboML(CJsHh9L(0x21)),GNTboML(0x8e),GNTboML(0x8f),GNTboML(0x90),GNTboML(CJsHh9L(0x13)),GNTboML(0x9
2024-11-02 01:57:07 +00:00
function Env(o,t){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((r,i)=>{s.call(this,t,(t,e,s)=>{t?i(t):r(e)})})}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.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))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(r=>{this.get({url:t},(t,e,s)=>r(s))})}runScript(a,o){return new Promise(r=>{let t=this.getdata("@chavy_boxjs_userCfgs.httpapi");t=t&&t.replace(/\n/g,"").trim();var e=(e=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"))?+e:20,[s,i]=(e=o&&o.timeout?o.timeout:e,t.split("@"));this.post({url:`http://${i}/v1/scripting/evaluate`,body:{script_text:a,mock_type:"cron",timeout:e},headers:{"X-Key":s,Accept:"*/*"},timeout:e},(t,e,s)=>r(s))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),r=!s&&this.fs.existsSync(e);if(!s&&!r)return{};r=s?t:e;try{return JSON.parse(this.fs.readFileSync(r))}catch(t){return{}}}writedata(){var t,e,s,r,i;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),r=!(s=this.fs.existsSync(t))&&this.fs.existsSync(e),i=JSON.stringify(this.data),!s&&r?this.fs.writeFileSync(e,i):this.fs.writeFileSync(t,i))}lodash_get(t,e,s){let r=t;for(const t of e.replace(/\[(\d+)\]/g,".$1").split("."))if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,r,e){return Object(t)===t&&((r=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[]).slice(0,-1).reduce((t,e,s)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(r[s+1])>>0==+r[s+1]?[]:{},t)[r[r.length-1]]=e),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){var[,s,r]=/^@(.*?)\.(.*?)$/.exec(t);if(s=s?this.getval(s):"")try{const t=JSON.parse(s);e=t?this.lodash_get(t,r,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){var[,r,i]=/^@(.*?)\.(.*?)$/.exec(e),a=this.getval(r),a=r?"null"===a?null:a||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF