faker3/jd_opencard_0725.js

15 lines
35 KiB
JavaScript
Raw Normal View History

2024-07-25 18:28:37 +08:00
/*
环境变量
export jd_opencard_draw="3" //抽奖次数 3
export jd_opencard_notify="true" // 是否推送
cron:1 1 1 1 *
*/
const $ = new Env('7.25-8.9 潮电星搭子大屏享赛事')
const _0x1fd2bb=_0x4c54;(function(_0x58e7d7,_0x3c6efa){const _0x1caec3=_0x4c54,_0x394ee8=_0x58e7d7();while(!![]){try{const _0x4efd85=-parseInt(_0x1caec3(0x2bb,'rSOp'))/0x1+parseInt(_0x1caec3(0x2bc,'AMP1'))/0x2+parseInt(_0x1caec3(0x1f0,'[^rF'))/0x3*(-parseInt(_0x1caec3(0x1de,'rNpO'))/0x4)+parseInt(_0x1caec3(0x1bb,'38s&'))/0x5+parseInt(_0x1caec3(0x1ae,'K8YD'))/0x6*(parseInt(_0x1caec3(0x277,'4@(R'))/0x7)+parseInt(_0x1caec3(0x200,'Sv*O'))/0x8*(-parseInt(_0x1caec3(0x18f,'zv37'))/0x9)+parseInt(_0x1caec3(0x1a4,'y0)P'))/0xa;if(_0x4efd85===_0x3c6efa)break;else _0x394ee8['push'](_0x394ee8['shift']());}catch(_0x3c12d5){_0x394ee8['push'](_0x394ee8['shift']());}}}(_0x19be,0x9ee4c));const notify=require(_0x1fd2bb(0x24c,'IT5H')),jdCookie=require('./jdCookie'),getToken=require(_0x1fd2bb(0x1f2,'1n#8')),common=require('./utils/Rebels_jdCommon'),isNotify=process['env'][_0x1fd2bb(0x237,'XH8a')]===_0x1fd2bb(0x2cb,'y0)P'),opencard_draw=process[_0x1fd2bb(0x234,'1n#8')]['jd_opencard_draw']||0x5;let domains='https://szxyun-rc.isvjcloud.com',cookie='';function _0x4c54(_0x56e75c,_0x3356b8){const _0x19be34=_0x19be();return _0x4c54=function(_0x4c54ca,_0x1d449d){_0x4c54ca=_0x4c54ca-0x18e;let _0x365484=_0x19be34[_0x4c54ca];if(_0x4c54['GYmkFi']===undefined){var _0x372c0e=function(_0x4e353c){const _0x177666='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x394c90='',_0x1bb5b3='';for(let _0x514e21=0x0,_0x1071da,_0x40ebdb,_0x4acbd0=0x0;_0x40ebdb=_0x4e353c['charAt'](_0x4acbd0++);~_0x40ebdb&&(_0x1071da=_0x514e21%0x4?_0x1071da*0x40+_0x40ebdb:_0x40ebdb,_0x514e21++%0x4)?_0x394c90+=String['fromCharCode'](0xff&_0x1071da>>(-0x2*_0x514e21&0x6)):0x0){_0x40ebdb=_0x177666['indexOf'](_0x40ebdb);}for(let _0x153a3b=0x0,_0x5c1be2=_0x394c90['length'];_0x153a3b<_0x5c1be2;_0x153a3b++){_0x1bb5b3+='%'+('00'+_0x394c90['charCodeAt'](_0x153a3b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1bb5b3);};const _0x9a6c56=function(_0x173865,_0x4d8976){let _0x1b3280=[],_0x128e07=0x0,_0x4c7f11,_0x3edcc1='';_0x173865=_0x372c0e(_0x173865);let _0x1e0d0f;for(_0x1e0d0f=0x0;_0x1e0d0f<0x100;_0x1e0d0f++){_0x1b3280[_0x1e0d0f]=_0x1e0d0f;}for(_0x1e0d0f=0x0;_0x1e0d0f<0x100;_0x1e0d0f++){_0x128e07=(_0x128e07+_0x1b3280[_0x1e0d0f]+_0x4d8976['charCodeAt'](_0x1e0d0f%_0x4d8976['length']))%0x100,_0x4c7f11=_0x1b3280[_0x1e0d0f],_0x1b3280[_0x1e0d0f]=_0x1b3280[_0x128e07],_0x1b3280[_0x128e07]=_0x4c7f11;}_0x1e0d0f=0x0,_0x128e07=0x0;for(let _0x19c8de=0x0;_0x19c8de<_0x173865['length'];_0x19c8de++){_0x1e0d0f=(_0x1e0d0f+0x1)%0x100,_0x128e07=(_0x128e07+_0x1b3280[_0x1e0d0f])%0x100,_0x4c7f11=_0x1b3280[_0x1e0d0f],_0x1b3280[_0x1e0d0f]=_0x1b3280[_0x128e07],_0x1b3280[_0x128e07]=_0x4c7f11,_0x3edcc1+=String['fromCharCode'](_0x173865['charCodeAt'](_0x19c8de)^_0x1b3280[(_0x1b3280[_0x1e0d0f]+_0x1b3280[_0x128e07])%0x100]);}return _0x3edcc1;};_0x4c54['OqzSwt']=_0x9a6c56,_0x56e75c=arguments,_0x4c54['GYmkFi']=!![];}const _0x8a986b=_0x19be34[0x0],_0x544e8b=_0x4c54ca+_0x8a986b,_0x17bcf1=_0x56e75c[_0x544e8b];return!_0x17bcf1?(_0x4c54['eZUcoq']===undefined&&(_0x4c54['eZUcoq']=!![]),_0x365484=_0x4c54['OqzSwt'](_0x365484,_0x1d449d),_0x56e75c[_0x544e8b]=_0x365484):_0x365484=_0x17bcf1,_0x365484;},_0x4c54(_0x56e75c,_0x3356b8);}function _0x19be(){const _0xf32730=['W6BcS8oVWPf6xW','WOxcGc3dNv1oWRm','ps5qW4hcS2ldKmo6fW','umkTcCokW7jOnmo5','WOnQW6xdIaynW51qtW','hIXP','h8oEW4P7qSkjW6e','cCkmyg0','rComW7y','WPtdQ0xcLq','WPJcLZFdLfK','hCkcFwlcTva','WOBdVSkMBG','fSodW6O','DmosWRTRcG','W58HgtmXWOKC','WOVdSCk2ASob','WOtcOeldI0RcVYm','W6aTzCkU','WQBdOCkvWO8','5A2c5PsP5yIx5yUq5BE16l2X5yIx6zMz5yI4','g2NdKSkxACkfDIBdNq','5lUL5A695z22','BCooWRf9gSoTW7S/','o2/dLCkObW','BSkgW5S','o8k/W5hdI8kmW4m','oSogbSoByuldG8oifW','WOGizwP8W6FdRmkT','oEISL+AZREwKJ+I3ICoH4P6SWQC','qCkkWQm+','WRxcQmkwDSojmYhdTrtcTq','a8keD2FcJ0iTtG','BSoUWO3cHSoDW7BdQKrDnmop','W74JyCkLnxO/','WQBdHCoVW6ZdPceS','5OMd5AwH5QYZ5PwrWRdcJSoc','b8kcFwlcIeC','44os5lQ15lQ06lsU5y6S','WOdcQ0ldNvNcRa','WPrUW6xdQG','oCohfmob','WQ3dICoYW77dQsOW','B8ofWRDHqSoOW7iLf8oZ','kCoDi8oH','WP3dQ0JcNLNcHa','5A+Z5OIl5lMi5yMbDW','WPhdQ8kGzSoxW7JcRdRdKW','WQRdG8oOW7BdSYmaWO8'
// 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