jdpro/jd_superhb.js

6 lines
72 KiB
JavaScript
Raw Normal View History

2024-10-19 06:21:18 +00:00
/*
2024-10-19 06:22:03 +00:00
cron:2 2 29 2 *
2024-10-19 06:21:18 +00:00
*/
const $ = new Env('惊喜红包领取');
2024-11-02 10:04:45 +00:00
function JJaO16y(){}var tY1QzlR=Object['defineProperty'],mWJ8SK,WY6d2mm,fekbm2,lTgEcL,ejlptnx,bgojf8,tslPGVC,kwQk59,QOZWAdx,m4y1T6,i9SC6A,Vxd5LIo,_HQivJ,PrNYuUv,urnp9l,NjUzXnR,_shTXlv,UV5GGL,kovntdz,l5Pk0uM;function ACGOxv(JJaO16y){return mWJ8SK[JJaO16y<0xb9?JJaO16y>0x2?JJaO16y-0x3:JJaO16y+0x1d:JJaO16y-0x4c]}mWJ8SK=QjYFea();function JV_0B0a(JJaO16y,tY1QzlR){return WY6d2mm.call(ACGOxv(0x3f),JJaO16y,ACGOxv(0x11),{value:tY1QzlR,configurable:!0x0})}JJaO16y(WY6d2mm=Object.defineProperty,fekbm2=JV_0B0a(S_GuEi7((...tY1QzlR)=>{var WY6d2mm=S_GuEi7(tY1QzlR=>{return mWJ8SK[tY1QzlR<-0x53?tY1QzlR-0x49:tY1QzlR<0x64?tY1QzlR+0x52:tY1QzlR-0x2b]},0x1);JJaO16y(tY1QzlR.length=0x2,tY1QzlR[0x1b]=WY6d2mm(-0x52));if(tY1QzlR[0x1b]>0x75){var fekbm2=S_GuEi7(tY1QzlR=>{return mWJ8SK[tY1QzlR>0x60?tY1QzlR<0x117?tY1QzlR>0x60?tY1QzlR<0x117?tY1QzlR-0x61:tY1QzlR+0x60:tY1QzlR+0x14:tY1QzlR-0xf:tY1QzlR-0x3d]},0x1);return tY1QzlR[-fekbm2(0x62)]}else{return tY1QzlR[tY1QzlR[0x1b]-(tY1QzlR[0x1b]-ACGOxv(0x16))](tY1QzlR[0x0]())}}),0x2)(Bn4D_u,ANs7ZJ));var H7_2LI0=[],mmaD4R=[OedY5Q(ACGO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),OedY5Q(0x33),'|2Xs',OedY5Q(ACGOxv(0x10)),OedY5Q(0x34),OedY5Q(ACGOxv(0x4e)),ACGOxv(0x6),OedY5Q(ACGOxv(0x4a)),'&*cRP:7;qkX|I','a$,X|0L6pG',OedY5Q(0x37),OedY5Q(0x38),OedY5Q(0x39),OedY5Q(ACGOxv(0x53)),OedY5Q(ACGOxv(0x8)),OedY5Q(0x3b),OedY5Q(0x3a),OedY5Q(ACGOxv(0x50)),OedY5Q(ACGOxv(0x3)),OedY5Q(0x21),OedY5Q(0x3d),OedY5Q(ACGOxv(0x4f)),OedY5Q(0x3f),OedY5Q(0x40),OedY5Q(ACGOxv(0x21)),OedY5Q(ACGOxv(0x7)),OedY5Q(0x43),OedY5Q(0x44),'qT#9A49&No|yI',OedY5Q(0x45),OedY5Q(0x46),OedY5Q(0x47),'}5&DQ|"I',OedY5Q(0x48),OedY5Q(ACGOxv(0x8d)),OedY5Q(ACGOxv(0x9)),OedY5Q(ACGOxv(0xa)),'wRX9+#3;~hNM>iPv&?W[L|@p',OedY5Q(ACGOxv(0x5a)),OedY5Q(ACGOxv(0xb)),OedY5Q(ACGOxv(0x5b)),OedY5Q(0x4f),OedY5Q(0x50),'uM+SlP|vvk',OedY5Q(0x51),OedY5Q(0x52),OedY5Q(0x53),OedY5Q(ACGOxv(0x62)),OedY5Q(ACGOxv(0xd)),OedY5Q(ACGOxv(0x24)),'UL|My/II',OedY5Q(ACGOxv(0xa6)),OedY5Q(0x58),OedY5Q(0x59),'<*wDQ|Lfa',OedY5Q(0x5a),OedY5Q(ACGOxv(0x27)),'aw|Rf3taLoS]x#E8koI}/DK7Uo4hbCPvBTE[?y];H',OedY5Q(0x5c),OedY5Q(0x5d),OedY5Q(0x10),OedY5Q(ACGOxv(0x3)),OedY5Q(0x5e),OedY5Q(ACGOxv(0x67)),OedY5Q(0x60),OedY5Q(0x61),OedY5Q(ACGOxv(0x68)),OedY5Q(0x63),OedY5Q(0x64),OedY5Q(0x65),',L1D2|wp',OedY5Q(ACGOxv(0x18)),OedY5Q(0x40),OedY5Q(0x41),OedY5Q(ACGOxv(0x7)),OedY5Q(ACGOxv(0x29)),OedY5Q(ACGOxv(0x8)),OedY5Q(0x45),OedY5Q(ACGOxv(0x2c)),OedY5Q(0x67),OedY5Q(0x68),OedY5Q(ACGOxv(0x3d)),OedY5Q(0x6a),OedY5Q(ACGOxv(0x2d)),OedY5Q(0x6c),OedY5Q(ACGOxv(0x9)),OedY5Q(ACGOxv(0xa)),'wRX9+#3;~hNM>iPv&?W[L|@p',OedY5Q(0x6d),OedY5Q(ACGOxv(0x69)),OedY5Q(ACGOxv(0xb)),'aw|R&`Y',OedY5Q(0x6f),OedY5Q(0x2b),OedY5Q(0x51),OedY5Q(ACGOxv(0x6c)),OedY5Q(0x71),OedY5Q(0x72),OedY5Q(0x73),OedY5Q(0x74),OedY5Q(0x57),OedY5Q(0x75),OedY5Q(ACGOxv(0x74)),OedY5Q(ACGOxv(0x34)),'{$sWKqj|',OedY5Q(0x78),OedY5Q(0x79),OedY5Q(ACGOxv(0x66)),OedY5Q(0x7b),OedY5Q(ACGOxv(0x70)),OedY5Q(ACGOxv(0xe)),OedY5Q(0x10),OedY5Q(ACGOxv(0xc)),OedY5Q(0x7f),OedY5Q(0x80),OedY5Q(ACGOxv(0x3)),OedY5Q(0x81),OedY5Q(0x82),'d/Iqb]`|',OedY5Q(0x83
2024-10-19 06:21:18 +00:00
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