jdpro/jd_hx_draw.js

7 lines
91 KiB
JavaScript
Raw Normal View History

2024-10-02 12:37:22 +00:00
/*
5 5 * * * jd_hx_draw.js
*/
const $ = new Env('惠寻抽奖');
function KyPgDeF(){}var O8iGtB=Object['defineProperty'],tDsImy,oJ9Nyp,m_2vyb,n3Q7kI,WhicKz,aCP1_X,DxoGh6,iVx8UeR,F_Qvtw,LRebjby,ZPD9yWU,J7_2pz,bVW9AR,CFkGBPB,YzeflpW,kRkDoG3,jWE0Os,WNH8VBS,_8COZo;function J785wYv(KyPgDeF){return tDsImy[KyPgDeF>0x8b?KyPgDeF-0xf:KyPgDeF+0x4d]}tDsImy=VK1sI8();function NemzHV(KyPgDeF,O8iGtB){return oJ9Nyp(KyPgDeF,'length',{value:O8iGtB,configurable:J785wYv(0x2b)})}KyPgDeF(oJ9Nyp=Object.defineProperty,m_2vyb=NemzHV(MeMZAxz((...O8iGtB)=>{var oJ9Nyp=MeMZAxz(O8iGtB=>{return tDsImy[O8iGtB>0xff?O8iGtB+0xd:O8iGtB>0x26?O8iGtB<0xff?O8iGtB-0x27:O8iGtB+0x26:O8iGtB-0x2a]},0x1);KyPgDeF(O8iGtB[oJ9Nyp(0x64)]=J785wYv(-0x4d),O8iGtB[0xc1]=-oJ9Nyp(0xdc));if(O8iGtB[0xc1]>oJ9Nyp(0x29)){return O8iGtB[-J785wYv(-0x4a)]}else{var m_2vyb=MeMZAxz(O8iGtB=>{return tDsImy[O8iGtB>-0x3f?O8iGtB<0x9a?O8iGtB+0x3e:O8iGtB+0x61:O8iGtB-0x5f]},0x1);return O8iGtB[m_2vyb(-0x3d)](O8iGtB[J785wYv(-0x29)]())}}),J785wYv(-0x4d))(WsoVtW5,lP1ZMFX));var b3WuHe=[],O5cnRx=[sOG_Y4U(0x0),sOG_Y4U(J785wYv(-0x4c)),sOG_Y4U(J785wYv(-0x4d)),sOG_Y4U(J785wYv(-0x24)),sOG_Y4U(0x4),sOG_Y4U(0x5),sOG_Y4U(0x6),sOG_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0x48),'|I!rUh8',sOG_Y4U(0xc),sOG_Y4U(J785wYv(-0x17)),sOG_Y4U(0x10),sOG_Y4U(0x1c),sOG_Y4U(J785wYv(-0x37)),sOG_Y4U(0x4f),sOG_Y4U(J785wYv(0xb)),sOG_Y4U(0x51),sOG_Y4U(J785wYv(-0x36)),sOG_Y4U(0x53),sOG_Y4U(0x54),sOG_Y4U(J785wYv(0x1f)),sOG_Y4U(0x56),sOG_Y4U(J785wYv(-0x46)),sOG_Y4U(J785wYv(-0x45)),sOG_Y4U(J785wYv(-0x44)),sOG_Y4U(0x5a),sOG_Y4U(J785wYv(-0x3a)),sOG_Y4U(J785wYv(-0x43)),sOG_Y4U(0x5d),sOG_Y4U(0x2a),sOG_Y4U(J785wYv(-0x42)),'OJ|vCb=Ml',sOG_Y4U(J785wYv(-0x3e)),sOG_Y4U(J785wYv(-0x41)),sOG_Y4U(0x10),sOG_Y4U(0x64),sOG_Y4U(J785wYv(-0x3d)),sOG_Y4U(J785wYv(-0x40)),sOG_Y4U(0x49),sOG_Y4U(0x66),sOG_Y4U(0x69),sOG_Y4U(0x10),sOG_Y4U(J785wYv(-0x3f)),sOG_Y4U(0x68),sOG_Y4U(J785wYv(0x18)),sOG_Y4U(0x6a),sOG_Y4U(0x56),sOG_Y4U(J785wYv(-0x32)),sOG_Y4U(J785wYv(-0x2e)),sOG_Y4U(J785wYv(0x2c)),sOG
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.d