jdpro/jd_3c_task.js

7 lines
101 KiB
JavaScript
Raw Normal View History

2024-11-04 23:48:55 +00:00
/*
33 3,16 * * * jd_3c_task.js
*/
const $ = new Env('3C每日签到');
2024-11-17 09:58:34 +00:00
function Y4vklVN(){}var Q5Ruaf=Object['defineProperty'],wHUGk5,xTbCGA,liQqtZK,DxXwnB,L48mCz,gtnfkxJ,CKEMx_w,qvoc0BF,GCfhL2l,gLZtq8,SHNuYV,ze5j7Oi,bNffUw,rYCnlR,EDFHiXg,gRq2gG,r9T54z,PA8FWi;function uJSSel(Y4vklVN){return wHUGk5[Y4vklVN>0xec?Y4vklVN+0x5e:Y4vklVN>0xec?Y4vklVN-0x7:Y4vklVN+0x40]}wHUGk5=Ifw0hm();function StYym5p(Y4vklVN,Q5Ruaf){return xTbCGA.call(null,Y4vklVN,'length',{value:Q5Ruaf,configurable:!0x0})}Y4vklVN(xTbCGA=Object.defineProperty,liQqtZK=eP2VJ_((Y4vklVN,Q5Ruaf)=>{return Q5Ruaf(Y4vklVN())},0x2)(_z0r8X,m5zeWm));var IeDMtU=[],RIVrfW0=[BdHru19(uJSSel(-0x1a)),BdHru19(uJSSel(-0x15)),BdHru19(uJSSel(-0x10)),BdHru19(uJSSel(-0x6)),BdHru19(0x4),BdHru19(0x5),BdHru19(0x6),BdHru19(uJSSel(-0x18)),BdHru19(uJSSel(-0x7)),'|7rK7@mu1N=VmR6tu6mBc7NVtFxqyI[D6|V',BdHru19(uJSSel(-0xf)),BdHru19(0xa),'|75fX7nUM',BdHru19(0xb),BdHru19(0xc),BdHru19(uJSSel(0xb)),BdHru19(uJSSel(-0xa)),BdHru19(0xf),'|(yr889',BdHru19(uJSSel(0xa)),BdHru19(0x11),BdHru19(uJSSel(-0x3f)),BdHru19(uJSSel(-0x3e)),BdHru19(uJSSel(-0x3d)),'eb)G||D',BdHru19(uJSSel(-0x40)),BdHru19(uJSSel(-0x3a)),BdHru19(uJSSel(0x16)),BdHru19(uJSSel(-0x3c)),BdHru19(0x13),BdHru19(uJSSel(-0x3b)),BdHru19(uJSSel(-0x40)),BdHru19(0x19),BdHru19(0x1a),BdHru19(0x1b),BdHru19(uJSSel(-0x2e)),BdHru19(0x1d),BdHru19(0x11),BdHru19(uJSSel(-0x3f)),BdHru19(uJSSel(-0x3e)),BdHru19(uJSSel(-0x3d)),BdHru19(0x18),BdHru19(0x15),BdHru19(0x16),BdHru19(0x17),BdHru19(uJSSel(-0x3c)),BdHru19(uJSSel(-0x3e)),BdHru19(0x18),BdHru19(0x15),BdHru19(uJSSel(-0x3b)),BdHru19(uJSSel(-0x40)),BdHru19(0x11),BdHru19(0x13),BdHru19(0x18),BdHru19(0x15),BdHru19(0x11),BdHru19(0x13),BdHru19(0x1e),BdHru19(0x1f),BdHru19(uJSSel(0x9)),BdHru19(uJSSel(-0x11)),BdHru19(uJSSel(0x1d)),BdHru19(0x23),BdHru19(uJSSel(0x1e)),BdHru19(0x25),BdHru19(0x26),BdHru19(0x27),BdHru19(uJSSel(0x20)),BdHru19(uJSSel(-0x3a)),BdHru19(0x29),BdHru19(uJSSel(0x8)),BdHru19(uJSSel(0x21)),BdHru19(0x2c),BdHru19(0x2d),BdHru19(uJSSel(-0x24)),BdHru19(0x19),BdHru19(uJSSel(0x22)),BdHru19(uJSSel(0x23)),BdHru19(uJSSel(-0x39)),BdHru19(0x32),BdHru19(0x33),BdHru19(0x34),BdHru19(0x35),BdHru19(0x36),BdHru19(uJSSel(0x25)),BdHru19(0x38),BdHru19(uJSSel(0x26)),BdHru19(0x3a),BdHru19(0x3b),'S?%GD8[eTj_foXB2_w5]?Jf}xcu!c{Kp;_Xrl>74z|B$T0}7FT=Fq',BdHru19(uJSSel(-0x3a)),BdHru19(0x3c),BdHru19(0x3d),'(C@a"UsG}#ceoWewT:IPmt3v2_lfj@|g9EC>=KHRUaP',BdHru19(0x1d),BdHru19(uJSSel(0x27)),uJSSel(-0x33),BdHru19(0x3f),BdHru19(0x40),BdHru19(uJSSel(-0x35)),BdHru19(0x42),BdHru19(uJSSel(-0x2d)),BdHru19(0x44),BdHru19(uJSSel(-0x38)),BdHru19(uJSSel(-0x34)),BdHru19(0x47),BdHru19(uJSSel(0x4)),BdHru19(0x49),BdHru19(uJSSel(0x28)),BdHru19(0x4b),BdHru19(uJSSel(0x2b)),BdHru19(uJSSel(0x2c)),BdHru19(uJSSel(-0x39)),BdHru19(uJSSel(-0x26)),BdHru19(uJSSel(0x2d)),BdHru19(uJSSel(0x47)),BdHru19(uJSSel(0x2e)),BdHru19(0x51),BdHru19(0x52),BdHru19(0x53),BdHru19(uJSSel(-0x1c)),BdHru19(0x55),BdHru19(0x56),BdHru19(0x57),BdHru19(uJSSel(-0x31)),BdHru19(uJSSel(-0x32)),BdHru19(0x5a),BdHru19(uJSSel(0x1a)),BdHru19(uJSSel(-0x38)),BdHru19(0x16),BdHru19(0x5c),BdHru19(uJSSel(-0x3a)),BdHru19(uJSSel(-0x30)),BdHru19(uJSSel(0x2f)),BdHru19(uJSSel(-0x2f)),BdHru19(0x60),BdHru19(uJSSel(-0x3a)),BdHru19(0x61),BdHru19(0x62),BdHru19(0x63),BdHru19(0x64),BdHru19(uJSSel(0x34)),BdHru19(0x66),BdHru19(0x67),BdHru19(uJSSel(0x35)),BdHru19(0x69),BdHru19(0x6a),BdHru19(0x6b),BdHru19(0x6c),BdHru19(uJSSel(0x3a)),BdHru19(0x6e),BdHru19(0x6f),BdHru19(uJSSel(-0x2b)),BdHru19(uJSSel(0x39)),BdHru19(0x1d),'Fvf_y@}nr|^=V',BdHru19(uJSSel(0x3b)),BdHru19(uJSSel(0x1)),BdHru19(uJSSel(-0x37)),BdHru19(uJSSel(-0x36)),BdHru19(0x75),BdHru19(0x76),BdHru19(uJSSel(0x3e)),BdHru19(uJSSel(-0x37)),BdHru19(uJSSel(-0x36)),BdHru19(0x78),BdHru19(uJSSel(0x3f)),BdHru19(0x7a),BdHru19(uJSSel(-0x3a)),BdHru19(uJSSel(0x1c)),BdHru19(0x3f),BdHru19(uJSSel(-0x25)),BdHru19(uJSSel(-0x35)),BdHru19(0x42),BdHru19(uJSSel(-0x3a)),BdHru19(0x47),BdHru19(0x49),BdHru19(uJSSel(0x40)),BdHru19(0x19),BdHru19(0x7c),BdHru19(0x70),BdHru19(uJSSel(0xb0)),BdHru19(0x7e),BdHru19(uJSSel(-0x19)),BdHru19(0x80),BdHru19(uJSSel(-0x34)),BdHru19(uJSSel(-0x34)),uJSSel(-0x33),BdHru19(0x81),BdHru19(uJSSel(0x42)),BdHru19(uJSSel(0x43)),BdHru19
2024-11-04 23:48:55 +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