mirror of https://github.com/6dylan6/jdpro.git
7 lines
101 KiB
JavaScript
7 lines
101 KiB
JavaScript
|
/*
|
||
|
45 1 * * * jd_dyf_draw.js
|
||
|
*/
|
||
|
|
||
|
const $ = new Env('买药抽奖');
|
||
|
function yoeDH0(){}var rgr0G0P=Object['defineProperty'],qkhjkP,g0Iyuw,xn9NZ2,AKYVDR,HjhD0l,seBJR2,rl1w_y,OjYjFL,xZkZVxN,KEHNON,uEypBXP,M5hkSjR,UdSdk2o,qTb8ER,EN1unm,PiPhAq,Ykg26bn,N6sMWF,uyK86Qr;function Ew0FLf2(yoeDH0){return qkhjkP[yoeDH0<0xfd?yoeDH0-0x9:yoeDH0+0x29]}qkhjkP=oUOHq2();function jXHIOY(yoeDH0,rgr0G0P){var xn9NZ2=yu1Vepy(yoeDH0=>{return qkhjkP[yoeDH0<0x4a?yoeDH0-0x8:yoeDH0>0x13f?yoeDH0-0x58:yoeDH0>0x13f?yoeDH0+0x4:yoeDH0-0x4b]},0x1);return g0Iyuw(yoeDH0,xn9NZ2(0x7d),{value:rgr0G0P,configurable:xn9NZ2(0x99)})}yoeDH0(g0Iyuw=Object.defineProperty,xn9NZ2=yu1Vepy((yoeDH0,rgr0G0P)=>{return rgr0G0P(yoeDH0())},0x2)(sDcgKq,zYJnrpv));var CY89Bxg=[],IoYcKcc=[r08qtvf(0x0),r08qtvf(0x1),r08qtvf(Ew0FLf2(0x3d)),r08qtvf(Ew0FLf2(0x30)),r08qtvf(0x4),r08qtvf(0x5),r08qtvf(Ew0FLf2(0x38)),r08qtvf(Ew0FLf2(0x35)),r08qtvf(0x8),r08qtvf(Ew0FLf2(0x44)),r08qtvf(0xa),r08qtvf(0xb),r08qtvf(Ew0FLf2(0x34)),r08qtvf(0xd),r08qtvf(Ew0FLf2(0x52)),'fo|hTxvYz6',r08qtvf(0xf),r08qtvf(0x10),r08qtvf(Ew0FLf2(0x3c)),r08qtvf(0x12),r08qtvf(Ew0FLf2(0x9)),r08qtvf(0x14),r08qtvf(0xf),r08qtvf(0x11),r08qtvf(Ew0FLf2(0x9)),r08qtvf(Ew0FLf2(0x10)),r08qtvf(0x13),r08qtvf(0x15),r08qtvf(0xf),r08qtvf(Ew0FLf2(0x75)),r08qtvf(Ew0FLf2(0x7d)),r08qtvf(Ew0FLf2(0x7b)),r08qtvf(0x19),r08qtvf(Ew0FLf2(0x81)),'tG|h$lR^MG','tG|h$lsD',r08qtvf(Ew0FLf2(0x62)),r08qtvf(0x1c),r08qtvf(Ew0FLf2(0x63)),r08qtvf(0x1e),r08qtvf(Ew0FLf2(0x31)),r08qtvf(Ew0FLf2(0xf0)),r08qtvf(0x21),r08qtvf(0x22),r08qtvf(0x23),r08qtvf(0x24),r08qtvf(0x25),r08qtvf(0x26),r08qtvf(0x27),r08qtvf(0x28),r08qtvf(0x29),r08qtvf(0x2a),'<x[niT"9:hRJ@o^+RK7IxNJ&!zflz6QaLRoq3m|~A1^/:F&|2:,2(',r08qtvf(0x2b),r08qtvf(0x1c),'|N9?0|x)c"@lOCy3aYAmh,)a2DqH/(P*cgc)2zhp"uKb@GAf',r08qtvf(0x2c),r08qtvf(0x2d),r08qtvf(0x2e),r08qtvf(0x2f),r08qtvf(Ew0FLf2(0x3a)),r08qtvf(0x31),r08qtvf(Ew0FLf2(0x36)),r08qtvf(0x33),r08qtvf(0x34),r08qtvf(Ew0FLf2(0x2e)),r08qtvf(0x36),r08qtvf(Ew0FLf2(0x6c)),r08qtvf(Ew0FLf2(0x6f)),r08qtvf(0x39),r08qtvf(0x3a),r08qtvf(0x3b),r08qtvf(0x3c),'x?o[~sm".uB;N^lOBYn7?J;5hw|/weqXRB^2U+4Wt!l{.v54C.(Cf',r08qtvf(0x3d),r08qtvf(0x3e),r08qtvf(Ew0FLf2(0x20)),r08qtvf(Ew0FLf2(0x7c)),r08qtvf(0x41),r08qtvf(Ew0FLf2(0x5c)),r08qtvf(0x43),r08qtvf(Ew0FLf2(0x7e)),'W$W^/T|Z',r08qtvf(Ew0FLf2(0x80)),r08qtvf(0x46),r08qtvf(0x47),r08qtvf(0x48),r08qtvf(0x49),r08qtvf(0x4a),r08qtvf(0x4b),r08qtvf(Ew0FLf2(0x4d)),r08qtvf(Ew0FLf2(0x4f)),r08qtvf(Ew0FLf2(0xb)),r08qtvf(Ew0FLf2(0x69)),r08qtvf(Ew0FLf2(0x84)),r08qtvf(0x51),r08qtvf(0x52),'TX%9LB=|BilJRk',r08qtvf(0x53),r08qtvf(0x54),r08qtvf(0x55),r08qtvf(Ew0FLf2(0xa)),r08qtvf(0x57),r08qtvf(0x53),r08qtvf(Ew0FLf2(0xa)),r08qtvf(0x58),r08qtvf(0x59),r08qtvf(0x5a),r08qtvf(Ew0FLf2(0x5e)),'$X|m<',r08qtvf(Ew0FLf2(0xb)),r08qtvf(Ew0FLf2(0xa)),r08qtvf(0x4e),r08qtvf(Ew0FLf2(0x7f)),r08qtvf(Ew0FLf2(0x37)),r08qtvf(Ew0FLf2(0x66)),r08qtvf(Ew0FLf2(0x8b)),r08qtvf(0x1c),r08qtvf(0x29),r08qtvf(0x5d),r08qtvf(0x5e),r08qtvf(0x5f),r08qtvf(Ew0FLf2(0x5a)),r08qtvf(Ew0FLf2(0xc)),r08qtvf(0x62),r08qtvf(Ew0FLf2(0xec)),r08qtvf(0x64),r08qtvf(Ew0FLf2(0x96)),r08qtvf(0x66),r08qtvf(0x67),r08qtvf(Ew0FLf2(0x9e)),r08qtvf(Ew0FLf2(0x1e)),r08qtvf(Ew0FLf2(0x58)),'m|8X3mUjQi0@jBka',r08qtvf(0x6b),'m|8X3m;Z',r08qtvf(Ew0FLf2(0xd)),r08qtvf(0x6d),r08qtvf(0x6e),r08qtvf(Ew0FLf2(0xe)),r08qtvf(Ew0FLf2(0xf)),r08qtvf(0x14),r08qtvf(0x70),r08qtvf(Ew0FLf2(0x12)),r08qtvf(Ew0FLf2(0x14)),r08qtvf(0x72),r08qtvf(0x73),r08qtvf(0x74),r08qtvf(0x75),r08qtvf(Ew0FLf2(0x9b)),r08qtvf(0x77),r08qtvf(0x78),'=+@F%@qS|9mX4[Y5jT2F',r08qtvf(Ew0FLf2(0x18)),r08qtvf(0x7a),r08qtvf(0x7b),r08qtvf(Ew0FLf2(0xa7)),r08qtvf(0x7d),r08qtvf(0x1c),r08qtvf(0x28),r08qtvf(0x7e),r08qtvf(Ew0FLf2(0x1c)),r08qtvf(Ew0FLf2(0x95)),r08qtvf(Ew0FLf2(0xc)),r08qtvf(0x81),r08qtvf(0x63),r08qtvf(Ew0FLf2(0x94)),r08qtvf(Ew0FLf2(0x93)),r08qtvf(0x84),r08qtvf(Ew0FLf2(0x11)),r08qtvf(0x69),r08qtvf(Ew0FLf2(0xa8)),Ew0FLf2(0x16),r08qtvf(0x87),r08qtvf(Ew0FLf2(0x17)),r08qtvf(Ew0FLf2(0xd)),r08qtvf(Ew0FLf2(0x1f)),r08qtvf(Ew0FLf2(0x1a)),r08qtvf(Ew0FLf2(0xe)),r08qtvf(Ew0FLf2(0xf)),r08qtvf(Ew0FLf2(0x10)),r08qtvf(Ew0FLf2(0x21)),r08qtvf(Ew0FLf2(0x26)),r08qtvf(0x1c),r08qtvf(0x79),r08qtvf(0x8b),r08qtvf(Ew0FLf2(0xaa)),r08qtvf(Ew0FLf2(0x19)),r08qtvf(0x76),
|
||
|
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
|