jdpro/jd_3c_task.js

7 lines
152 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-22 12:12:28 +00:00
function CLKeL1i(){}var U5dAMf=Object['defineProperty'],jSNgJyC,t3SbXK,HWiGLy,OB1BGH,suQB90,tCzHit,wnMqQKd,VH6olR0,fZlLbs,FBY9gH,xR9QOV,zGxBgCX,Y_GH7k,aobzXe,q5vsS9,uelYShx,CbE4Y5,ReaF7nB;function wgB4Caj(CLKeL1i){return jSNgJyC[CLKeL1i>0x32c?CLKeL1i-0x24:CLKeL1i<0x2a?CLKeL1i-0x20:CLKeL1i-0x2b]}jSNgJyC=r5wyOfP();function eCDkadw(CLKeL1i,U5dAMf){t3SbXK(CLKeL1i,wgB4Caj(0x7c),{value:U5dAMf,configurable:wgB4Caj(0x14d)});return CLKeL1i}CLKeL1i(t3SbXK=Object.defineProperty,HWiGLy=cLCIEL((CLKeL1i,U5dAMf)=>{return U5dAMf(CLKeL1i())},0x2)(QzXlP7,SYnJ9D));var tHNs_3=[],NUiPHU=[U8ZgIE(wgB4Caj(0x84)),U8ZgIE(wgB4Caj(0x82)),U8ZgIE(wgB4Caj(0x83)),U8ZgIE(wgB4Caj(0x80)),U8ZgIE(wgB4Caj(0x7f)),U8ZgIE(wgB4Caj(0x7d)),U8ZgIE(wgB4Caj(0x8b)),U8ZgIE(wgB4Caj(0x91)),U8ZgIE(wgB4Caj(0xaf)),U8ZgIE(wgB4Caj(0x96)),U8ZgIE(wgB4Caj(0xc8)),U8ZgIE(wgB4Caj(0x9c)),U8ZgIE(wgB4Caj(0x8f)),U8ZgIE(wgB4Caj(0x94)),U8ZgIE(wgB4Caj(0xad)),U8ZgIE(wgB4Caj(0x8e)),U8ZgIE(wgB4Caj(0xc9)),U8ZgIE(wgB4Caj(0xcb)),U8ZgIE(wgB4Caj(0x92)),U8ZgIE(wgB4Caj(0xbb)),U8ZgIE(wgB4Ca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(0xfa)),U8ZgIE(wgB4Caj(0xeb)),wgB4Caj(0x44),'?/PA|s9a',U8ZgIE(wgB4Caj(0xa4)),U8ZgIE(wgB4Caj(0x101)),U8ZgIE(wgB4Caj(0xc4)),'F>>;VT}T<&w|v',U8ZgIE(wgB4Caj(0xab)),U8ZgIE(wgB4Caj(0x13e)),U8ZgIE(wgB4Caj(0x110)),U8ZgIE(wgB4Caj(0x62)),U8ZgIE(wgB4Caj(0xd9)),U8ZgIE(wgB4Caj(0x34)),wgB4Caj(0x35),U8ZgIE(wgB4Caj(0x36)),U8ZgIE(wgB4Caj(0x140)),U8ZgIE(wgB4Caj(0x141)),U8ZgIE(wgB4Caj(0x142)),U8ZgIE(wgB4Caj(0x10a)),U8ZgIE(wgB4Caj(0x143)),U8ZgIE(wgB4Caj(0x144)),U8ZgIE(wgB4Caj(0x145)),U8ZgIE(wgB4Caj(0x13d)),U8ZgIE(wgB4Caj(0x146)),U8ZgIE(wgB4Caj(0x70)),U8ZgIE(wgB4Caj(0x147)),'*(]U|',U8ZgIE(wgB4Caj(0x14a)),U8ZgIE(wgB4Caj(0x4c)),wgB4Caj(0x4e),U8ZgIE(wgB4Caj(0x148)),U8ZgIE(wgB4Caj(0x58)),U8ZgIE(wgB4Caj(0x14c)),U8ZgIE(wgB4Caj(0x52)),U8ZgIE(wgB4Caj(0x53)),U8ZgIE(wgB4Caj(0x33)),U8ZgIE(wgB4Caj(0x40)),U8ZgIE(wgB4Caj(0x41)),U8ZgIE(wgB4Caj(0x4f)),U8ZgIE(wgB4Caj(0x150)),U8ZgIE(wgB4Caj(0x151)),U8ZgIE(wgB4Caj(0x33)),U8ZgIE(wgB4Caj(0x37)),U8ZgIE(wgB4Caj(0x39)),U8ZgIE(wgB4Caj(0x153)),U
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