faker3/jd_plantBean_help.js

18 lines
74 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-28 11:13:58 +08:00
cron:40 4,17 * * * jd_plantBean_help.js
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-28 11:13:58 +08:00
function EoTYaK(){}var eknvwG=Object['defineProperty'],Mbjvlb,btYNXx,beQpyCs,PwTACJn,P4kEd7c,yReC_9,LxUMf0,WL0Jyp,g1tnMj,zMusH9q,f0USGXt,RDcQOIq,Ey_NwF,VzT1fw,LxYqCjB,yKdkbk,is24Hfi,RxpBS6E,XTBFIx,HVI9FG,lxEIZSj;function dhOT2p(EoTYaK){return Mbjvlb[EoTYaK>0x1d?EoTYaK<0xc1?EoTYaK<0xc1?EoTYaK>0xc1?EoTYaK-0x25:EoTYaK-0x1e:EoTYaK+0x44:EoTYaK+0x27:EoTYaK-0xb]}Mbjvlb=CTnfbeI();function JhIu9J(EoTYaK,eknvwG){return btYNXx(EoTYaK,'\u006c\u0065\u006e\u0067\u0074\u0068',{value:eknvwG,configurable:!0x0})}EoTYaK(btYNXx=Object.defineProperty,beQpyCs=JhIu9J(U7lSlx((...eknvwG)=>{var btYNXx=U7lSlx(eknvwG=>{return Mbjvlb[eknvwG>0x9e?eknvwG-0x11:eknvwG>0x9e?eknvwG-0x1f:eknvwG+0x5]},0x1);EoTYaK(eknvwG.length=dhOT2p(0x40),eknvwG[btYNXx(-0x5)]=eknvwG[0x0]);return eknvwG[btYNXx(-0x4)](eknvwG[btYNXx(-0x5)]())}),0x2)(HuEdimV,UJTBSaG));var ZkvPN6x=[],K9bpDDg=['\u007d\u0071\u0075\u0063\u006d\u007c\u004a\u004f\u0059',qBupQcU(dhOT2p(0x2f)),qBupQcU(dhOT2p(0x1f)),qBupQcU(0x2),qBupQcU(0x3),qBupQcU(dhOT2p(0x3f)),'a|2Qx',qBupQcU(dhOT2p(0x44)),qBupQcU(0x6),qBupQcU(0x7),qBupQcU(0x8),qBupQcU(0x9),qBupQcU(0xa),qBupQcU(dhOT2p(0x38)),qBupQcU(dhOT2p(0x33)),qBupQcU(0xd),qBupQcU(0xe),qBupQcU(dhOT2p(0x51)),qBupQcU(dhOT2p(0x39)),qBupQcU(dhOT2p(0x52)),qBupQcU(dhOT2p(0x53)),'\u007c\u002e\u0065\u0035',qBupQcU(0x13),qBupQcU(0x14),qBupQcU(0x15),qBupQcU(0x16),qBupQcU(0x17),qBupQcU(dhOT2p(0x21)),qBupQcU(dhOT2p(0x23)),qBupQcU(0x1a),qBupQcU(0x1b),qBupQcU(dhOT2p(0x24)),qBupQcU(0x18),qBupQcU(0x19),qBupQcU(dhOT2p(0x20)),qBupQcU(0x1b),qBupQcU(dhOT2p(0x55)),qBupQcU(dhOT2p(0x20)),'\x5e\x7c\x41\x54\x47',qBupQcU(0x1f),qBupQcU(0x20),'|f+mh8DP',qBupQcU(0x21),qBupQcU(dhOT2p(0x57)),qBupQcU(0x23),qBupQcU(dhOT2p(0x58)),qBupQcU(0x25),qBupQcU(0x1b),qBupQcU(0x26),qBupQcU(0x27),qBupQcU(dhOT2p(0x22)),qBupQcU(dhOT2p(0x21)),qBupQcU(0x29),qBupQcU(dhOT2p(0x5f)),qBupQcU(0x2b),qBupQcU(dhOT2p(0x60)),qBupQcU(0x2d),qBupQcU(0x2e),qBupQcU(dhOT2p(0x67)),'\u0041\u007c\u0072\u003e\u0037',qBupQcU(dhOT2p(0x63)),qBupQcU(0x31),qBupQcU(0x32),qBupQcU(0x33),qBupQcU(0x34),qBupQcU(0x35),qBupQcU(0x36),qBupQcU(0x1c),qBupQcU(0x37),qBupQcU(0x38),qBupQcU(0x39),qBupQcU(0x3a),qBupQcU(0x3b),qBupQcU(0x3c),qBupQcU(dhOT2p(0x20)),qBupQcU(0x3d),qBupQcU(dhOT2p(0x2e)),qBupQcU(dhOT2p(0x32)),qBupQcU(0x40),qBupQcU(0x41),qBupQcU(0x42),qBupQcU(dhOT2p(0x6b)),'z)*F7|U1us5X4=9',qBupQcU(0x44),qBupQcU(0x45),qBupQcU(0x46),qBupQcU(dhOT2p(0x28)),qBupQcU(0x47),qBupQcU(0x48),qBupQcU(dhOT2p(0x20)),qBupQcU(0x3d),qBupQcU(0x1d),qBupQcU(dhOT2p(0x27)),qBupQcU(dhOT2p(0x26)),qBupQcU(0x1d),qBupQcU(dhOT2p(0x29)),qBupQcU(dhOT2p(0x2d)),qBupQcU(0x1d),qBupQcU(dhOT2p(0x22)),qBupQcU(0x4c),qBupQcU(0x4d),qBupQcU(0x4e),qBupQcU(0x4f),qBupQcU(0x50),qBupQcU(dhOT2p(0x23)),qBupQcU(0x51),qBupQcU(dhOT2p(0x2c)),qBupQcU(0x52),qBupQcU(0x53),qBupQcU(0x3d),'\u006e\u0074\u004e\u0047\u006b\u007b\u003d\u007c\u007a\u0023\u0030\u0025\u003e\u006f\u006d\u0046\u0067\u0075',qBupQcU(0x54),dhOT2p(0x25),qBupQcU(dhOT2p(0x24)),qBupQcU(0x55),qBupQcU(0x56),qBupQcU(dhOT2p(0x6d)),qBupQcU(dhOT2p(0x49)),qBupQcU(dhOT2p(0x6f)),qBupQcU(0x5a),qBupQcU(0x5b),'\u002f\u0050\u007c\u0045\u0044\u002f\u005e\u0056\u0062\u0060\u006d\u0044\u0024\u0032\u005d\u007d\u0067\u0075',qBupQcU(0x1b),dhOT2p(0x25),qBupQcU(0x1c),qBupQcU(0x5c),qBupQcU(dhOT2p(0x70)),'j6@eq^=|uK:',qBupQcU(dhOT2p(0x26)),qBupQcU(0x5e),qBupQcU(0x5f),qBupQcU(0x60),qBupQcU(dhOT2p(0x71)),qBupQcU(dhOT2p(0x78)),qBupQcU(dhOT2p(0x72)),qBupQcU(dhOT2p(0x73)),qBupQcU(0x1d),qBupQcU(0x65),'\x3a\x3c\x70\x76\x79\x41\x76\x78\x32\x7e\x34\x39\x23\x68\x7c\x37\x78\x55',qBupQcU(dhOT2p(0x74)),qBupQcU(dhOT2p(0xb7)),qBupQcU(0x68),qBupQcU(dhOT2p(0x20)),qBupQcU(dhOT2p(0x27)),qBupQcU(0x69),'\u003a\u003c\u0070\u0076\u0079\u0041\u0076\u0078\u0032\u007e\u0034\u0039\u0023\u0068\u007c\u0037\u0078\u0055',qBupQcU(dhOT2p(0x28)),qBupQcU(0x56),qBupQcU(0x57),qBupQcU(0x66),qBupQcU(dhOT2p(0x2a)),qBupQcU(dhOT2p(0x20)),qBupQcU(0x3d),qBupQcU(dhOT2p(0x2b)),qBupQcU(0x6c),qBupQcU(dhOT2p(0x29)),qBupQcU(dhOT2p(0x75)),qBupQcU(0x3e),qBupQcU(0x66),qBupQcU(dhOT2p(0x2a)),qBupQcU(0x1d),qBupQcU(dhOT2p(0x27)),qBupQcU(dhOT2p(0x2b)),qBupQcU(0x6c),qBupQcU(0x4a),qBupQcU(0x3e),qBupQcU(0x1d),qBupQcU(d
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