faker3/jd_XinFarm_help.js

16 lines
119 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称新东东农场助力
活动入口APP-我的-东东农场
执行功能指定助力随机助力
环境变量JD_XinFarm_code // 指定助力码(多个助力码用英文逗号,@,换行分割)
JD_XinFarm_mode // 是否随机打乱助力码true 表示需要随机打乱false 表示顺序助力(不填默认为false),指定助力码优先级高于助力模式
JD_XinFarm_notify // 是否推送通知true/false默认不推送
2024-12-11 16:57:36 +08:00
cron:45 6,16 * * *
2024-11-12 11:17:55 +08:00
*/
const $ = new Env('新东东农场助力')
2024-12-11 16:57:36 +08:00
function JzlZaW(){}var Nj7EgQ=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],kbOm3sc,K1Aqnj,RhYTUus,ZNSxZKP,Kh0dS9,DzCtcS,i1bkiA,vpcEhY,DOhPRaA,aGnIV_g,fYRSA8A,MufGFX,LRY0Zo,LjS2JK,vnQhM6;function GJRnNj(JzlZaW){return kbOm3sc[JzlZaW<-0x60?JzlZaW-0x4d:JzlZaW>-0x60?JzlZaW+0x5f:JzlZaW-0x39]}JzlZaW(kbOm3sc=a1oBQQ(),K1Aqnj=Z02n6Z9((JzlZaW,Nj7EgQ)=>{return Nj7EgQ(JzlZaW())},0x2)(KS6Qne,ZNMERJ));var FrPJoI=[],ANsVfBO=[NSBYJo(0x0),NSBYJo(0x1),'\u0066\u0044\u0034\u0068\u0072\u0051\u0033\u0036','\u0029\u003d\u002a\u0065\u007b',NSBYJo(GJRnNj(-0x2d)),NSBYJo(0x3),NSBYJo(0x4),'\u0031\u0048\u005e\u0035\u0035\u0062\u0067\u0026\u006d\u002f\u006c\u0040\u005b\u003a\u0067\u0050\u004e\u004b\u0055\u0025\u0028',NSBYJo(GJRnNj(-0x2b)),NSBYJo(GJRnNj(-0x3b)),NSBYJo(GJRnNj(-0x38)),NSBYJo(GJRnNj(-0x30)),'\u003e\u0031\u0073\u0034\u0071',NSBYJo(0x9),NSBYJo(GJRnNj(-0x36)),'\u0070\u007c\u003a\u0075\u0071\u0071\u0024\u0034\u0028\u0069\u0075\u0057\u0023',NSBYJo(GJRnNj(-0x2a)),'\x77\x70\x55\x25\x55\x50\x42',NSBYJo(0xc),NSBYJo(GJRnNj(-0x59)),'\u0038\u0071\u003c\u0022\u0041\u0033\u0065\u0024\u0057\u003a\u005e\u0063\u002b\u0053\u005a\u0049\u0045\u0053\u0029\u006a\u006b\u0059\u003a\u0056\u007c\u0076\u0055\u0048\u002f\u0040\u0074\u003d\u004e\u0045\u0026\u0070\u0046\u002b\u007b\u0068\u007c\u0036\u0055\u0066\u0026\u0064\u0035\u005f\u0079\u003f\u0068\u002a','\x52\x52\x4f\x2e\x53\x65\x33','\u0022\u002f\u0064\u0023\u0075\u0040\u0066\u004f\u0054','\u0078\u0076\u003d\u007d','\u0037\u0065\u007b\u003e\u0066\u0024\u0061\u0025\u0031\u007e\u005a\u004e\u0066\u0063\u0076\u0049\u0064\u0055\u004a\u007a\u0049\u0030\u002f\u003f\u0075\u004b\u0034\u0033\u0037\u0077\u0031\u0064\u0042\u0044\u006b\u0028\u003d\u0054\u0045\u004d\u002a\u004c\u0061\u003c\u0068\u0074\u006b\u005e\u007b\u0045\u0050\u0038\u0071\u0076\u005a\u0028\u004f\u0035\u007b\u0056\u0024\u0056\u002f\u006c\u0053\u0022\u002f\u004c\u0049\u006f\u006b\u003f\u0033\u004a\u0078\u0048\u003e\u005f\u0075\u0072\u007c\u0023',GJRnNj(-0x56),'\x6f\x6f\x26\x3d\x64\x69\x63\x6a\x7a\x3f\x54\x5d\x58\x4d\x35\x71\x25\x69\x60\x3b\x3c\x5a\x59\x3c\x65\x54\x6d\x2a\x59\x34\x4a\x5d\x53\x62\x23',NSBYJo(GJRnNj(-0x31)),'\u003d\u004e\u0035\u006d',NSBYJo(0xf),NSBYJo(0x10),'\x70\x7c\x7e\x6d\x7b',GJRnNj(-0x5c),NSBYJo(0xf),'\u006b\u0045\u007a\u0054\u003f\u0071\u004b\u0044','\u007d\u0071\u0079\u0024\u0075\u006b\u0066\u0025\u0064\u007c\u004b\u004e\u003b\u006c\u005b\u0049\u006e\u0053\u002f\u004c\u0034\u007b\u0038\u002c\u0033\u0056\u0033\u006f\u003b\u002f\u0056\u0078\u005d\u0023',NSBYJo(GJRnNj(-0x29)),'\u005e\u006e\u0051\u005a\u005a\u0059\u0051\u0026\u006b\u0076\u0067\u0070\u002a\u005d\u002f','\u0061\u0045\u0069\u0065\u0026\u0049\u0059\u0078\u004a\u0064\u004e\u0043\u004b\u0057\u007d\u0059\u007e\u0023',NSBYJo(GJRnNj(-0x37)),'\x4e\x4b\x69\x65\x28\x3a\x42',NSBYJo(GJRnNj(-0x5d)),NSBYJo(0x14),'\u0071\u0064\u0079\u0024\u0048\u007c\u0071\u003c\u0025\u0054\u0067',NSBYJo(0x15),'\u0037\u0064\u0079\u0024\u0048\u007c\u0071\u003c\u0025\u0054\u0058\u004b\u007a\u0025\u007a\u005a\u005b\u0061',NSBYJo(GJRnNj(-0x28)),'\x61\x45\x34\x33\x21\x79\x42','\x7e\x45\x68\x54\x72\x7c\x26\x28\x31',NSBYJo(0x17),NSBYJo(0x18),NSBYJo(0x19),GJRnNj(-0x5f),NSBYJo(0x1a),NSBYJo(0x1b),'\x3a\x75\x3e\x6b\x5d\x24\x59\x35\x61\x54\x22','\u0021\u0063\u007e\u006d\u0033\u003a\u0067\u005d\u0031\u005b\u0077','\x67\x46\x71\x65\x34\x5e\x55\x2b\x30\x72\x3c\x30\x5d\x24\x52\x7d\x32\x7c\x6e\x4f\x2f\x52\x41\x47\x26\x75\x7c\x4d\x35\x63\x4c\x68\x45\x6a\x3e\x6b\x3b\x7d\x61\x69\x42\x54\x23\x78\x74\x74\x50\x7b\x69\x61\x79\x45\x56\x3b\x2c\x74\x6e\x34\x47\x3e\x33\x41\x6c\x54\x75\x51\x6f\x69\x4c\x6d\x2b\x38','\u0077\u0035\u0028\u002a\u0075\u0056\u0044\u0069\u005e\u0036\u005b\u005e\u003d\u0054\u002c\u0078\u006a\u003f\u006e\u0067\u002e\u002c\u004d\u0071\u0022\u0070\u003f\u002b\u005d\u0051\u0038\u007b\u003b\u0074\u0063\u0033\u0026\u0078\u0023\u0034\u004a\u0040\u006b\u004c\u005a\u005a\u002f\u0050\u0034\u0023\u007c\u003b\u0052\u0026\u0053\u005a\u0039\u0025\u0078\u0048\u003e\u005f\u0075\u0072\u0063\u0039\u0037\u0034\u0038\u0048\u0069\u0042','\u0042\u0043\u0039\u0031\u0029','\u0025\u0036\u002e\u0046\u0062\u0059
2024-11-12 11:17:55 +08:00
// prettier-ignore
2024-12-11 16:57:36 +08: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