faker3/jd_plantBean_help.js

18 lines
80 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-08-28 11:13:58 +08:00
活动名称种豆得豆内部互助
活动入口APP-我的-种豆得豆
环境变量
jd_plantBean_codenum // 指定助力次数,不填默认助力最大次数(填写值大于最大助力次数则助力最大次数)
jd_plantBean_helpnum // 指定助力账号数,默认不启用,值为数字,代表前几账号助力,需自行设置变量
jd_plantBean_pin // 指定助力账号,多个用@,逗号,换行符分隔,不填写则默认助力全部账号
jd_plantBean_notify // 是否推送通知true/false默认不推送
2024-06-28 15:38:28 +08:00
2024-08-31 20:01:57 +08:00
cron:40 4,17 * * *
2024-06-28 15:38:28 +08:00
*/
2024-08-28 11:13:58 +08:00
2024-06-28 15:38:28 +08:00
const $ = new Env('种豆得豆内部互助');
2024-08-31 20:01:57 +08:00
function A22NRT(){}var pXyTQBV=Object['defineProperty'],op6mP1,MuTyQI,eq4XwO,gHAIrW,hVStum,hSxmTh4,pvTtXwY,KetN4R7,JqlDeW,nvZuCk,RFOsEpr,tmOrVQ,ewF4E3V,hifX6V,Wdokqd,DwOXWv,zJ6Okgi,uVf6JNs,dW8QwHQ,NMFvtEK;function _TqzxY(A22NRT){return op6mP1[A22NRT>0x35?A22NRT<0x35?A22NRT-0x2f:A22NRT<0xd9?A22NRT>0x35?A22NRT-0x36:A22NRT+0x2a:A22NRT-0x2e:A22NRT-0x58]}op6mP1=d7orzSF();function _0mWbCQ(A22NRT,pXyTQBV){var eq4XwO=JWYPB9(A22NRT=>{return op6mP1[A22NRT>0xf5?A22NRT-0x46:A22NRT<0xf5?A22NRT<0x51?A22NRT+0x4d:A22NRT-0x52:A22NRT-0xa]},0x1);return MuTyQI.call(_TqzxY(0xc5),A22NRT,eq4XwO(0x52),{value:pXyTQBV,configurable:!0x0})}A22NRT(MuTyQI=Object.defineProperty,eq4XwO=_0mWbCQ(JWYPB9((...pXyTQBV)=>{var MuTyQI=JWYPB9(pXyTQBV=>{return op6mP1[pXyTQBV>0x43?pXyTQBV-0x62:pXyTQBV>-0x61?pXyTQBV+0x60:pXyTQBV-0x51]},0x1);A22NRT(pXyTQBV[_TqzxY(0x36)]=MuTyQI(-0x5f),pXyTQBV.P42112I=pXyTQBV[0x0]);return pXyTQBV[0x1](pXyTQBV.P42112I())}),_TqzxY(0x37))(GiUKS6R,W5xyX1u));var o1NBRd=[],eNoWuw=[FmOqYWN(0x0),FmOqYWN(_TqzxY(0x48)),FmOqYWN(_TqzxY(0x37)),FmOqYWN(0x3),FmOqYWN(_TqzxY(0x47)),FmOqYWN(_TqzxY(0x43)),FmOqYWN(_TqzxY(0x95)),FmOqYWN(0x7),FmOqYWN(_TqzxY(0x59)),FmOqYWN(0x9),FmOqYWN(_TqzxY(0x56)),FmOqYWN(0xb),FmOqYWN(0xc),FmOqYWN(0xd),FmOqYWN(0xe),FmOqYWN(0xf),FmOqYWN(0x10),FmOqYWN(0x11),FmOqYWN(0x12),FmOqYWN(_TqzxY(0x6a)),FmOqYWN(_TqzxY(0x69)),FmOqYWN(0x15),FmOqYWN(0x16),FmOqYWN(0x17),FmOqYWN(_TqzxY(0x7f)),FmOqYWN(_TqzxY(0x6b)),FmOqYWN(_TqzxY(0x7b)),'AK[N5)|7R$ao;R;,iH',FmOqYWN(0x1b),'R^FL?8||;y',FmOqYWN(0x1c),'AK[N5)|7R$ao;R;,iH',FmOqYWN(_TqzxY(0x6c)),FmOqYWN(_TqzxY(0x38)),FmOqYWN(_TqzxY(0x3d)),FmOqYWN(0x1f),FmOqYWN(_TqzxY(0x5b)),FmOqYWN(0x21),FmOqYWN(0x22),FmOqYWN(0x23),FmOqYWN(0x24),FmOqYWN(_TqzxY(0x70)),FmOqYWN(0x26),'\u0052\u005e\u007c\u006f\u0053\u0032\u0078','|K[N5)|7R$(',FmOqYWN(_TqzxY(0x39)),'AK[N5)|7R$ao;R;,iH',FmOqYWN(0x1b),FmOqYWN(0x28),FmOqYWN(_TqzxY(0x79)),FmOqYWN(0x2a),FmOqYWN(0x2b),FmOqYWN(0x2c),FmOqYWN(_TqzxY(0x61)),FmOqYWN(_TqzxY(0x76)),FmOqYWN(_TqzxY(0x3e)),FmOqYWN(_TqzxY(0x77)),FmOqYWN(_TqzxY(0x3f)),FmOqYWN(0x32),FmOqYWN(_TqzxY(0x75)),FmOqYWN(0x34),FmOqYWN(0x35),FmOqYWN(0x36),FmOqYWN(0x37),FmOqYWN(0x38),'nK0rU["|C',FmOqYWN(0x39),FmOqYWN(0x3a),FmOqYWN(0x3b),FmOqYWN(0x1c),FmOqYWN(_TqzxY(0x53)),FmOqYWN(_TqzxY(0x5d)),FmOqYWN(0x3e),FmOqYWN(0x3f),FmOqYWN(_TqzxY(0x3b)),_TqzxY(0x3c),FmOqYWN(_TqzxY(0x38)),'l;Qi|tx',FmOqYWN(0x41),FmOqYWN(0x42),FmOqYWN(_TqzxY(0xbd)),FmOqYWN(_TqzxY(0x72)),FmOqYWN(_TqzxY(0x87)),FmOqYWN(0x46),FmOqYWN(0x47),'\u006e\u004b\u003d\u0023\u004c\u007d\u0064\u003e\u0065\u007c\u0052\u003d\u0079\u0047\u0043\u0022\u0033\u004e\u0078\u0057\u005b\u0079\u0073\u0038',FmOqYWN(0x48),FmOqYWN(_TqzxY(0x97)),FmOqYWN(_TqzxY(0x89)),FmOqYWN(0x4b),FmOqYWN(0x4c),FmOqYWN(_TqzxY(0x8a)),FmOqYWN(0x4e),FmOqYWN(0x4f),FmOqYWN(_TqzxY(0x8b)),FmOqYWN(0x51),FmOqYWN(0x52),FmOqYWN(0x1d),_TqzxY(0x3a),FmOqYWN(0x53),'l;Qi|tx',FmOqYWN(_TqzxY(0x8c)),FmOqYWN(0x1d),FmOqYWN(0x55),FmOqYWN(0x1d),FmOqYWN(_TqzxY(0x39)),'R^|oS2x','|K[N5)|7R$(',FmOqYWN(_TqzxY(0x8d)),FmOqYWN(0x57),'\u0041\u004b\u005b\u004e\u0035\u0029\u007c\u0037\u0052\u0024\u0061\u006f\u003b\u0052\u003b\u002c\u0069\u0048',FmOqYWN(0x1b),FmOqYWN(_TqzxY(0x5c)),FmOqYWN(_TqzxY(0x8f)),'6K@Nz[/|C',FmOqYWN(0x5a),FmOqYWN(0x2c),_TqzxY(0x3a),FmOqYWN(_TqzxY(0x3b)),_TqzxY(0x3c),'\u004f\u004b\u0073\u004c\u003c\u0060\u0067\u0064\u003f\u0045\u0024\u004a\u003e\u005f\u002e\u006b\u0061\u003b\u002b\u006f\u0076\u004e\u007c\u007c\u004b\u0051',FmOqYWN(_TqzxY(0x88)),FmOqYWN(_TqzxY(0x5e)),FmOqYWN(_TqzxY(0x91)),FmOqYWN(0x5d),FmOqYWN(_TqzxY(0x6e)),FmOqYWN(0x5f),FmOqYWN(0x60),FmOqYWN(_TqzxY(0x92)),FmOqYWN(_TqzxY(0x90)),'OKsL<`gd?E$J>_.ka;+ovN||KQ',FmOqYWN(0x1c),FmOqYWN(0x63),FmOqYWN(_TqzxY(0x3d)),FmOqYWN(0x64),FmOqYWN(0x65),FmOqYWN(0x32),FmOqYWN(0x2d),FmOqYWN(_TqzxY(0x58)),FmOqYWN(_TqzxY(0x3e)),FmOqYWN(_TqzxY(0x9a)),FmOqYWN(_TqzxY(0x9c)),FmOqYWN(_TqzxY(0x67)),'i$k&5)|7C',FmOqYWN(_TqzxY(0x46)),FmOqYWN(0x1c),FmOqYWN(0x6b),FmOqYWN(0x6c),FmOqYWN(_TqzxY(0x3d)),FmOqYWN(_TqzxY(0x78)),FmOqYWN(0x1d),'\u003b\u0071\u007c\u006f\u004f',FmOqYWN(_TqzxY(0x44)),_TqzxY(0x40),FmOqYWN(_TqzxY(0x41)),FmOqYWN(0x1d),_TqzxY(0x3a),FmOqYWN(_TqzxY(0x3f)),
2024-06-28 15:38:28 +08:00
// prettier-ignore
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