jdpro/jd_superhb.js

6 lines
77 KiB
JavaScript
Raw Normal View History

2024-10-19 06:21:18 +00:00
/*
cron:2 2 29 2
*/
const $ = new Env('惊喜红包领取');
function lZQjB3z(){}var v5qvvu=Object['defineProperty'],i7r3Iv,PUmq5xj,UFEgMS,tiGyK7,wbdVJY,ZNXiu1,qsvL0w,RGsxVdG,OH1NNJ,RcQ2qV,q1x1V46,w3DhXKN,O86lhY,GWhP9OX,mZrlsyk,W4Jwfue,Pnak6lh,My1Nr8;function ElRkeBM(lZQjB3z){return i7r3Iv[lZQjB3z>0x96?lZQjB3z-0x37:lZQjB3z+0x3f]}i7r3Iv=Uc1QxZ();function eIPdQTE(lZQjB3z,v5qvvu){var UFEgMS=JOTCVg(lZQjB3z=>{return i7r3Iv[lZQjB3z<0xeb?lZQjB3z>0xeb?lZQjB3z+0x2d:lZQjB3z>0x15?lZQjB3z<0x15?lZQjB3z-0xb:lZQjB3z-0x16:lZQjB3z-0x3:lZQjB3z+0x3a]},0x1);return PUmq5xj(lZQjB3z,UFEgMS(0x24),{value:v5qvvu,configurable:!0x0})}lZQjB3z(PUmq5xj=Object.defineProperty,UFEgMS=JOTCVg((lZQjB3z,v5qvvu)=>{return v5qvvu(lZQjB3z())},0x2)(pN1AnkJ,diw5MlA));var isM18aT=[],iusqAvR=[LYl6PX(ElRkeBM(-0x2c)),LYl6PX(ElRkeBM(-0x29)),LYl6PX(0x2),LYl6PX(ElRkeBM(-0x2f)),LYl6PX(ElRkeBM(-0x2b)),LYl6PX(0x5),LYl6PX(ElRkeBM(-0x15)),LYl6PX(0x7),LYl6PX(ElRkeBM(-0x12)),LYl6PX(ElRkeBM(0x75)),LYl6PX(ElRkeBM(-0x2)),LYl6PX(0xb),LYl6PX(0xc),LYl6PX(0xd),LYl6PX(0xe),'%R{k6569JAv|LstG*<6&$ils','@G<5f:5Ly|XBNH',LYl6PX(ElRkeBM(-0x1f)),LYl6PX(0x10),LYl6PX(0x11),'SPy5O!.sN|o<SXhG+n',LYl6PX(0x12),LYl6PX(0x13),LYl6PX(ElRkeBM(-0x34)),LYl6PX(0x12),LYl6PX(ElRkeBM(-0x36)),LYl6PX(ElRkeBM(0x4)),LYl6PX(ElRkeBM(0x6)),LYl6PX(0x18),LYl6PX(0x19),LYl6PX(0xf),LYl6PX(ElRkeBM(-0x3f)),LYl6PX(0x11),LYl6PX(0x1a),LYl6PX(0x11),LYl6PX(0xd),LYl6PX(0xf),LYl6PX(ElRkeBM(-0x3f)),LYl6PX(ElRkeBM(0x5)),LYl6PX(0x1c),LYl6PX(ElRkeBM(-0x19)),'TxKg|leY@x',LYl6PX(ElRkeBM(0x15)),LYl6PX(0x18),LYl6PX(ElRkeBM(0x14)),LYl6PX(0x20),LYl6PX(0x21),LYl6PX(ElRkeBM(0x19)),LYl6PX(ElRkeBM(0x16)),LYl6PX(0x24),LYl6PX(0x25),LYl6PX(0x26),LYl6PX(0x13),LYl6PX(0x14),LYl6PX(0x15),LYl6PX(0x12),LYl6PX(0x12),LYl6PX(ElRkeBM(-0x33)),LYl6PX(0x28),'rs|:Mo[REv?J!M>q:#AREHw!05)t:[||22?M(,#V_b2`WN9rX}v5xi{;:bE,m57;gauaA/}O[7|w?/uqhx"|=kPJ[B[%;%xlG9Lwl>!U"',LYl6PX(0x29),LYl6PX(0x2a),LYl6PX(0x2b),'|Rxkr<.s',LYl6PX(ElRkeBM(-0x10)),LYl6PX(ElRkeBM(-0xe)),LYl6PX(ElRkeBM(0x18)),LYl6PX(0x2f),LYl6PX(0x30),LYl6PX(0x31),LYl6PX(0x32),LYl6PX(0x33),LYl6PX(ElRkeBM(-0x32)),LYl6PX(0x35),LYl6PX(0x36),LYl6PX(ElRkeBM(0x1b)),'"eg1F<d|~C1:u',LYl6PX(ElRkeBM(0x2e)),LYl6PX(0x39),LYl6PX(ElRkeBM(-0x3d)),LYl6PX(0x3a),LYl6PX(0x2a),LYl6PX(0x3b),LYl6PX(0x3c),LYl6PX(0x3d),LYl6PX(ElRkeBM(0x1d)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eBM(-0x1d)),LYl6PX(0x76),LYl6PX(ElRkeBM(0x41)),'&|^Yz',LYl6PX(ElRkeBM(-0x3c)),LYl6PX(0x4b),LYl6PX(0x78),LYl6PX(0x79),LYl6PX(0x7a),LYl6PX(0x7b),LYl6PX(0x51),LYl6PX(ElRkeBM(0x2b)),LYl6PX(ElRkeBM(-0x3b)),LYl6PX(ElRkeBM(-0x3a)),LYl6PX(0x7c),LYl6PX(ElRkeBM(-0x2d)),LYl6PX(0x57),LYl6PX(ElRkeBM(-0x39)),LYl6PX(0x3a),LYl6PX(ElRkeBM(0x6f)),LYl6PX(0x7e),LYl6PX(ElRkeBM(-0x20)),LYl6PX(0x80),LYl6PX(0x5e),LYl6PX(ElRkeBM(-0x35)),LYl6PX(0x82),LYl6PX(ElRkeBM(-0x1b)),'|RDdK`nn',LYl6PX(0x83),LYl6PX(0x62),LYl6PX(0x84),LYl6PX(0x85),'L~w"2i,L}|6#8!?R^|n`fk;ho|qAmZx.rG?]:3#9T',LYl6PX(ElRkeBM(0x42)),LYl6PX(ElRkeBM(0x11)),LYl6PX(0xd),LYl6PX(ElRkeBM(-0x38)),LYl6PX(ElRkeBM(-0x37)),LYl6PX(ElRkeBM(0x43)),LYl6PX(ElRkeBM(0x44)),'&G~k#B|n',LYl6PX(0x89),LYl6PX(ElRkeBM(-0x21)),LYl6PX(0x8a)
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