jdpro/jd_3c_task.js

7 lines
118 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每日签到');
function BsfnA3p(){}var aYNhva=Object['defineProperty'],gObkSIP,LtjiFY,yVBOSv,NKh9er,mqy2bVM,dyOESo,wsiqmfh,L9m7YKo,eqFJC0S,V6Xd24,NDbloL,uaiT9z,_ADWjH_,MznBFx,REAK6DP,KXtE6Fe,rCCcgT6,cHHi_M,DhU8Zz,mF_Nt9,dO3Sen,DssR7k;function FLPvOEO(BsfnA3p){return gObkSIP[BsfnA3p<0x182?BsfnA3p<0x182?BsfnA3p-0x37:BsfnA3p-0x5d:BsfnA3p+0x42]}gObkSIP=KDJp2E();function lq4Xlhx(BsfnA3p,aYNhva){return LtjiFY.call(null,BsfnA3p,'length',{value:aYNhva,configurable:!0x0})}BsfnA3p(LtjiFY=Object.defineProperty,yVBOSv=kE9UI4m((BsfnA3p,aYNhva)=>{return aYNhva(BsfnA3p())},0x2)(mKW8HQF,JbYn1Iv));var SlCBbbR=[],cUNmkJ=[ERgjkW0(0x0),ERgjkW0(0x1),'@`|ef9dx',ERgjkW0(FLPvOEO(0x69)),ERgjkW0(FLPvOEO(0x57)),ERgjkW0(FLPvOEO(0x6a)),ERgjkW0(0x5),ERgjkW0(FLPvOEO(0x61)),ERgjkW0(FLPvOEO(0x76)),ERgjkW0(FLPvOEO(0x75)),'FF!AJPf8S9D5$RI(|{',ERgjkW0(0x9),ERgjkW0(FLPvOEO(0x87)),ERgjkW0(FLPvOEO(0x65)),ERgjkW0(FLPvOEO(0x9c)),ERgjkW0(0xd),ERgjkW0(0xe),ERgjkW0(FLPvOEO(0x16f)),ERgjkW0(0x10),ERgjkW0(FLPvOEO(0x64)),ERgjkW0(0x12),'/L|gaLid~','jF}A0T/|q%x]Su2KgR`)6t,',ERgjkW0(0x13),ERgjkW0(FLPvOEO(0x6f)),ERgjkW0(0x15),ERgjkW0(FLPvOEO(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g>6@R=ncOQZ}',ERgjkW0(0x68),ERgjkW0(0x3e),ERgjkW0(0x69),ERgjkW0(0x6a),ERgjkW0(0x6b),ERgjkW0(0x6c),'|bzSAa,',ERgjkW0(0x6d),ERgjkW0(FLPvOEO(0xbe)),ERgjkW0(0x6f),ERgjkW0(0x70),ERgjkW0(FLPvOEO(0xbd)),ERgjkW0(FLPvOEO(0xc2)),ERgjkW0(FLPvOEO(0x3f)),ERgjkW0(0x69),ERgjkW0(0x73),ERgjkW0(0x74),ERgjkW0(0x75),'~|#Vf_H*',ERgjkW0(0x76),ERgjkW0(FLPvOEO(0xcd)),ERgjkW0(0x78),ERgjkW0(FLPvOEO(0xc8)),ERgjkW0(FLPvOEO(0xcc)),ERgjkW0(FLPvOEO(0xc7)),ERgjkW0(0x7c),ERgjkW0(0x7d),ERgjkW0(0x7e),ERgjkW0(FLPvOEO(0x44)),'|b=3DM28',FLPvOEO(0x48),ERgjkW0(FLPvOEO(0x5c)),ERgjkW0(0x81),ERgjkW0(0x7e),ERgjkW0(0x7f),ERgjkW0(FLPvOEO(0x3e)),ERgjkW0(FLPvOEO(0x40)),ERgjkW0(FLPvOEO(0x3a)),ERgjkW0(FLPvOEO(0x41)),ERgjkW0(0x82),ERgjkW0(0x57),'+(|AmY,',ERgjkW0(0x3e),ERgjkW0(0x59),ERgjkW0(FLPvO
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