jdpro/jd_plantBean_help.js

7 lines
86 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
33 3,16 * * * jd_plantBean_help.js
*/
2024-08-19 14:31:26 +00:00
const $ = new Env('种豆得豆互助');
2024-12-10 15:40:13 +00:00
var geD1LG,nr6d3F,KDNgFa,wDXwQk1,Rn_2To_,JElnsa,twzJYt,XT3Q3G8,EsyRCzN,CXULTV,iB3ZeZ9;const sLfpt9=[0x0,0x1,0x8,0xff,"length","undefined",0x3f,0x6,"fromCodePoint",0x7,0xc,"push",0x5b,0x1fff,0x58,0xd,0xe,0x6a,0x69,"@",0x64,0x6e,null,0x7d,0x7e,!0x0,0x7f,0x80,0x83,0x85,0x8c,0x8e,0x90,0x8f," ",0xa4,0x3,0xb4,0xb8,0xba,0xc4,0xc5,0xc6,0xd2,0xdf,0x7d0,!0x1,"\n",0xe5,0xe6,0xed,"0",0xef,0x5265c00,0x1b77400,0xf0,0x3c,0x3e8,0xf3,0x100,0x103,0x104,0x106,0x105,0x108,"&",0x11a,0x11b,0x11e,0xa,0x12a,0x12b,0x101,0x139,0x142,"UA","1",0x16d,0xfe,0x144,0x2,0x185,0x188,0x163,0x4e20,0x5];function mnAPHg(geD1LG){var nr6d3F="E5?7G&y=RDFr!Ca_tOZ\"Hx#2X)>SIh}%Vo9BcsP^UT,z$mKNQ<k:ijw~4LAWf+l(8J;*pv`M]bgYqu@3{nd|[/1.06e",KDNgFa,wDXwQk1,Rn_2To_,JElnsa,twzJYt,XT3Q3G8,EsyRCzN;wYOgdw(KDNgFa=""+(geD1LG||""),wDXwQk1=KDNgFa.length,Rn_2To_=[],JElnsa=sLfpt9[0x0],twzJYt=sLfpt9[0x0],XT3Q3G8=-sLfpt9[0x1]);for(EsyRCzN=sLfpt9[0x0];EsyRCzN<wDXwQk1;EsyRCzN++){var CXULTV=nr6d3F.indexOf(KDNgFa[EsyRCzN]);if(CXULTV===-sLfpt9[0x1])continue;if(XT3Q3G8<sLfpt9[0x0]){X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PyZ1%FQ<BJD\"vE","(aZ]YQI?","O!@=5KT(.C;RQNf2MO8bC","o9F:W9KU{fvfyn>hZ5","0HT}_lAgx\"`uN7MPfDjFeqBBVZKIBkcXWp3i@~\"C@j<BQ7\"I|y$uKd<N@R^q5","kU}=IN#KWR>A^>AIfMBh1L(T<f.K`)xS,L3y)iJhE;%=3PN>","Vp|kp3x=ra:q[fD)fJYRB</2[8rH/cB%Wsli`]p}FHAi5","LWUw::~5","EDZ:d|$}Fle\"ev[#^h8y?f#8x\"FQ<]{9FMZYHks\"6a","UlQb@L=vSOJ447LIc!8wj(P}1CTb|B6tbmNql^65v8+bLveh","$:!~oWyXz4L<anQSVp?hYP19rlDt0MR>U:Wj<`Q}(ZM{_7","|:>ho+BLNRHA7>^P8w[uz`U?MHVv\"d/Tg:TYx/,}iLD7|a,)","yZwG~3b=fO%v37","|IP==32B]AVO)cW2H>^IZvdUbJMulnpXY:q%b~7T=","Y25S%+8K7","nW&F:KIZIJNBTQs)plkj/LON~C8xj]GZ:>vFc@hL#AhX(d(hG2s~x","K9ZVksly|\"%]jGfB:y=qSwE,RJj","SMH%WA&\"hZyHa+EZb2Q<.@{yvw~iwC(X}woyf]#KhWQ","ZU:VLu7)6lLuX|OH/%pjFnBB%!BqZkF","!M$FniS\"8_.*pS*cyGB]xk>X<ZO7vcB}f2`IqqelDO|`7SxT~a4<U{j2V;z","2_MI$:*(`8&y6X$)q:EoLjk}Fl,;[Nz),gO}Fc_C}ZFS3>y","YaX@~[hv;wj%rP?s9U7","Fpxq.k}cWH]*On6t#UKGJ[2N^Ht3@aJ2ID`ikY\
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