jdpro/jd_zwb.js

7 lines
149 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
2024-10-03 13:31:06 +00:00
22 8 * * * jd_zwb.js
2024-06-28 07:47:44 +00:00
*/
const $ = new Env('做任务赚汪贝');
2024-11-22 12:12:28 +00:00
function cpkkYV(){}var yHGnLnk=Object['defineProperty'],yTiwoq,lxQle3x,mIwqaLS,S7PaPx,RAfEupS,YTPwIr,Xb_G4u,VznGXJL,RPJfvUS,Pm6R5j,ImLIH9,x9zPyZM,WKYuu0w,n4W_Fpa,iMGd86r,LyyzGwX,bdWb8Q,yIjJsdi,exQT0il;function iBMoaF(cpkkYV){return yTiwoq[cpkkYV>-0x1c?cpkkYV+0x1b:cpkkYV-0x30]}yTiwoq=xj8OBNu();function hz4VYd(cpkkYV,yHGnLnk){return lxQle3x(cpkkYV,iBMoaF(-0x1b),{value:yHGnLnk,configurable:iBMoaF(0x98)})}cpkkYV(lxQle3x=Object.defineProperty,mIwqaLS=hz4VYd(apWiWd((...yHGnLnk)=>{var lxQle3x=apWiWd(yHGnLnk=>{return yTiwoq[yHGnLnk>-0x3e?yHGnLnk<-0x3e?yHGnLnk-0x2c:yHGnLnk+0x3d:yHGnLnk-0x8]},0x1);cpkkYV(yHGnLnk[iBMoaF(-0x1b)]=iBMoaF(-0x19),yHGnLnk[iBMoaF(-0x1a)]=yHGnLnk[iBMoaF(-0x18)]);return yHGnLnk[lxQle3x(-0x39)](yHGnLnk[lxQle3x(-0x3c)]())}),iBMoaF(-0x19))(m2n04k,IOD7Ti));var y6k97qa=[],gWffJYK=[b8UnJ3(iBMoaF(-0x18)),b8UnJ3(iBMoaF(-0x17)),b8UnJ3(iBMoaF(-0x19)),b8UnJ3(iBMoaF(0x54)),b8UnJ3(iBMoaF(0x57)),b8UnJ3(iBMoaF(0x51)),b8UnJ3(iBMoaF(0x60)),b8UnJ3(iBMoaF(0x64)),b8UnJ3(iBMoaF(-0x16)),b8UnJ3(iBMoaF(-0x15)),b8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121)),b8UnJ3(iBMoaF(0xdd)),b8UnJ3(iBMoaF(-0x8)),b8UnJ3(iBMoaF(0x124)),b8UnJ3(iBMoaF(0x125)),b8UnJ3(iBMoaF(0x6d)),b8UnJ3(iBMoaF(0x72)),b8UnJ3(iBMoaF(0x12a)),b8UnJ3(iBMoaF(0x12c)),b8UnJ3(iBMoaF(0x69)),b8UnJ3(iBMoaF(-0x11)),b8UnJ3(iBMoaF(0x4c)),b8UnJ3(iBMoaF(0xcd)),iBMoaF(0x7),b8UnJ3(iBMoaF(0x8)),b8UnJ3(iBMoaF(0x9)),b8UnJ3(iBMoaF(0xa)),b8UnJ3(iBMoaF(0x1)),b8UnJ3(iBMoaF(0x130)),b8UnJ3(iBMoaF(-0x5)),b8UnJ3(iBMoaF(0x10)),b8UnJ3(iBMoaF(0xc)),b8UnJ3(iBMoaF(0xd)),b8UnJ3(iBMoaF(0xe)),b8UnJ3(iBMoaF(0x55)),b8UnJ3(iBMoaF(0x5a)),b8UnJ3(iBMoaF(0x45)),b8UnJ3(iBMoaF(0x53)),b8UnJ3(iBMoaF(0x46)),b8UnJ3(iBMoaF(0x43)),b8UnJ3(iBMoaF(0x8e)),b8UnJ3(iBMoaF(-0x7)),b8UnJ3(iBMoaF(-0x6)),b8UnJ3(iBMoaF(0xb)),b8UnJ3(iBMoaF(0x131)),b8UnJ3(iBMoaF(0x59)),b8UnJ3(iBMoaF(0x132)),b8UnJ3(iBMoaF(0xb2)),b8UnJ3(iBMoaF(0x134)),b8UnJ3(iBMoaF(0x135)),b8UnJ3(iBMoaF(0x136)),b8UnJ3(iBMoaF(0x77)),b8UnJ3(iBMoaF(0x78)),b8UnJ3(iBMoaF(0x2a)),b8UnJ3(iBMoaF(0x10d)),b8UnJ3(iBMoaF(0x76)),b8UnJ3(iBMoaF(0x138
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