jdpro/jd_joypark_task.js

6 lines
93 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
38 8,13 * * * jd_joypark_task.js
*/
const $ = new Env('汪汪庄园任务');
2024-11-26 04:35:52 +00:00
function P3S97Hs(){}var b7ICnf=Object['defineProperty'],b5eK3a,yZ6phXG,uwg5Wh,Ivoe4v,cDWj8U,ZocA4J,Do6xLi,MLtVZ0B,qaP3_vt,FCuNwb,Me9EFZ,JPIsoXg,REXo1wB,VsRk1Y,I39ziD5,Jj30VN,nZpyLPb,MECGcc,aBpgB_;function UlnODD(P3S97Hs){return b5eK3a[P3S97Hs>0x31?P3S97Hs+0x5f:P3S97Hs+0x57]}b5eK3a=JBkCBm();function R9yIZ2L(P3S97Hs,b7ICnf){yZ6phXG(P3S97Hs,'length',{value:b7ICnf,configurable:!0x0});return P3S97Hs}P3S97Hs(yZ6phXG=Object.defineProperty,uwg5Wh=R9yIZ2L(B6cwmI((...b7ICnf)=>{P3S97Hs(b7ICnf.length=0x2,b7ICnf.jhmzEMb=0x7d);return b7ICnf.jhmzEMb>0xab?b7ICnf[b7ICnf.jhmzEMb-UlnODD(-0x21)]:b7ICnf[0x1](b7ICnf[0x0]())}),0x2)(Rp_Y8U1,S1ao85));var AqgAZfl=[],oOrNbYb=[EYCClE(UlnODD(-0x47)),EYCClE(0x1),EYCClE(0x2),EYCClE(UlnODD(-0x49)),EYCClE(0x4),EYCClE(0x5),EYCClE(UlnODD(-0x43)),EYCClE(0x7),EYCClE(0x8),EYCClE(0x9),EYCClE(UlnODD(-0x27)),EYCClE(0xb),EYCClE(0xc),EYCClE(0xd),EYCClE(0xe),EYCClE(0xf),EYCClE(UlnODD(-0x13)),EYCClE(0x11),EYCClE(0x12),EYCClE(0x13),EYCClE(0x14),EYCClE(0x15),EYCClE(0x16),EYCClE(0x17),EYCClE(0x18),EYCClE(UlnODD(-0xe)),EYCClE(0x1a),EYCClE(UlnODD(-0x2c)),EYCClE(UlnODD(-0x57)),EYCClE(0xf),'co|.ElRcIGkq;','co|.El^;',EYCClE(0x1d),EYCClE(UlnODD(-0x10)),EYCClE(0x1f),EYCClE(0x20),EYCClE(0x21),EYCClE(0x22),EYCClE(0x23),EYCClE(0x24),EYCClE(0x25),EYCClE(0x26),EYCClE(UlnODD(-0x18)),EYCClE(0x28),EYCClE(0x29),EYCClE(0x2a),EYCClE(0x2b),EYCClE(UlnODD(-0x55)),EYCClE(0x2c),EYCClE(0x2d),EYCClE(UlnODD(-0x54)),EYCClE(0x2f),EYCClE(UlnODD(-0x53)),EYCClE(UlnODD(-0x56)),EYCClE(UlnODD(-0x57)),EYCClE(0x31),EYCClE(0x32),EYCClE(0x33),'x2|u:F+d',EYCClE(UlnODD(-0x33)),EYCClE(0x24),EYCClE(0x25),EYCClE(0x2c),EYCClE(UlnODD(-0x56)),EYCClE(UlnODD(-0x55)),EYCClE(0x35),EYCClE(0x36),EYCClE(0x37),EYCClE(0x38),EYCClE(0x39),EYCClE(UlnODD(-0xb)),EYCClE(UlnODD(-0x24)),EYCClE(UlnODD(-0x8)),EYCClE(0x24),EYCClE(0x25),EYCClE(0x2d),EYCClE(UlnODD(-0x54)),EYCClE(0x13),EYCClE(UlnODD(-0x53)),EYCClE(UlnODD(-0x1e)),EYCClE(0x3d),EYCClE(0x3e),EYCClE(0x3f),EYCClE(UlnODD(0x1f)),EYCClE(0x41),EYCClE(0x26),EYCClE(0x42),EYCClE(0x43),EYCClE(0x2c),EYCClE(0x30),EYCClE(0x2a),EYCClE(0x26),EYCClE(UlnODD(-0x4f)),EYCClE(0x30),EYCClE(0x2a),EYCClE(UlnODD(-0x55)),'x2>4`nzdv+|/b{KYomqC.',EYCClE(0x44),EYCClE(UlnODD(-0x52)),EYCClE(0x46),EYCClE(0x47),EYCClE(0x48),EYCClE(0x49),EYCClE(0x4a),'!z@qH5@K+2Z22wf|d"v8',EYCClE(0x4b),EYCClE(UlnODD(-0xc)),EYCClE(0x4d),EYCClE(0x4e),EYCClE(0x4f),EYCClE(0x50),EYCClE(0x51),EYCClE(0x52),EYCClE(0x53),EYCClE(0x34),EYCClE(0x54),EYCClE(0x55),EYCClE(0x56),'01t3|B$n&',EYCClE(UlnODD(-0x3a)),EYCClE(0x58),'*b|.U1S',',1klb|32Q}l/;',EYCClE(0x14),EYCClE(0x59),EYCClE(0x5a),EYCClE(UlnODD(-0x52)),EYCClE(0x46),EYCClE(0x4e),EYCClE(0x5b),EYCClE(0x5c),EYCClE(0x5d),EYCClE(0x5e),EYCClE(0x21),EYCClE(0x5f),EYCClE(0x60),EYCClE(0x61),EYCClE(0x62),EYCClE(0x63),EYCClE(0x64),EYCClE(0x65),EYCClE(0x66),EYCClE(0x67),EYCClE(0x68),EYCClE(0x69),EYCClE(UlnODD(-0x2d)),EYCClE(0x6b),EYCClE(UlnODD(-0x51)),EYCClE(0x6a),EYCClE(UlnODD(-0x9)),EYCClE(0x6e),EYCClE(0x6f),'uf[^|:%Np+5/n[[,a;',EYCClE(0x70),EYCClE(0x71),EYCClE(UlnODD(-0x1)),EYCClE(0x73),EYCClE(0x74),EYCClE(0x75),EYCClE(0x76),EYCClE(0x77),EYCClE(UlnODD(-0x3f)),EYCClE(0x78),EYCClE(0x79),EYCClE(0x7a),EYCClE(0x7b),EYCClE(UlnODD(-0x14)),EYCClE(UlnODD(-0x50)),EYCClE(0x7d),EYCClE(0x69),EYCClE(0x7e),EYCClE(0x7f),EYCClE(0x80),EYCClE(0x81),EYCClE(UlnODD(-0x45)),EYCClE(0x13),EYCClE(0x83),EYCClE(0x73),EYCClE(UlnODD(-0x51)),EYCClE(0x84),EYCClE(0x85),EYCClE(0x86),EYCClE(0x87),EYCClE(0x88),EYCClE(0x89),EYCClE(UlnODD(-0x50)),EYCClE(0x8a),EYCClE(0x8b),EYCClE(0x8c),EYCClE(0x6b),EYCClE(0x74),EYCClE(0x8d),EYCClE(0x8e),EYCClE(0x8f),EYCClE(0x69),EYCClE(0x90),'Z|Z`JWdb',EYCClE(0x7c),EYCClE(0x91),EYCClE(0x92),EYCClE(0x93),EYCClE(0x94),EYCClE(0x95),EYCClE(0x96),EYCClE(0x97),'|b[^|:/d','([|u','h|4}C{<$$e',EYCClE(UlnODD(-0x7)),EYCClE(0x98),'{|IXWT;N#',EYCClE(0x99),'*b|.U1S',',1klb|32Q}l/;',EYCClE(0x9a),EYCClE(0x9b),EYCClE(0x9c),EYCClE(0x9d),EYCClE(0x9e),'/U/|A',EYCClE(0x9f),EYCClE(0xa0),EYCClE(0xa1),EYCClE(0xa2),EYCClE(0xa3),EYCClE(0xa4),EYCClE(0xa5),EYCClE(0xa6),EYCClE(0xa7),EYCClE(0xa8),EYCClE(0xa9),EYCClE(0xaa),EYCClE(0x86),EYCClE(0x98),'.9I19T;|HcNFe{<vv$+hZ;S^PG
2024-06-28 07:47:44 +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