faker2/jd_washbeans.js

22 lines
149 KiB
JavaScript
Raw Normal View History

2024-06-28 07:27:40 +00:00
/**
2022/8/17 兑换物流积分失败不在执行兑换京豆
2022/8/24 兑回京豆调整为兑换剩余全部积分不按兑换积分计
2022/8/28 修复已知问题
2022/9/15 兑换失败重试一次
2023/2/6 一些优化
2023/2/7 分离积分换豆;换积分失败重试2次
2023/2/8 优化延时
2023/5/10 fix
默认不执行如需执行请设置变量 DY_WASHBEANS='true'
7天内过期京豆大于10个豆子才洗
每次最低兑100积分最多500积分
33 5 1 1 * https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_washbeans.js
问题建议TG -> https://t.me/dylan_jdpro
*/
if (process.env.DY_WASHBEANS != "true") {
console.log('\n默认不运行,设置变量export DY_WASHBEANS="true"来运行\n')
return
}
const $ = new Env('临期京豆换积分');
const _0x49c0dd=_0x2fda,_0x37dce0=_0x2fda,_0x1bd55d=_0x2fda,_0x50b1d2=_0x2fda,_0x581123=_0x2fda;(function(_0x1817ea,_0x1a8350){const _0x3ad32d={_0x86ed07:'0x598',_0x4f7784:'XV)d',_0x3c1cec:'0x2ba',_0x2ed235:'640h',_0x3ea222:'0x2c6',_0x59188e:'gpdz',_0x8f4df3:'0x349',_0x40d9e1:'nNda',_0x894463:'0x268',_0xc0d99e:'0x232',_0x231804:'URC6',_0x3cf656:'0x230',_0x46d7aa:'T5]8',_0x4ed1cb:'0x3bd',_0x2e23ab:'!r6G',_0x2ef4c9:'0x4c7',_0x3b1a6b:'V3q7',_0x310250:'0x3a3',_0x197ec7:'iwG8',_0xec5ac:'0x33a',_0x4935fd:'o[KC',_0x1aef67:'0x55a'},_0x137b67=_0x2fda,_0x3fb31e=_0x2fda,_0x1957e2=_0x2fda,_0x5e3715=_0x2fda,_0x28bcb2=_0x2fda,_0x2a03d9=_0x1817ea();while(!![]){try{const _0x39259e=parseInt(_0x137b67(_0x3ad32d._0x86ed07,_0x3ad32d._0x4f7784))/(-0xa5+0x4*0x210+-0x79a)*(parseInt(_0x3fb31e(_0x3ad32d._0x3c1cec,_0x3ad32d._0x2ed235))/(0x226c+0x1678+-0x38e2))+parseInt(_0x3fb31e(_0x3ad32d._0x3ea222,_0x3ad32d._0x59188e))/(0x5*0x557+0xa*0xd5+0x1*-0x2302)+-parseInt(_0x5e3715(_0x3ad32d._0x8f4df3,_0x3ad32d._0x40d9e1))/(-0x32*0x2+0x3*0x80d+-0x17bf)*(parseInt(_0x28bcb2(_0x3ad32d._0x894463,_0x3ad32d._0x2ed235))/(-0xc18+-0x1c97+0x209*0x14))+parseInt(_0x137b67(_0x3ad32d._0xc0d99e,_0x3ad32d._0x231804))/(-0x118d+-0xbf0+0x1d83)+parseInt(_0x1957e2(_0x3ad32d._0x3cf656,_0x3ad32d._0x46d7aa))/(-0xac8*0x1+0x565+-0x4d*-0x12)*(-parseInt(_0x137b67(_0x3ad32d._0x4ed1cb,_0x3ad32d._0x2e23ab))/(-0x2302+-0x1cb6*-0x1+0x654))+-parseInt(_0x28bcb2(_0x3ad32d._0x2ef4c9,_0x3ad32d._0x3b1a6b))/(0x1*0x1271+0x2e*-0xe+0xe2*-0x12)*(parseInt(_0x137b67(_0x3ad32d._0x310250,_0x3ad32d._0x197ec7))/(0x665+0x5d*0x45+-0x1f6c))+parseInt(_0x28bcb2(_0x3ad32d._0xec5ac,_0x3ad32d._0x4935fd))/(0x116e+0x1422+-0x5*0x781)*(parseInt(_0x5e3715(_0x3ad32d._0x1aef67,_0x3ad32d._0x4f7784))/(0x85*0x5+-0x197e+0x16f1));if(_0x39259e===_0x1a8350)break;else _0x2a03d9['push'](_0x2a03d9['shift']());}catch(_0x6ace2c){_0x2a03d9['push'](_0x2a03d9['shift']());}}}(_0xb603,-0x282f7*-0x1+-0x2436b*0x1+0x435cf));const _0x2be9c5=(function(){const _0x534bdf={_0x92fe36:'0x292',_0x607f6e:'*&N&',_0x4d95d3:'0x39a',_0x3b1691:'&4f$'},_0x1f03f2={_0x255e62:'0x2b9',_0x3e27a0:'[43U',_0x117566:'0x3bb',_0x270836:'Bp8x',_0x583d8f:'0x4c0',_0x18c20c:'He[*',_0x2f9821:'0x3c0',_0x4b3db3:'eH(Z',_0x5c15a4:'0x47b',_0x3893e7:'@rML',_0x4b9c88:'0x2b6',_0x56ffca:'ExE8',_0x115970:'0x42e',_0x2f7e6b:'6Mcy',_0x24995b:'0x3ea',_0x100820:'QFO@',_0x3e757c:'0x2f3',_0x29245c:'dL[C',_0x24967b:'0x23f',_0x4f48ce:'*Vj9',_0x1acaf8:'0x476',_0x2dc065:'Psjc',_0x3adb07:'0x43e',_0x276fa3:'&4f$',_0x17d042:'0x449',_0x141ef0:'VQFc',_0x5955ba:'0x4a8',_0x2cdcd6:'iwG8',_0x43e86e:'0x3d7',_0x1ac09f:'URC6',_0x11e926:'0x343',_0x34c040:'0x4ab',_0x5d677a:'Psjc',_0x787a8d:'0x2d6',_0x37e73d:'Z8f%',_0x1923c0:'0x444',_0x1916ff:'XRbp',_0x14ac56:'0x4eb',_0x452269:'VR[I',_0x39cb98:'0x40e',_0x57aec4:'(KwM',_0x5a5286:'0x49e',_0x27b31b:'#AeG',_0x5d7e38:'0x356',_0x3910e3:'0C$h',_0x2d3047:'0x4bb',_0x16b5b4:'QFO@',_0x4c0491:'0x51d',_0x48f32c:'IKxg',_0x128cf9:'0x44d',_0x4d0d94:'[43U',_0x4d8e1b:'0x3cb',_0x36e7e0:'moW#',_0x35185b:'0x25a',_0x46fa89:'0x26c',_0x172d41:'0x30d',_0x16a9f6:'He[*',_0x196318:'0x257',_0x4c6e28:'Bp8x',_0x27d445:'0x236',_0x1cbd87:'o[KC',_0x247de3:'0x490',_0x17e59e:'V3q7',_0x3ac427:'0x45c',_0x4f789b:'0x228',_0x2491aa:'Psjc',_0x56d6cd:'0x290',_0xe49d26:'moW#',_0x55f020:'0x532',_0x2e9763:'eH(Z',_0x3c73ee:'0x328',_0x543e0a:'eH(Z',_0x11f7b5:'0x203',_0x1c3949:'0x2c2',_0x4f58a2:'0x2f8',_0x44ec95:'i^$S'},_0x5e06f9=_0x2fda,_0x2dec76=_0x2fda,_0x6b2479={};_0x6b2479[_0x5e06f9(_0x534bdf._0x92fe36,_0x534bdf._0x607f6e)]=function(_0x350f79,_0x479e83){return _0x350f79+_0x479e83;},_0x6b2479[_0x5e06f9(_0x534bdf._0x4d95d3,_0x534bdf._0x3b1691)]=function(_0x10e534,_0x462001){return _0x10e534===_0x462001;};const _0x18f55e=_0x6b2479;let _0x50cd4f=!![];return function(_0x211374,_0x1964bc){const _0x13efcf={_0x859aac:'0x209',_0x269199:'VQFc'},_0x2771db={_0x132ac9:'0x58a',_0x40e9ae:'IUYH'},_0x140196={'kqzbD':function(_0x595b37,_0x4a62c2){const _0x614ca3=_0x2fda;return _0x18f55e[_0x614ca3(_0x2771db._0x132ac9,_0x2771db._0x40e9ae)](_0x595b37,_0x4a62c2);},'TZieT':function(_0xde98ba,_0xafe829){const _0x53bb2c=_0
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