jdpro/jd_fwdy_draw.js

7 lines
92 KiB
JavaScript
Raw Normal View History

2024-12-01 00:41:07 +00:00
/*
1 11 * * * jd_fwdy_draw.js
*/
const $ = new Env('图书抽奖');
function HPaNTVo(){}var qHZGgE=Object['defineProperty'],GZ_QVOh,v_UxpoC,V_PFuz,JM7OWDz,uDd3XS8,HXAgTk,KKXYOhs,JmCO2WT,WhS5WOB,bgoxqh,oH75KW,ahOiyz3,plbwGcJ,LOSbrj,Hr2HgPO,lwuooA;function oRJ0E3c(HPaNTVo){return GZ_QVOh[HPaNTVo>0x5e?HPaNTVo+0x2e:HPaNTVo>-0x4e?HPaNTVo<0x5e?HPaNTVo<0x5e?HPaNTVo+0x4d:HPaNTVo+0x4e:HPaNTVo-0x41:HPaNTVo-0x28]}GZ_QVOh=HIuCon();function iTu572(HPaNTVo,qHZGgE){v_UxpoC(HPaNTVo,'length',{value:qHZGgE,configurable:!0x0});return HPaNTVo}HPaNTVo(v_UxpoC=Object.defineProperty,V_PFuz=iTu572(kNeM_1((...qHZGgE)=>{var v_UxpoC=kNeM_1(qHZGgE=>{return GZ_QVOh[qHZGgE>0x59?qHZGgE+0x2f:qHZGgE>-0x53?qHZGgE<0x59?qHZGgE>0x59?qHZGgE+0x14:qHZGgE+0x52:qHZGgE-0x14:qHZGgE-0x58]},0x1);HPaNTVo(qHZGgE.length=0x2,qHZGgE[v_UxpoC(-0x52)]=qHZGgE[0x1]);return qHZGgE[v_UxpoC(-0x52)](qHZGgE[0x0]())}),oRJ0E3c(-0x3a))(v8hpzs,AiijAFa));var FJhzSyK=[],qMqEn5=[edHp9JK(0x0),edHp9JK(0x1),edHp9JK(0x2),edHp9JK(0x3),edHp9JK(0x4),edHp9JK(0x5),edHp9JK(oRJ0E3c(-0x34)),edHp9JK(0x7),edHp9JK(0x8),edHp9JK(0x9),edHp9JK(0x8),edHp9JK(oRJ0E3c(0x12)),edHp9JK(oRJ0E3c(-0x30)),edHp9JK(0xb),edHp9JK(0xc),edHp9JK(0xd),edHp9JK(oRJ0E3c(0x58)),edHp9JK(oRJ0E3c(-0x44)),edHp9JK(0x10),edHp9JK(0x11),edHp9JK(0xc),edHp9JK(0x12),edHp9JK(0x13),edHp9JK(0x14),edHp9JK(0x15),edHp9JK(0x16),'V]!~|c>kB',edHp9JK(0x17),edHp9JK(0x18),edHp9JK(0x19),edHp9JK(0x1a),edHp9JK(0x1b),edHp9JK(0x1c),edHp9JK(0x1d),edHp9JK(0x1e),edHp9JK(oRJ0E3c(0x47)),edHp9JK(oRJ0E3c(-0x2b)),edHp9JK(0x21),edHp9JK(oRJ0E3c(-0x24)),edHp9JK(oRJ0E3c(-0x3c)),edHp9JK(0x24),edHp9JK(0x25),edHp9JK(0x26),edHp9JK(0x27),edHp9JK(0x28),edHp9JK(oRJ0E3c(0x32)),edHp9JK(0x2a),edHp9JK(0x2b),edHp9JK(oRJ0E3c(-0x49)),edHp9JK(0x2d),edHp9JK(0x2e),edHp9JK(0x2f),edHp9JK(0x30),edHp9JK(oRJ0E3c(-0x4c)),edHp9JK(oRJ0E3c(-0x4b)),'Bu7.|c3',edHp9JK(0x33),edHp9JK(0x34),edHp9JK(0x35),edHp9JK(oRJ0E3c(-0x4a)),edHp9JK(0x37),edHp9JK(0x38),edHp9JK(0x39),edHp9JK(0x3a),edHp9JK(0x3b),edHp9JK(0x7),edHp9JK(0x3c),edHp9JK(0x3d),edHp9JK(0x3e),edHp9JK(0x3f),edHp9JK(0x40),edHp9JK(0x2c),edHp9JK(0x2d),edHp9JK(0x2e),edHp9JK(oRJ0E3c(-0x14)),edHp9JK(0x2f),edHp9JK(oRJ0E3c(-0x4c)),edHp9JK(oRJ0E3c(-0x13)),edHp9JK(0x43),edHp9JK(0x44),edHp9JK(0x32),'Bu7.|c3',edHp9JK(0x37),edHp9JK(0x45),edHp9JK(oRJ0E3c(-0x17)),edHp9JK(oRJ0E3c(0x29)),edHp9JK(0x3a),edHp9JK(oRJ0E3c(-0x48)),edHp9JK(0x48),edHp9JK(0x49),edHp9JK(0x4a),edHp9JK(oRJ0E3c(-0x46)),edHp9JK(0x32),edHp9JK(0x4c),edHp9JK(oRJ0E3c(-0xd)),'f_2WiEV6WyC}+2+hLL2W_brY$~Uc6CIFs|R5j/p}ZRUcvZMFWU?W_bMF4Y=c*LzSTSHiurFm+FZ}8`Y',edHp9JK(0x4e),edHp9JK(0x4f),edHp9JK(oRJ0E3c(0x23)),edHp9JK(0x51),edHp9JK(0x52),edHp9JK(oRJ0E3c(-0x39)),edHp9JK(0x54),edHp9JK(0x55),edHp9JK(0x56),edHp9JK(oRJ0E3c(-0x45)),edHp9JK(0x10),edHp9JK(0x58),edHp9JK(0x3e),edHp9JK(0x59),edHp9JK(0x58),edHp9JK(0x3e),edHp9JK(0x3a),edHp9JK(0x2c),edHp9JK(0x2f),edHp9JK(0x30),edHp9JK(0x5a),edHp9JK(0x5b),edHp9JK(oRJ0E3c(-0x4b)),'Bu7.|c3',edHp9JK(oRJ0E3c(-0x4a)),edHp9JK(0x5c),edHp9JK(0x5d),edHp9JK(0x5e),edHp9JK(0x46),edHp9JK(oRJ0E3c(-0x47)),edHp9JK(0x5f),edHp9JK(0x60),edHp9JK(oRJ0E3c(-0x1)),edHp9JK(0x62),edHp9JK(0x63),edHp9JK(0x64),edHp9JK(oRJ0E3c(0x56)),edHp9JK(0x66),edHp9JK(0x67),edHp9JK(0x68),edHp9JK(0x69),edHp9JK(0x6a),edHp9JK(0x2d),edHp9JK(oRJ0E3c(-0x29)),edHp9JK(0x6c),edHp9JK(0x6d),edHp9JK(0x6e),edHp9JK(0x6f),edHp9JK(oRJ0E3c(-0x49)),edHp9JK(oRJ0E3c(-0x1f)),edHp9JK(0x71),edHp9JK(0x72),edHp9JK(0x2f),edHp9JK(oRJ0E3c(-0x4c)),edHp9JK(0x73),edHp9JK(0x32),'Bu7.|c3',edHp9JK(0x74),edHp9JK(0x37),edHp9JK(0x45),edHp9JK(0x75),edHp9JK(0x46),edHp9JK(0x3a),edHp9JK(oRJ0E3c(-0x48)),edHp9JK(0x76),edHp9JK(0x77),edHp9JK(0x78),edHp9JK(0x79),edHp9JK(oRJ0E3c(-0x23)),edHp9JK(0x7b),edHp9JK(0x7c),edHp9JK(oRJ0E3c(-0x49)),edHp9JK(0x2d),edHp9JK(0x72),edHp9JK(0x6b),edHp9JK(oRJ0E3c(-0x20)),edHp9JK(0x7e),'_yfz"/>FY8|}pW=:V]/~Sps`rY',edHp9JK(oRJ0E3c(0x4c)),edHp9JK(0x48),edHp9JK(0x80),edHp9JK(0x81),edHp9JK(oRJ0E3c(0xa)),edHp9JK(0x83),edHp9JK(oRJ0E3c(0xb)),edHp9JK(0x85),edHp9JK(0x86),edHp9JK(0x87),edHp9JK(0x88),edHp9JK(0x89),edHp9JK(oRJ0E3c(-0x2d)),edHp9JK(oRJ0E3c(-0x26)),edHp9JK(0x8c),edHp9JK(0x10),edHp9JK(0x8d),edHp9JK(0x8e),edHp9JK(oRJ0E3c(0x18)),'Bu7.|c=I#RMP_i$7+1o.]({?v9.f%X',edHp9JK(0x90),edHp9JK(oRJ0E
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