2024-11-12 11:17:55 +08:00
|
|
|
|
/*
|
|
|
|
|
活动名称:东东农场指定助力
|
|
|
|
|
活动入口:APP-我的-东东农场-旧版
|
|
|
|
|
执行功能:指定助力,随机助力
|
|
|
|
|
环境变量:jd_fruit_code // 指定助力码(多个助力码用英文逗号,@,换行分割)
|
|
|
|
|
jd_fruit_mode // 是否随机打乱助力码,true 表示需要随机打乱,false 表示顺序助力(不填默认为false),指定助力码优先级高于助力模式
|
|
|
|
|
jd_fruit_notify // 是否推送通知(true/false),默认不推送
|
|
|
|
|
|
|
|
|
|
cron:1 1 1 1 *
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const $ = new Env('东东农场指定助力')
|
2024-12-12 14:33:07 +08:00
|
|
|
|
function R5M8ky(){}var t58RVjS=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],XwYrZa,ECfmunz,kWuW_Ek,qTm_u35,BBx15EI,GbJZ8Sq,naDFFfd,AgR0XK,EHj1Yn,anFNiY9,UFhchB,QKg1ej,v7RyoSs,B49G7k,TF_sVA;function UmbpDuE(R5M8ky){return XwYrZa[R5M8ky<-0x12?R5M8ky-0x54:R5M8ky+0x11]}R5M8ky(XwYrZa=Cc09lhd(),ECfmunz=uAA5eG((R5M8ky,t58RVjS)=>{return t58RVjS(R5M8ky())},0x2)(sqovI3,RMgAn4G));var CUrOhtB=[],YcKTU_=[AyPPXj(UmbpDuE(-0x8)),AyPPXj(UmbpDuE(0x4)),'\u0035\u003f\u0030\u0028\u0045\u0048\u0042\u0074','\u0071\u0030\u005e\u003c\u0069','\x7d\x6f\x67\x3c','%U>s6J/s+TP{mH0&','\u0043\u0060\u0061\u006a\u004e',AyPPXj(0x2),AyPPXj(0x3),AyPPXj(UmbpDuE(0x1)),'\x4e\x46\x42\x6a\x71\x5a\x4c','\x29\x24\x4a\x5d',UmbpDuE(-0x11),'\x6f\x2a\x45\x5d\x6a\x28\x46\x23','\x2c\x3b\x53\x60\x31\x6d\x50\x21\x79\x47\x54\x51\x28\x2a\x47\x26\x64\x42\x38\x3f\x69\x28\x4e\x70\x6e\x54\x2e\x54\x29','pw(OZZg/|IOH)','\x69\x7a\x60\x3f\x46\x48\x61\x63\x4f\x7e\x70\x4a\x39\x25\x55','dpFtF"L',UmbpDuE(-0x11),AyPPXj(UmbpDuE(-0x10)),'\x2e\x5a\x62\x26\x4e\x6a\x3c\x67\x48\x28\x35\x60\x75\x61\x25\x4a\x7a\x61\x71\x3b\x66\x36\x28\x79\x77\x63\x46\x55\x37\x7b\x42\x30\x31\x7a\x3e\x70\x38\x75\x69\x44\x77\x4b\x46\x6d\x3e\x40\x3f\x7e\x7d\x59\x44\x5e','\u0024\u0024\u003a\u0058\u0074\u0028\u004c','\x39\x31\x63\x64\x62\x4a\x75\x3a\x5b','\u0026\u002b\u003f\u005d','\x52\x3c\x69\x51\x6d\x67\x5f\x74\x6c\x21\x25\x31\x6d\x60\x63\x4a\x40\x46\x72\x33\x4a\x78\x37\x59\x4f\x2a\x2f\x6a\x52\x64\x6c\x40\x4c\x23\x53\x60\x31\x6d\x50\x21\x79\x47\x54\x51\x28\x2a\x47\x26\x64\x42\x38\x3f\x69\x28\x4e\x70\x6e\x54\x2e\x54\x45\x39\x62\x48\x30\x7c\x3c\x41\x48\x2b\x68\x67\x6c\x21\x4f\x3a\x71\x68\x2f','\u0077\u0060\u003a\u0058\u002b\u004a\u004c',AyPPXj(UmbpDuE(-0x5)),'\u0032\u007a\u0037\u0059\u002e','\x30\x31\x3f\x5d','\x23\x24\x5e\x6a\x4e','}#TpS^`;e.fdCS(Zp@{;evJCNXj25o^"zjutN',AyPPXj(UmbpDuE(0x0)),AyPPXj(UmbpDuE(-0x10)),AyPPXj(0x8),'\x66\x7a\x33\x58\x59\x5a\x2a\x23','\x49\x5b\x6c\x3e\x6e\x43\x35\x39\x51\x2a\x73\x55\x21\x64\x67\x4e\x53\x3f\x46\x31\x74\x72\x6a\x6d\x7d\x7a\x7d\x5f\x21\x46\x7a\x70\x44\x2e','g?KKr~:>C<|,"t_','\u0028\u0053\u0076\u0022\u0022\u0060\u0076\u0050\u0043\u003c\u0079\u004b\u004a\u0044\u0046','\u005f\u007a\u0049\u003c\u003e\u004a\u0036\u003d\u0072\u0040\u0031\u004d\u002a\u0048\u006e\u0036\u0021\u0029',AyPPXj(0x9),AyPPXj(0xa),'\u0045\u0042\u0076\u005a\u0037\u004b\u0033\u003f\u0024\u0074\u0052\u0044\u0051\u005b\u0079\u003d\u006c\u0073\u0022\u0039\u002c\u0063\u0061\u0061\u0042\u0071',UmbpDuE(-0xa),'\u0061\u0042\u002a\u0063\u005f\u003a\u0061\u0067\u0056\u0052\u0029',AyPPXj(UmbpDuE(-0xe)),'\x5f\x7a\x77\x58\x32\x59\x7c\x2c\x48\x7b\x7d\x74\x2a\x48\x2a\x36\x3c\x29',AyPPXj(UmbpDuE(-0x2)),'_z/jW}L',UmbpDuE(-0x9),AyPPXj(UmbpDuE(0x2)),'E*fOx9Naa7','\x72\x42\x5f\x40\x3e\x75\x2b\x44\x5f\x67\x73\x7a\x2e','\x6d\x7c\x66\x7d\x3a\x5b\x4f\x75\x55\x67\x43\x47\x60\x4c','\u005a\u0055\u006d\u0021\u0052\u0037\u0025\u0073','\u0031\u0066\u003a\u0073\u0022\u003d\u0057\u0021\u004f\u007e\u007d\u004d\u0029','\u0045\u0070\u0060\u006a\u0030\u0058\u006d\u003a\u0029\u007b\u0044','W`!]j(S:l,d','\u0070\u0073\u0028\u0065\u0046\u0032\u0061\u0054\u004e\u0071\u004c\u004e\u003f\u002f\u0029\u006c\u0039\u0053\u0063\u0050\u0031\u0060\u0036\u0028\u0060\u0049\u0079\u0056\u007d\u006f\u0078\u004e\u0031\u0062\u007e\u002a\u0045\u007a\u003d\u0028\u0040\u0073\u0031\u0032\u0034\u0032\u0023\u0065\u0056\u0053\u003b\u007d\u006b\u0050\u0043\u005f\u0038\u0026\u0054\u002b\u005a\u004c\u0051\u0065\u0072\u0061\u0074\u002b\u0061','\x64\x3f\x7c\x5e\x4f\x79\x23\x49\x35\x4b\x2c\x35\x30\x58\x47\x3d\x3b\x59\x76\x53\x69\x48\x34\x7c\x48\x5f\x32\x62\x44\x42\x66\x35\x69\x7a\x22\x2e\x5a\x63\x25\x7c\x41\x3f\x69\x79\x67\x79\x3e\x5e\x62\x59\x4a\x44\x5d\x53\x34\x67\x6c\x21\x4f\x3a\x71\x68\x50\x5e\x7d\x23\x4d\x70\x23','\x72\x2b\x4e\x31\x6e','\x48\x6f\x38\x3f\x73\x6d\x7c\x7c\x2a\x33','\x59\x58\x53\x65\x72',AyPPXj(UmbpDuE(0x8)),'\x56\x7c\x61\x39\x6d\x64\x48',AyPPXj(UmbpDuE(-0x3)),AyPPXj(0x10),AyPPXj(UmbpDuE(0xa)),UmbpDuE(-0xf),AyPPXj(0x12),'&B6c8*Pai','Q,"9c[~M',AyPPXj(0x13),AyPPXj(0x14),'\u0061\u0036\u0074\u007d\u0029\u0063\u0068\u004d','\x4a\x4c\x26\x62\x72'
|
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
|