faker3/jd_beanSign.js

17 lines
73 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默认不推送
2025-02-18 08:16:35 +08:00
jd_beanSign_notifytitle // 通知内容自定义
2024-11-12 11:17:55 +08:00
cron:15 0,16 * * *
*/
const $ = new Env('领京豆签到')
2025-02-18 08:16:35 +08:00
function wcin2o(){}var Fy4tMQ8=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],TGN7Hq,EwwDW_Y,xrGULr,ib9Npi,a3Kk60,x0tcRF4,XmVOpJy,WuVmtj,qcWotBy,Y8Epq2,QRzb8tZ,vKZSwC,zDLcYpW,dqrwUV,Iek1IYr,qiElEWX,MUXzYM,yNr7ie,IFRD1R,TMpWgm;function tzkGrX1(wcin2o){return TGN7Hq[wcin2o>0x4f?wcin2o-0x2d:wcin2o>0x19?wcin2o-0x1a:wcin2o+0x56]}wcin2o(TGN7Hq=xrcBASJ(),EwwDW_Y=bZCyf1((wcin2o,Fy4tMQ8)=>{return Fy4tMQ8(wcin2o())},0x2)(bJ339m,uFiHPCx));var fx_kMR=[],F1swpm=['\x67\x68\x60\x34\x40\x35\x6c\x5d','\u006b\u0068\u0061\u0055\u007b\u005d\u003a\u0043',Z1Yr_H(tzkGrX1(0x1c)),Z1Yr_H(0x1),'\u003e\u0030\u0029\u0047',Z1Yr_H(tzkGrX1(0x3a)),Z1Yr_H(tzkGrX1(0x26)),Z1Yr_H(0x4),'\u007a\u003b\u002c\u0021\u0022\u006d\u0043\u005e\u005b\u003c\u0058\u0064\u0073\u0056\u007e\u007a\u0025\u005a\u0035\u007c\u003f\u0069\u0071','z;,!"mC^[<XdsVW"%Z5|?iq',Z1Yr_H(0x5),'z;,!"mC^[<XdsV$XL:ph;dlp=J4^}','\x7a\x3b\x2c\x21\x22\x6d\x43\x5e\x5b\x3c\x58\x64\x73\x56\x24\x58\x3d\x30\x52\x39\x32\x28\x23\x33\x47\x4d',Z1Yr_H(tzkGrX1(0x2f)),'\u007a\u003b\u002c\u0021\u0022\u006d\u0043\u005e\u005b\u003c\u0058\u0064\u0073\u0056\u007e\u007a\u0025\u005a\u0035\u007c\u003f\u0069\u0067\u0021\u0037\u004d\u006a\u004c\u007d','\u005e\u0067\u004f\u004e\u004a\u0055\u0039\u0065\u0072\u005b\u005f\u0074\u005e\u004f\u0023\u006a\u0038\u0053\u0051\u005e\u002e\u004f\u006b\u006f\u003f\u0069\u0036\u0040\u003d\u0064\u0025\u003d\u006b\u0025\u005d\u0056\u002e\u004a\u0060\u0059\u002c\u0040\u004d\u002b\u0079\u0041\u007b\u0063\u0031\u006e\u0059\u004d\u0050\u007a\u0049\u0054\u0051\u0078\u0051\u0049\u005b\u0031\u003b\u0079\u003a\u0053\u0073\u0036\u007d\u0059\u007e\u0056\u007c\u0039\u003c\u0030\u0034\u007e\u004e\u0064\u0073\u004e\u0077\u003f\u0075\u0059\u004c\u0055\u0064\u0032\u002b\u005e\u003c\u007e\u0054\u0021\u003a\u0036\u0046\u007a\u0048\u004f\u0028\u0035\u0034\u0030\u0076\u004b\u0064\u0026\u004a\u005a\u0022\u005f\u006c\u003f\u0074\u0055\u005b\u002c\u006e\u0030\u0025\u004d\u0040\u0066\u0042\u0074\u0074\u002b\u0043\u0040\u006a\u0045\u002c\u004a\u007a\u0056\u003d\u006d\u0054\u0079\u0034\u0069\u0067\u005b\u0042\u0047\u0039\u0044\u003e\u002b\u0070\u003b\u006c\u0025\u0024\u0050\u005f\u0060\u0044\u0074\u005a\u0033\u0046\u005e\u0064\u002f\u0054\u0053\u0065\u0075\u003d\u0055\u002e\u0055\u003c\u0069\u007a\u0061\u006d\u0044\u0063\u004a\u002b\u0058\u0058\u006d\u0026\u0037\u0038\u0037\u0056\u0067\u0067\u0064\u0042\u0061\u0079\u0044\u0079\u003b\u006c\u0025\u0058\u0079\u0037\u0039\u0030\u006a\u0044\u004c\u0078\u005f\u0034\u0049\u0071\u004d\u0046\u007d\u007e\u007a\u0066\u0032\u0037\u0076\u002c\u004f\u0043\u0023\u003c\u004a\u0022\u002c\u0047\u0055\u006b\u006f\u003f\u0069\u002e\u0068\u0023\u0059\u005a\u0024\u0076\u0040\u0029\u0042\u0045\u0059\u004d\u0076\u0021\u0031\u0055\u004c\u003c\u0061\u0059\u005e\u002b\u002b\u0035\u0077\u006b\u0029\u0072\u0025\u0047\u0026\u005a\u0068\u004a\u0061\u0058\u0044\u0073\u004e\u0054\u007a\u004c\u007e\u0045\u0050\u007d\u0030\u0044\u0041\u002b','2Ng@9','\x7d\x49\x5e\x6f',Z1Yr_H(0x7),'\u003c\u007c\u0075\u006f','\x2b\x49\x38\x59\x35','\x3e\x2b\x77\x5a\x42\x38\x74\x37\x45\x39\x60\x57\x56\x42\x6d\x5f\x5a\x2f\x52\x37\x45\x54\x5e\x56\x35\x26\x59\x32\x3f\x30\x38\x58\x4e\x59\x78\x50\x35','\u005a\u006b\u0070\u006f\u0048','\x51\x5f\x43\x66\x59\x7d\x6c\x4b','\x7c\x3a\x53\x47\x33\x6d\x71','\u004b\u004f\u0059\u004a\u007c','\u0055\u0031\u0052\u004a\u002c\u0030\u0061\u007e\u0068\u0070\u0062\u0076\u0063','\x3c\x3d\x68\x67\x51','\x43\x41\x6b\x26\x29\x7e\x71','\x6e\x76\x7c\x50\x68\x5e\x24\x2b','0:.YM(}!Q','\x22\x76\x2e\x59\x35','\x44\x3a\x61\x6f','8Ipo,<r11g',Z1Yr_H(0x8),'Z1G{S~2<?0y)"SXyFbw;&`/!a:]jOtQ_WRIvw%^Vy@KecJhLgpbCv','\u0035\u004e\u0056\u0075\u006c\u005a\u0068\u0031\u0021\u002e\u0052\u004c\u002f\u005f\u0042\u0058\u003e\u003a\u007a\u0050\u0074\u0026\u0033\u0033\u004e\u0053','\u006e\u0076\u0075\u006f','\u002b\u0049\u0038\u0059\u0035','UjqX]Q(PWklLQ0pc.1FT%s^z>mRD2aS^~noMJMv%m5T7V[:_"lgM;?}','JNSG,^rDh/|~:="rp}',Z1Yr_H(0x9),'\u003e\u0039\u0050\u0065\u003a\u005b\u0079\u006f\u0058\u0041',Z1Yr_H(0xa),'\x66\x47\x50\x65\x30\x58\x3e\x4e',Z1Yr_H(tzkGrX1(0x24)),'\x4a\x4e\x34\x59\x32\x6d\x29\x2e
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