faker3/jd_plantBean_task.js

15 lines
100 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称种豆得豆任务
活动入口APP-我的-种豆得豆
环境变量
jd_plantBean_notify //是否推送通知默认false
cron:1 7-21/2 * * *
*/
const $ = new Env('种豆得豆任务')
2024-12-11 16:57:36 +08:00
function P_tE8IR(){}var zY1o9L=Object['defineProperty'],DRgTaTy,GgoZ8MZ,a4BJRPJ,cq7_zO7,QHAJoTY,AHVMVZs,GA1VnwJ,jAyf67,QK4sTOs,zz74Pa8,OX62MF,WLHeJk,AKcZP6p,EyCjDy,TOihS3k;function ENY9LY4(P_tE8IR){return DRgTaTy[P_tE8IR<0x42?P_tE8IR<0x42?P_tE8IR+0x3f:P_tE8IR+0x41:P_tE8IR-0x39]}P_tE8IR(DRgTaTy=pbDAydi(),GgoZ8MZ=vhBqveY((P_tE8IR,zY1o9L)=>{return zY1o9L(P_tE8IR())},0x2)(thtPyP,T_4yJBK));var HjsE5ZY=[],FzwADx=[eooH22(0x0),eooH22(0x1),'\u007c\u0034\u0042\u004a','\u0058\u0038\u0035\u002a\u0025\u0043\u005d\u002e\u0054\u0046\u0042\u0061\u0057\u0050\u0063\u0028\u0042\u007b\u0030\u0065\u005a\u0057\u005f\u005a',eooH22(ENY9LY4(-0x28)),eooH22(ENY9LY4(-0x29)),'7jp1V',eooH22(0x4),eooH22(0x5),eooH22(0x6),eooH22(0x7),'\u007c\u005a\u004d\u0077\u007e\u0076\u0060\u0054\u006f\u0056\u0078\u0063\u0033\u007e\u0050\u0045\u0077\u0024\u004e\u0054\u006f\u0051\u002e\u0033\u004b\u0040\u0065\u0037\u003d\u0034\u0076\u004c\u006a\u0065\u0053\u0073\u004b','\x26\x67\x79\x52\x39','\x35\x7b\x2a\x22',eooH22(0x8),'qix<5CQJX@;6*4GQl`','\x2a\x45\x3d\x3b\x76\x26\x6c\x39',eooH22(0x9),'\x75\x69\x4f\x3f\x24\x64\x2a\x39',eooH22(0xa),'\x48\x6a\x6c\x40\x37\x31\x48\x3f\x3c\x4e\x63',eooH22(0xb),'\x52\x6a\x6c\x40\x37\x31\x48\x3f\x3c\x4e\x7c\x73\x3a\x3c\x3a\x32\x4a\x49',eooH22(ENY9LY4(-0x2d)),'\x71\x69\x30\x68\x65\x38\x5a',eooH22(ENY9LY4(-0x3f)),'\u0040\u0066\u005e\u0049\u003f\u0064\u004f\u0039','\x60\x75\x22\x3f\x6c\x2e\x24\x30\x30\x58',eooH22(0xe),eooH22(0xf),'t|ibF@aL',eooH22(ENY9LY4(-0x1f)),eooH22(0x11),eooH22(ENY9LY4(-0x1d)),eooH22(ENY9LY4(-0x1b)),'\u005f\u0029\u0033\u003c\u002a',eooH22(ENY9LY4(-0x18)),'\x35\x7b\x55\x73\x28\x2e\x6b\x5a',eooH22(0x15),'\x3b\x7b\x44\x65\x4b','Rj#JK1]aX?Uf:<;2%I','K{W"HP].!',eooH22(ENY9LY4(-0x39)),ENY9LY4(-0x3c),eooH22(0x17),eooH22(0x18),'\x32\x7b\x48\x5b\x77\x53\x56\x61\x3a\x46\x67','\u0042\u0067\u002f\u0063\u003a\u005a\u0078\u005b',eooH22(0x19),'\x7d\x78\x6e\x40\x36\x21\x57\x34\x36\x6c\x2b\x52\x3a\x79\x7d\x7c\x3c\x3b\x61\x45','2{H[wSJ%!',eooH22(0x1a),'\x25\x4b\x60\x63\x4c\x56\x7e\x29\x41\x2f','\u0033\u0062\u0030\u0065\u0022\u002b\u0022\u0044\u006e\u0070','\x3c\x34\x48\x73\x69\x4f\x7c\x35\x21','\u003e\u005a\u002a\u0060\u0028\u002f\u005f\u005e\u005b',eooH22(0x1b),ENY9LY4(-0x3e),'\x53\x46\x70\x63\x4f\x5a\x78\x5b',eooH22(ENY9LY4(-0x3f)),'\x79\x7c\x48\x40\x4a\x6f\x44\x5b',eooH22(0x1c),'\u0023\u0022\u0076\u0053\u0038\u0023\u0053\u0069\u004a\u0057\u0077\u0040\u0063','(gjznMQ?H~PRr0a','\u0022\u0037\u0046\u0025\u0040\u0030\u0031',eooH22(ENY9LY4(-0x17)),eooH22(ENY9LY4(-0x19)),'\u0035\u0046\u003e\u0040\u0043\u0035\u0039\u0034\u004d\u007e\u0032\u0032\u003d','\u003a\u007b\u0048\u005b\u002e\u0045\u0045\u005e\u006f\u0046\u005b',eooH22(0x1f),'\u007b\u007b\u0048\u0026\u007c\u002e\u0026\u0045\u007e\u0052',eooH22(0x20),ENY9LY4(-0x3e),eooH22(0x21),eooH22(0x22),eooH22(0x23),'%K`c3H`[w~',eooH22(0x24),'\u0035\u007b\u002a\u0022','\x2a\x6d\x5f\x40\x41\x5b\x4b\x74\x74\x70',eooH22(0x25),eooH22(ENY9LY4(-0x24)),'\u003f\u0041\u0072\u005d\u0048\u0065\u006b\u0062\u0076\u0029\u0025\u0065\u0057\u0044\u003b',eooH22(0x27),'\x79\x7b\x60\x65\x72\x67\x36\x29\x3e\x44\x2a\x67\x26\x63\x39',ENY9LY4(-0x3d),'\x25\x4b\x60\x63\x60\x65\x2a\x25\x41\x6c\x44','\x25\x4b\x60\x63\x67\x5a\x6b\x62\x76\x29','\x53\x78\x57\x22\x6a\x5b\x26\x4b\x38\x4d\x68\x61\x31\x3c\x55\x34\x30\x62\x5f\x40\x3a',ENY9LY4(-0x35),eooH22(0x28),'\x78\x41\x2f\x63\x7b\x2c\x44\x5b',eooH22(ENY9LY4(-0x11)),ENY9LY4(-0x3d),eooH22(0x2a),'\x2a\x6d\x5f\x40\x33\x3e\x33\x26\x42\x44\x72\x61\x3e\x6d',eooH22(ENY9LY4(-0x36)),'\x28\x67\x6a\x7a\x6e\x4d\x51\x3f\x72\x65\x30\x32\x34\x2a\x60\x49\x41\x37\x61\x45\x4a\x2c\x4e\x38\x43','y|L%VO??x/','\u003b\u0060\u0060\u0056\u002f\u0077\u003a\u0052\u0049\u0029\u0066\u0051\u0043\u0039',eooH22(ENY9LY4(-0x12)),'\x78\x60\x6a\x21\x3b\x4d\x68\x6f\x41\x6c\x76\x70\x3f\x39\x66\x49','j_+"[]gH6hdk@m','\x35\x7b\x2a\x22','\u003a\u007b\u0048\u0073\u004b',eooH22(ENY9LY4(-0xb)),eooH22(ENY9LY4(-0x3b)),eooH22(ENY9LY4(-0x38)),ENY9LY4(-0x3e),ENY9LY4(-0x37),ENY9LY4(-0x34),ENY9LY4(-0x3c),eooH22(ENY9LY4(-0x3b)),':_7[9qo.{Mw','\x2e\x3d\x56\x40\x7b\x2e\x7a',':{H[.EE^oF[',eooH22(0x2f),'uuY,t?v]c=',eooH22(0x30),'\u006
2024-11-12 11:17:55 +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