faker3/jd_plantBean_task.js

15 lines
105 KiB
JavaScript
Raw Normal View History

2024-08-28 11:13:58 +08:00
/*
活动名称种豆得豆任务
活动入口APP-我的-种豆得豆
环境变量
jd_plantBean_notify //是否推送通知默认false
cron:1 7-21/2 * * * jd_plantBean_task.js
*/
const $ = new Env('种豆得豆任务')
2024-08-29 23:50:55 +08:00
function LEVKXH(){}var tVDaGJL=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],vZGL9dJ,Zi_07Wn,HibzRQ,WFkCHwE,PDQ1Ir,HASSv1,LHgCkn,b0k4dh,FJJyb51,pqDvvmR,dcQp_Iz,oE9dHm,MJ3USn,EotpaKK,dayE23,bVk5jZv,nGYGih,xWyPKy;function vLeaZA(LEVKXH){return vZGL9dJ[LEVKXH<-0x6?LEVKXH-0x46:LEVKXH<-0x6?LEVKXH+0x2d:LEVKXH>-0x6?LEVKXH+0x5:LEVKXH+0x60]}vZGL9dJ=SWF4Ih();function NJR6HE(LEVKXH,tVDaGJL){return Zi_07Wn.call(null,LEVKXH,vLeaZA(-0x5),{value:tVDaGJL,configurable:!0x0})}LEVKXH(Zi_07Wn=Object.defineProperty,HibzRQ=NJR6HE(jzv8TWD((...tVDaGJL)=>{var Zi_07Wn=jzv8TWD(tVDaGJL=>{return vZGL9dJ[tVDaGJL<-0x48?tVDaGJL-0x13:tVDaGJL+0x47]},0x1);LEVKXH(tVDaGJL[Zi_07Wn(-0x47)]=Zi_07Wn(-0x46),tVDaGJL[0x1c]=tVDaGJL[Zi_07Wn(-0x45)]);return tVDaGJL[vLeaZA(0xd)](tVDaGJL[0x1c]())}),vLeaZA(-0x4))(u_xM2t,DvI_9F));var BXaOWze=[],cza7xLs=[ckJXjPT(vLeaZA(-0x3)),ckJXjPT(0x1),ckJXjPT(0x2),ckJXjPT(0x3),ckJXjPT(vLeaZA(0x18)),ckJXjPT(0x5),ckJXjPT(vLeaZA(0xf)),ckJXjPT(0x7),ckJXjPT(0x8),ckJXjPT(vLeaZA(0x1e)),ckJXjPT(vLeaZA(0x15)),ckJXjPT(0xb),'%/wTi7Q9kbKVpMl#|N5)dpod',ckJXjPT(vLeaZA(0x39)),ckJXjPT(0xd),ckJXjPT(vLeaZA(0x14)),ckJXjPT(vLeaZA(0x10)),ckJXjPT(0x10),ckJXjPT(vLeaZA(0x3c)),ckJXjPT(0x12),'Dd:Wz{mkU~jlRzMnWu3kU|1',ckJXjPT(vLeaZA(0x3f)),ckJXjPT(0x14),ckJXjPT(vLeaZA(-0x2)),ckJXjPT(0x12),ckJXjPT(0x16),ckJXjPT(vLeaZA(0x40)),ckJXjPT(0x18),ckJXjPT(vLeaZA(0x52)),ckJXjPT(0x1a),ckJXjPT(0x1b),ckJXjPT(0x1c),ckJXjPT(0x1d),ckJXjPT(0x1e),ckJXjPT(0x1f),ckJXjPT(0x20),ckJXjPT(vLeaZA(0x43)),ckJXjPT(0x22),ckJXjPT(0x23),ckJXjPT(0x24),ckJXjPT(vLeaZA(0x45)),ckJXjPT(0x26),ckJXjPT(0x27),ckJXjPT(vLeaZA(0x46)),ckJXjPT(0x29),ckJXjPT(0x2a),ckJXjPT(0x2b),ckJXjPT(0x2c),'C|f}XgO',ckJXjPT(0x2d),ckJXjPT(vLeaZA(0x49)),ckJXjPT(0x2f),ckJXjPT(0x30),ckJXjPT(0x31),ckJXjPT(0x32),ckJXjPT(0x33),ckJXjPT(vLeaZA(0x4b)),ckJXjPT(vLeaZA(0xa)),ckJXjPT(vLeaZA(0xba)),ckJXjPT(vLeaZA(-0x2)),ckJXjPT(0x37),'\u0039\u0023\u0048\u004e\u0062\u0071\u004e\u0072\u0045\u0046\u007c\u0028\u006c\u002e\u003d\u0049\u0072\u003f','E_|Jr',ckJXjPT(vLeaZA(0x4d)),ckJXjPT(0x39),ckJXjPT(0x3a),ckJXjPT(0x1a),ckJXjPT(0x3b),ckJXjPT(0x3c),ckJXjPT(vLeaZA(0x4c)),ckJXjPT(0x3e),'\x2b\x3a\x47\x77\x22\x31\x41\x7c\x40',ckJXjPT(0x3f),ckJXjPT(vLeaZA(0x4f)),ckJXjPT(0x41),ckJXjPT(vLeaZA(0x32)),ckJXjPT(vLeaZA(0x67)),ckJXjPT(0x44),ckJXjPT(0x45),ckJXjPT(0x46),ckJXjPT(vLeaZA(-0x2)),ckJXjPT(0x47),'\x7c\x44\x7e\x57\x73\x59\x50\x47\x40',ckJXjPT(0x48),ckJXjPT(vLeaZA(0x53)),ckJXjPT(vLeaZA(0x68)),'\x5d\x36\x48\x4e\x63\x53\x24\x7c\x54\x2a\x4b\x67\x3f',ckJXjPT(0x4b),ckJXjPT(vLeaZA(0x56)),ckJXjPT(vLeaZA(0x0)),ckJXjPT(0x4e),ckJXjPT(0x4f),ckJXjPT(0x50),ckJXjPT(0x51),ckJXjPT(0x52),ckJXjPT(0x53),ckJXjPT(0x54),ckJXjPT(0x55),ckJXjPT(vLeaZA(-0x2)),ckJXjPT(vLeaZA(0x2)),ckJXjPT(0x57),ckJXjPT(vLeaZA(0x59)),ckJXjPT(0x59),ckJXjPT(vLeaZA(0xb)),ckJXjPT(vLeaZA(0x2f)),ckJXjPT(vLeaZA(-0x2)),ckJXjPT(0x5c),ckJXjPT(0x5d),ckJXjPT(vLeaZA(0x8)),ckJXjPT(0x5f),ckJXjPT(0x60),ckJXjPT(0x61),ckJXjPT(vLeaZA(0x61)),ckJXjPT(vLeaZA(-0x1)),ckJXjPT(0x64),ckJXjPT(0x65),ckJXjPT(vLeaZA(0x6a)),ckJXjPT(vLeaZA(0x69)),ckJXjPT(0x68),ckJXjPT(0x69),ckJXjPT(0x6a),ckJXjPT(vLeaZA(0x5)),ckJXjPT(vLeaZA(0x6b)),ckJXjPT(vLeaZA(0x6c)),ckJXjPT(vLeaZA(0x70)),ckJXjPT(0x61),ckJXjPT(vLeaZA(0x6d)),ckJXjPT(vLeaZA(-0x1)),ckJXjPT(0x70),ckJXjPT(0x71),ckJXjPT(vLeaZA(0x30)),ckJXjPT(0x73),ckJXjPT(vLeaZA(0x1b)),ckJXjPT(vLeaZA(0x1c)),'f|cT"i_',ckJXjPT(0x76),ckJXjPT(vLeaZA(0x6e)),ckJXjPT(0x78),ckJXjPT(vLeaZA(0x4e)),ckJXjPT(vLeaZA(0x3)),ckJXjPT(0x7a),ckJXjPT(vLeaZA(0x75)),ckJXjPT(vLeaZA(0x2a)),ckJXjPT(0x7d),ckJXjPT(vLeaZA(0x76)),ckJXjPT(0x15),ckJXjPT(vLeaZA(0x28)),ckJXjPT(vLeaZA(0xc)),ckJXjPT(vLeaZA(0x1)),ckJXjPT(0x82),ckJXjPT(vLeaZA(0x77)),ckJXjPT(0x15),ckJXjPT(0x79),ckJXjPT(0x84),ckJXjPT(0x85),ckJXjPT(vLeaZA(0x0)),ckJXjPT(vLeaZA(0x4)),ckJXjPT(vLeaZA(0x1)),ckJXjPT(vLeaZA(0xff)),ckJXjPT(0x86),ckJXjPT(vLeaZA(0x79)),ckJXjPT(0x51),ckJXjPT(0x88),ckJXjPT(vLeaZA(0x3d)),ckJXjPT(0x8a),ckJXjPT(0x8b),'\u005d\u005d\u0076\u0031\u0071\u007c\u0031\u003e\u0067\u005b',ckJXjPT(vLeaZA(0x2c)),ckJXjPT(0x8d),ckJXjPT(0x8e),ckJXjPT(0x8f),ckJXjPT(vLeaZA(0x62)),ckJXjPT(0x15),ckJXjPT(0x91),ckJXjPT(0x92),ck
2024-08-28 11:13:58 +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