faker3/jd_car_sign.js

16 lines
23 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-06-29 17:05:17 +08:00
活动名称车管家签到
环境变量jd_car_sign_interval // 自定义运行间隔时长整数单位毫秒默认1500
jd_car_sign_notify // 是否推送通知true/false默认不推送
jd_car_sign_pinFilter // 账号pin过滤多个用@进行分割
2024-06-28 15:38:28 +08:00
2024-06-29 17:05:17 +08:00
定时随机
2024-06-28 15:38:28 +08:00
2024-06-29 17:05:17 +08:00
*/
2024-06-28 15:38:28 +08:00
const $ = new Env('车管家签到')
2024-06-29 17:05:17 +08:00
const _0x44c41f=_0x1b37;(function(_0x40262b,_0x42b7f2){const _0x4854d8=_0x1b37,_0x3ac2e5=_0x40262b();while(!![]){try{const _0x38a604=-parseInt(_0x4854d8(0x10c,'eBaQ'))/0x1+-parseInt(_0x4854d8(0x147,'roJ('))/0x2+parseInt(_0x4854d8(0x145,'XCJN'))/0x3+-parseInt(_0x4854d8(0x11b,'[TlU'))/0x4+parseInt(_0x4854d8(0x123,'eL0%'))/0x5+-parseInt(_0x4854d8(0x116,'a1%Z'))/0x6*(-parseInt(_0x4854d8(0x18e,'[TlU'))/0x7)+parseInt(_0x4854d8(0x11c,'p%2v'))/0x8*(parseInt(_0x4854d8(0x141,'n]FN'))/0x9);if(_0x38a604===_0x42b7f2)break;else _0x3ac2e5['push'](_0x3ac2e5['shift']());}catch(_0x5bca4c){_0x3ac2e5['push'](_0x3ac2e5['shift']());}}}(_0x1c12,0xe75d0));const jdCookie=require(_0x44c41f(0x134,'WeW(')),notify=require(_0x44c41f(0x14c,'!0rJ')),common=require('./utils/Rebels_jdCommon'),{H5st}=require(_0x44c41f(0x14d,'A2ho'));let taskThreads=process[_0x44c41f(0x166,'Sv@F')][_0x44c41f(0x143,'eBaQ')]||'1';const runInterval=process[_0x44c41f(0x139,'q2oR')][_0x44c41f(0x11a,'1]EE')]||_0x44c41f(0x150,'fl7a'),isNotify=(process[_0x44c41f(0x18f,'Qzce')][_0x44c41f(0x13c,'jEnN')]||process[_0x44c41f(0x104,'*Of@')][_0x44c41f(0x132,'LU2z')])===_0x44c41f(0x167,'XCJN'),pinFilter=(process[_0x44c41f(0x176,'WW)m')][_0x44c41f(0x106,'eBaQ')]||'')[_0x44c41f(0x15c,']ZDg')]('@'),maxThreads=0x1;let cookiesArr=Object[_0x44c41f(0x10e,'LU2z')](jdCookie)[_0x44c41f(0x177,'XSKZ')](_0x4dab5b=>jdCookie[_0x4dab5b])[_0x44c41f(0x18b,'tot1')](_0x3fa9f5=>_0x3fa9f5);!cookiesArr[0x0]&&($[_0x44c41f(0x15f,'Y@oQ')]($[_0x44c41f(0x105,'O^UR')],_0x44c41f(0x14a,'1)6z')),process[_0x44c41f(0x17d,'fl7a')](0x1));!(async()=>{const _0x3db26d=_0x44c41f;notify[_0x3db26d(0x102,'A2ho')]({'title':$[_0x3db26d(0x18d,'a1%Z')]}),await Main(),isNotify&&notify[_0x3db26d(0x10b,'1)6z')]()&&await notify[_0x3db26d(0x12b,'eBaQ')]();})()[_0x44c41f(0x109,'jEnN')](_0x4c347f=>$[_0x44c41f(0x138,')dIN')](_0x4c347f))['finally'](()=>$[_0x44c41f(0x130,'q2oR')]());async function Main(){const _0x4d489a=_0x44c41f;try{try{const _0x31f784=parseInt(taskThreads);_0x31f784>0x0&&_0x31f784!==0x1&&(taskThreads=_0x31f784);}catch{taskThreads=0x1;}taskThreads=Math[_0x4d489a(0x117,'GKmX')](taskThreads,maxThreads),$[_0x4d489a(0x107,'GKmX')]=null;if(runInterval)try{const _0x35029b=parseInt(runInterval);_0x35029b>=0x0&&($[_0x4d489a(0x174,'O^UR')]=_0x35029b);}catch{console['log'](_0x4d489a(0x168,'RKpD'));}$[_0x4d489a(0x136,'Xe(8')]=[],console[_0x4d489a(0x10a,'[gbd')](_0x4d489a(0x10d,'A2ho')+$['name']+'变量开启状态=========='),console['log']('间隔时长:\x20['+$[_0x4d489a(0x182,'XSKZ')]/0x3e8+_0x4d489a(0x11e,'J[Gp')),console[_0x4d489a(0x186,'!0rJ')](_0x4d489a(0x12c,'qRUd')+common[_0x4d489a(0x124,'Aa%M')]()+']'),console[_0x4d489a(0x113,'eL0%')]('通知推送:\x20['+(isNotify?'开启':'关闭')+']'),console[_0x4d489a(0x114,'RKpD')](_0x4d489a(0x135,'4Ri*')+pinFilter[_0x4d489a(0x14e,'n]FN')](',\x20')+']'),console['log'](_0x4d489a(0x112,'Qzce')+$[_0x4d489a(0x111,'JJ2B')]+'变量状态结束=========='),console[_0x4d489a(0x101,'1)6z')](''),await common[_0x4d489a(0x133,'roJ(')](taskThreads,cookiesArr,taskFnc),$[_0x4d489a(0x13e,'1)6z')]=![];$[_0x4d489a(0x16f,'JJ2B')]['length']>0x0&&(cookiesArr=cookiesArr[_0x4d489a(0x170,')dIN')]((_0x338eff,_0x32b388)=>!$[_0x4d489a(0x16f,'JJ2B')][_0x4d489a(0x181,'eBaQ')](_0x32b388+0x1)),$['needRemoveCookieIndex']=[]);const _0x1b5a2a=notify['getMessage']();_0x1b5a2a&&console[_0x4d489a(0x188,'XCJN')](_0x4d489a(0x12a,'Aa%M')+_0x1b5a2a[_0x4d489a(0x192,'Aa%M')](//g,_0x4d489a(0x194,'l[K0')));}catch(_0x3d3be6){console['log'](_0x4d489a(0x163,'XSKZ')+_0x3d3be6);}}function _0x1c12(){const _0x47076b=['nmoUWQldLq','WOVcLSkaWR/cVZldPmkUomke','WP5evW','WQ/dGuq','BrVcLmkr','W4VdN8oTW6ZcQSkjD8oGW5/cVG','d8kfWQi','ywtcQYfcW7qdqSkwFtRdNSoDvX/cHHqdoa','WP8GWRJdNCouuq','jG9BW7aVsq0IBSolESoFWQ0HgCkVbSk+Cmoc','W57cOrDWBSk/WR4jW43cIrJcLmoD','WRlcN1Psj0XTWRe+WRzNpmo9','w8kmWQi','56ADWP/OVkxOOPVPLi/PMP3ML5ZPLly','uLnxaSoaWRa','xCoZW7RdSmkjWQtcKmoMlr7dSSkfWPVcGxpdHbVdUCkFDCogWPlcKeZdVmkjkSkfu1VcOcHSWOfDzYJdRfnC','j8k2WOhcP8kimWvMpmkUgCouWPfLa2G7W5/cL3SEo8kFp8kcd0xdVmoExLzKW4K8WPNcUmklW6FcVCkmW5xcL8ofwCk4xN/dLxBcRgGxWPZcJmkyWRJdNmkraN
2024-06-28 15:38:28 +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