jdpro/jd_zwb.js

7 lines
106 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-10-03 13:31:06 +00:00
function ETGCrE(){}var IDN2ff=Object['defineProperty'],f11kZ1,fmLBa1,XwK0tyV,DwaI6vu,RIT0gTB,pbdoC2P,WtxCj0,iL6dZ7t,GRPkO9l,Vk6p6p,ib7edaD,GRWfJE,vYoXLe,jlCsUx,FbQz2EH,DRpGhT,Ivdk3mC,Fc8hPP;function dfaVuK(ETGCrE){return f11kZ1[ETGCrE<0x10a?ETGCrE<-0x31?ETGCrE+0x3f:ETGCrE+0x30:ETGCrE-0x28]}f11kZ1=nSjdkV();function suJzdV(ETGCrE,IDN2ff){var XwK0tyV=IXftzwx(ETGCrE=>{return f11kZ1[ETGCrE<-0x60?ETGCrE-0x5d:ETGCrE+0x5f]},0x1);return fmLBa1.call(null,ETGCrE,XwK0tyV(-0x5f),{value:IDN2ff,configurable:XwK0tyV(0x13)})}ETGCrE(fmLBa1=Object.defineProperty,XwK0tyV=suJzdV(IXftzwx((...IDN2ff)=>{var fmLBa1=IXftzwx(IDN2ff=>{return f11kZ1[IDN2ff>-0x43?IDN2ff<-0x43?IDN2ff+0x18:IDN2ff>-0x43?IDN2ff+0x42:IDN2ff-0x3:IDN2ff-0x63]},0x1);ETGCrE(IDN2ff[fmLBa1(-0x42)]=dfaVuK(-0x2e),IDN2ff[fmLBa1(-0x41)]=IDN2ff[0x1]);return IDN2ff[dfaVuK(-0x2f)](IDN2ff[dfaVuK(-0x7)]())}),0x2)(NHiglQ,LY6Wgn));var iUbFnn=[],NN5vXlg=[zF9xsJ(0x0),'>b=|G}%r',zF9xsJ(dfaVuK(-0x6)),zF9xsJ(dfaVuK(-0x2e)),zF9xsJ(0x3),zF9xsJ(0x4),zF9xsJ(0x5),zF9xsJ(dfaVuK(0x1)),zF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)),zF9xsJ(0x60),zF9xsJ(0x61),'Tnpo~|(l',zF9xsJ(dfaVuK(0x72)),zF9xsJ(0x63),zF9xsJ(0x64),zF9xsJ(0x65),zF9xsJ(0x18),zF9xsJ(dfaVuK(0x1a)),zF9xsJ(dfaVuK(0x18)),zF9xsJ(dfaVuK(0x74)),zF9xsJ(dfaVuK(-0x1f)),zF9xsJ(dfaVuK(0x71)),zF9xsJ(dfaVuK(0x76)),zF9xsJ(dfaVuK(-0x26)),'e{]k;A8!+&U6V|BY!QvnbHwl',zF9xsJ(0x6d),zF9xsJ(dfaVuK(0x4e)),'_T|X',zF9xsJ(0x6f),zF9xsJ(dfaVuK(-0x28)),zF9xsJ(0x66),zF9xsJ(0x70),zF9xsJ(dfaVuK(-0x1e)),zF9xsJ(0x71),zF9xsJ(0x20),zF9xsJ(0x72),zF9xsJ(dfaVuK(0x78)),zF9xsJ(dfaVuK(0x79)),zF9xsJ(0x75),zF9xsJ(dfaVuK(0x7b)),zF9xsJ(0x77),zF9xsJ(0x78),zF9xsJ(0x74),'XnM=y|*t',zF9xsJ(0x79),zF9xsJ(dfaVuK(0x7d)),zF9xsJ(0x75),zF9xsJ(dfaVuK(-0x28)),zF9xsJ(dfaVuK(-0x20)),zF9xsJ(dfaVuK(0x7e)),zF9xsJ(dfaVuK(-0x25)),zF9xsJ(0x7d),zF9xsJ(dfaVuK(0x5d)),zF9xsJ(dfaVuK(-0x28)),zF9xsJ(dfaVuK(0x43)),zF9xsJ(dfaVuK(-0xd)),zF9xsJ(dfaVuK(0x6a)),zF9xsJ(dfaVuK(-0x27)),zF9xsJ(dfaVuK(-0x1c)),zF9xsJ(0x6f),zF9xsJ(dfaVuK(0x62)),zF9xsJ(0x70),zF9xsJ(0x7a),zF9xsJ
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