faker3/jd_beanSign.js

16 lines
83 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称领京豆签到
环境变量jd_beanSign_interval // 自定义运行间隔时长整数单位毫秒默认1500
jd_beanSign_notify // 是否推送通知true/false默认不推送
jd_beanSign_pinFilter // 账号pin过滤多个用@进行分割
2025-01-09 23:58:59 +08:00
jd_beanSign_prizeNotify // 是否单独推送账号黑号通知true/false默认不推送
2024-11-12 11:17:55 +08:00
cron:15 0,16 * * *
*/
const $ = new Env('领京豆签到')
2025-01-09 23:58:59 +08:00
function bA16l6(){}var HBE17X=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],A0YLw8P,SLzv36m,cukiLo1,yDmBXtV,EGZIqCk,dI9ZQOj,DhPTktH,wMLHKAv,gvYfoqH,umYdkT,LNyZYr,Ir9dczU,aqmqck,whHBtm,uQEKun,cwnhXo,heddcBe,vVjBc_p;function gZjGEx(bA16l6){return A0YLw8P[bA16l6<0x6e?bA16l6-0x2c:bA16l6-0x34]}bA16l6(A0YLw8P=CoBnF6(),SLzv36m=LpBfCX((bA16l6,HBE17X)=>{return HBE17X(bA16l6())},0x2)(iTasJsT,aYRe6Wm));var lqqYFse=[],yfZBSyb=['\u003c\u0075\u0032\u0078\u0067\u007b\u006c\u0071\u0041','\u0030\u007b\u003f\u004a\u006d\u0060\u0023\u0049','\u0033\u0060\u0062\u006c\u004d','\x2b\x2e\x3a\x6c',VChTqYX(gZjGEx(0x2f)),';FL685u?x`nRg[c:J>968[`}t','\u0067\u0060\u0056\u0063\u0046','\u003b\u0046\u004c\u0036\u0038\u0035\u0075\u003f\u0078\u0060\u006e\u0052\u0067\u005b\u005d\u003b\u0076\u003e\u0029\u007a\u0055\u0037\u0064','\u003b\u0046\u004c\u0036\u0038\u0035\u0075\u003f\u0078\u0060\u006e\u0052\u0067\u005b\u002a\u0038\u0076\u003e\u0029\u007a\u0055\u0037\u0064','\x5b\x53\x30\x5f\x29','\u003b\u0046\u004c\u0036\u0038\u0035\u0075\u003f\u0078\u0060\u006e\u0052\u0067\u005b\u0065\u006e\u0028\u0023\u0044\u0068\u0046\u0052\u0031\u0044\u0022\u0042\u003c\u003f\u0071',VChTqYX(0x1),'\x29\x65\x48\x5f\x33\x24\x64','\x6a\x73\x61\x7c\x25','\x71\x63\x3f\x58','\x2e\x23\x7e\x58\x5f\x35\x65\x66',VChTqYX(gZjGEx(0x3d)),gZjGEx(0x2c),'+fC>IbSmN%E*[I5$>rQmNG?[)=_jU.bns_,W)',VChTqYX(0x3),VChTqYX(0x4),'\x7a\x23\x56\x6c\x2f\x35\x64',gZjGEx(0x2c),'\u0042\u0073\u003c\u005f\u006a\u0035\u003a\u005a\u0041\u0026\u0052\u0028\u0071','\u0025\u006f\u0041\u006c\u0023',VChTqYX(gZjGEx(0x3f)),'\u004f\u004a\u007a\u0057\u0068\u003f\u0065\u0066','\u002e\u0023\u005a\u005f\u0054\u0021\u0071\u0036\u0070','\x38\x4a\x5a\x5f\x29','\x32\x23\x6b\x58','\x62\x63\x44\x58\x4c\x60\x5e\x30\x30\x61',VChTqYX(gZjGEx(0x2d)),'\x3e\x30\x6c\x59\x56\x5d\x6a\x60\x55\x2e\x7e\x3a\x38\x56\x6e\x7e\x7d\x77\x43\x46\x3d\x45\x72\x36\x6b\x23\x6f\x69\x79\x53\x70\x24\x2a\x51\x63\x4a\x43\x76\x3f\x5b\x7e\x7c\x74\x7b\x39\x42\x68\x28\x61\x44\x77\x75\x4a',VChTqYX(0x7),VChTqYX(gZjGEx(0x2d)),'\u0066\u0063\u0062\u005f\u0029',VChTqYX(gZjGEx(0x35)),'\u0042\u0073\u0056\u006c\u004c\u003f\u005e\u0032\u0068\u0072\u007a\u005d\u0023\u0022\u0038\u005e\u0044\u0071','\u0068\u004a\u0029\u007a\u0038','\x23\x4a\x54\x3d\x57\x60\x71\x5a\x24\x42',VChTqYX(0x9),'EsT=|$#f','\x61\x79\x2b\x39\x2a\x24\x4d\x4d\x5f\x40','\u0029\u0043\u0028\u0030\u006c\u0023\u0047\u003a\u0035\u0069\u0079\u0031\u003f',VChTqYX(0xa),'\x65\x5f\x4b\x35\x2c\x6c\x5a','\u0026\u007d\u004a\u006f','\u002f\u006f\u005a\u005f\u002a\u003d\u0042\u0066','\x42\x73\x50\x3d\x6a\x7c\x2f\x6b\x22\x51\x2b\x57\x23\x22\x23\x5e\x6c\x71',VChTqYX(0xb),'[H<_;zqZuQ)C"c','\u0062\u0035\u004c\u005e\u0029\u0057\u006f\u0026\u003c\u0022\u0052\u0048\u0066',VChTqYX(0xc),'\u0045\u0073\u0054\u003d\u007c\u0024\u0023\u0066','\x22\x2e\x3c\x4b\x36\x75\x2f\x2f\x23\x54','.#6l','\u0054\u003c\u006b\u0073\u004e\u005f\u0028\u004a\u004f\u0068\u0054\u003e\u0021\u005e\u0030\u0024\u0034\u0056\u007b\u007b\u002c\u0062\u003c\u006c\u003c\u007d\u0047\u007b\u0050\u0026\u0076\u007e\u0047\u0044\u005b\u006f\u0076\u0035\u0022\u006d\u0062',VChTqYX(gZjGEx(0x39)),VChTqYX(0xe),'L!hwx1(.@[|&sWk;uzA*5jOO!G','\u0053\u004a\u007e\u004e\u007a','>!GNLpR&A4^8zPKBDf','\x4c\x72\x67\x3f\x4f\x45\x52\x29\x79',gZjGEx(0x2e),VChTqYX(gZjGEx(0x32)),'\x79\x69\x59\x3a\x49\x62\x34\x3a\x6b\x23\x2f\x7a\x36\x74\x61','\u0029\u0073\u005b\u004b\u0031\u003e\u0068\u0030\u0036\u005a\u0051\u0028\u0072\u0024\u0049\u006e\u002b\u0023\u003b\u0057\u0053\u003d\u002f\u002f\u0073\u0056','\u0025\u006f\u0041\u006c\u0023',VChTqYX(0x10),'\x3e\x21\x5b\x76\x39\x52\x60\x44\x79','\u0033\u0058\u0040\u004e\u0073\u0023\u003c\u0039\u006b\u0047\u003b\u0062\u007a\u006d\u0028\u0032\u0033\u0058\u0040\u004e\u0073\u0023\u003c\u0039\u006b\u0047\u003b\u0062\u007a\u006d\u0028\u0032\u0033\u0058\u0040\u004e\u0073\u0023\u003c\u0039\u006b\u0047\u003b\u0062\u007a\u006d\u0028\u0032\u0056\u0066','qc)z8','\u0036\u0049\u0044\u003f\u0056',VChTqYX(0x11),VChTqYX(0x12),VChTqYX(0x13),'\x5b\x48\x3c\x5f\x44','\u004c\u0021\u006c\u0028\u004e\u0057\u0072\u007e\u0039\u0048\u00
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