mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-15 08:19:17 +08:00
17 lines
118 KiB
JavaScript
17 lines
118 KiB
JavaScript
|
/*
|
|||
|
活动名称:东东农场指定助力
|
|||
|
活动入口:APP-我的-东东农场-旧版
|
|||
|
执行功能:指定助力,随机助力
|
|||
|
环境变量:jd_fruit_code // 指定助力码(多个助力码用英文逗号,@,换行分割)
|
|||
|
jd_fruit_mode // 是否随机打乱助力码,true 表示需要随机打乱,false 表示顺序助力(不填默认为false),指定助力码优先级高于助力模式
|
|||
|
jd_fruit_notify // 是否推送通知(true/false),默认不推送
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('东东农场指定助力')
|
|||
|
function gnouS6(){}var uD86NRI=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],kMMyvq,lhnhB1M,uuRING1,AEqmYg,ufL4QVj,rBjji2,LmnZ4wK,uL7CBz,pTAWUmS,oecc94,YUuzLy2,Ll9CN0s,oDfsn7,vhTPfk,uBghH6F,f7cCb6B,BHO3LGP,_0eyWa,yU6iIg,nj6rinS,gv9Eu5j,irLlcE,iNDhV0V;function rkSbC7(gnouS6){return kMMyvq[gnouS6>0xf5?gnouS6+0x6:gnouS6>-0x39?gnouS6+0x38:gnouS6-0x44]}kMMyvq=E6e6dP4();function AVbWyL(gnouS6,uD86NRI){var uuRING1=KlhXVXu(gnouS6=>{return kMMyvq[gnouS6<0x10f?gnouS6>-0x1f?gnouS6+0x1e:gnouS6+0x1:gnouS6+0x12]},0x1);return lhnhB1M(gnouS6,uuRING1(-0x1e),{value:uD86NRI,configurable:uuRING1(0x58)})}gnouS6(lhnhB1M=Object.defineProperty,uuRING1=AVbWyL(KlhXVXu((...uD86NRI)=>{gnouS6(uD86NRI[rkSbC7(-0x38)]=rkSbC7(-0x37),uD86NRI.b8C_eyk=uD86NRI[rkSbC7(-0x36)]);return uD86NRI[0x1](uD86NRI.b8C_eyk())}),rkSbC7(-0x37))(KrZ031,tcoPQDM));var HJQOfGW=[],YuYXUV=[g75AIjG(rkSbC7(-0x36)),g75AIjG(0x1),g75AIjG(0x2),g75AIjG(rkSbC7(-0x3)),g75AIjG(rkSbC7(0x4)),g75AIjG(0x5),g75AIjG(rkSbC7(-0x6)),g75AIjG(rkSbC7(-0x5)),g75AIjG(rkSbC7(0x8)),g75AIjG(0x9),g75AIjG(0xa),g75AIjG(0xb),g75AIjG(0xc),g75AIjG(0xd),g75AIjG(0xe),g75AIjG(rkSbC7(-0x1)),g75AIjG(0x10),g75AIjG(0x11),g75AIjG(rkSbC7(0x11)),g75AIjG(0x13),g75AIjG(0x14),g75AIjG(rkSbC7(0x13)),g75AIjG(rkSbC7(0x14)),g75AIjG(0x17),'c<qUp.{#NbVR0CJ}DCF>/Zbe@S+Tu=X?OD]_|05o@*+4]`hk^wo9',g75AIjG(0x18),g75AIjG(0x19),g75AIjG(0x17),g75AIjG(0x1a),g75AIjG(rkSbC7(-0x27)),g75AIjG(0x1c),g75AIjG(rkSbC7(0x15)),g75AIjG(0x1e),g75AIjG(rkSbC7(0x36)),g75AIjG(rkSbC7(0xe)),g75AIjG(0x21),g75AIjG(rkSbC7(0x0)),g75AIjG(rkSbC7(0x17)),g75AIjG(0x1f),g75AIjG(0x24),'Qc/eYnZ&|J]3>Cj%MI^4!,R',g75AIjG(rkSbC7(0x1a)),g75AIjG(rkSbC7(0x1b)),g75AIjG(0x27),g75AIjG(rkSbC7(0x3d)),g75AIjG(0x29),g75AIjG(rkSbC7(-0x31)),g75AIjG(rkSbC7(0x1e)),g75AIjG(0x2c),g75AIjG(rkSbC7(0x19)),g75AIjG(0x2e),g75AIjG(0x2f),g75AIjG(0x30),g75AIjG(rkSbC7(-0x32)),g75AIjG(rkSbC7(-0x35)),g75AIjG(rkSbC7(-0x34)),g75AIjG(rkSbC7(-0x33)),'|@+&dcrD',g75AIjG(0x35),g75AIjG(0x36),g75AIjG(0x37),g75AIjG(0x38),g75AIjG(rkSbC7(0x27)),g75AIjG(rkSbC7(-0x1f)),g75AIjG(0x3b),g75AIjG(0x3c),g75AIjG(0x3d),g75AIjG(rkSbC7(-0x2)),':X|h5baa','(3V3Vso|J&',g75AIjG(0x3f),g75AIjG(rkSbC7(0x65)),g75AIjG(0x41),g75AIjG(0x42),g75AIjG(rkSbC7(0x2c)),g75AIjG(0x44),g75AIjG(0x45),g75AIjG(rkSbC7(-0x22)),'NB|hd4HH13',g75AIjG(rkSbC7(0x2d)),g75AIjG(rkSbC7(0x24)),g75AIjG(rkSbC7(0x22)),g75AIjG(0x4a),g75AIjG(0x35),g75AIjG(0x4b),g75AIjG(rkSbC7(-0x35)),g75AIjG(rkSbC7(-0x34)),g75AIjG(rkSbC7(-0x33)),g75AIjG(rkSbC7(0x2f)),g75AIjG(0x4d),g75AIjG(rkSbC7(0x25)),g75AIjG(0x4e),g75AIjG(0x4f),g75AIjG(0x50),g75AIjG(rkSbC7(-0x15)),g75AIjG(rkSbC7(0x29)),g75AIjG(rkSbC7(0x2e)),g75AIjG(0x52),g75AIjG(rkSbC7(-0x32)),g75AIjG(rkSbC7(-0x35)),g75AIjG(0x33),g75AIjG(0x53),'|@+&dcrD',g75AIjG(0x54),g75AIjG(rkSbC7(0x31)),g75AIjG(rkSbC7(0x30)),g75AIjG(rkSbC7(0x93)),'vD|.;b#MrksWa',g75AIjG(0x57),g75AIjG(0x58),g75AIjG(0x59),g75AIjG(0x5a),g75AIjG(0x5b),g75AIjG(0x5c),g75AIjG(0x5d),g75AIjG(rkSbC7(0x32)),g75AIjG(0x5f),g75AIjG(0x60),g75AIjG(rkSbC7(-0x30)),g75AIjG(rkSbC7(-0x2f)),g75AIjG(rkSbC7(-0x2e)),g75AIjG(0x17),g75AIjG(rkSbC7(-0x31)),g75AIjG(0x45),g75AIjG(0x5c),g75AIjG(0x49),g75AIjG(0x64),g75AIjG(rkSbC7(0x34)),g75AIjG(0x66),g75AIjG(0x67),g75AIjG(rkSbC7(-0x2a)),g75AIjG(rkSbC7(-0x29)),g75AIjG(rkSbC7(-0xb)),g75AIjG(0x6a),g75AIjG(0x35),g75AIjG(0x6b),g75AIjG(0x4f),g75AIjG(rkSbC7(-0x2d)),g75AIjG(0x2a),g75AIjG(0x6c),g75AIjG(0x35),g75AIjG(0x5c),g75AIjG(0x17),g75AIjG(rkSbC7(-0x31)),g75AIjG(0x6d),g75AIjG(0x6e),g75AIjG(0x6f),g75AIjG(0x70),g75AIjG(0x49),g75AIjG(0x17),g75AIjG(rkSbC7(-0x30)),g75AIjG(rkSbC7(-0x2f)),g75AIjG(rkSbC7(-0x2e)),g75AIjG(rkSbC7(-0x2d)),g75AIjG(rkSbC7(-0x31)),g75AIjG(0x71),g75AIjG(rkSbC7(-0x28)),g75AIjG(0x73),g75AIjG(rkSbC7(-0x9)),g75AIjG(0x75),g75AIjG(0x76),'\x61\x78\x72\x7b\x2e\x62\x22\x48\x31\x2c\x7d\x30\x7c\x30\x61\x5d\x33\x61',g75AIjG(0x54),g75AIjG(0x17),g75AIjG(0x77),g75AIjG(0x78),g75AIjG(0x53),g75AIjG(0x79),g75AIjG(0x5c),g75AIjG(0x7a),g75AIjG(0x3a),g75AIjG(0x6d),g75AIjG(0x7b),g75AIjG(rkSbC7(-0x1c)),g75AIjG(rkSbC7(-0x2c)),'NB|hd4HH13',g75AIjG(0x7d),g75AIjG(rkSbC7(0x3c)),g75AIjG(rkSbC7(-0x2d)),g75AIjG(rkS
|
|||
|
// 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
|