1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
const a0_0x452df5 = a0_0x2714; (function (_0xb57f10, _0x2db2f5) { const _0x44ffa3 = a0_0x2714, _0x9a1fa5 = _0xb57f10(); while (!![]) { try { const _0x537333 = parseInt(_0x44ffa3(0x120)) / 0x1 * (parseInt(_0x44ffa3(0xbd)) / 0x2) + -parseInt(_0x44ffa3(0xc0)) / 0x3 + -parseInt(_0x44ffa3(0xca)) / 0x4 + parseInt(_0x44ffa3(0xde)) / 0x5 * (-parseInt(_0x44ffa3(0xc7)) / 0x6) + -parseInt(_0x44ffa3(0xb1)) / 0x7 + parseInt(_0x44ffa3(0xfd)) / 0x8 * (-parseInt(_0x44ffa3(0x111)) / 0x9) + parseInt(_0x44ffa3(0xcd)) / 0xa; if (_0x537333 === _0x2db2f5) break; else _0x9a1fa5['push'](_0x9a1fa5['shift']()); } catch (_0x56aa9b) { _0x9a1fa5['push'](_0x9a1fa5['shift']()); } } }(a0_0x1e78, 0xa315c)); import a0_0x13519c from 'config'; import a0_0x4c1af4 from 'http'; import a0_0x57dc04 from 'util'; function a0_0x2714(_0x5bf2b5, _0x3d8028) { const _0x1e78cd = a0_0x1e78(); return a0_0x2714 = function (_0x2714d4, _0x2c4086) { _0x2714d4 = _0x2714d4 - 0xa4; let _0x2f4e3e = _0x1e78cd[_0x2714d4]; return _0x2f4e3e; }, a0_0x2714(_0x5bf2b5, _0x3d8028); } function a0_0x1e78() { const _0xb62712 = ['1405MrSHSa', '请重新进入签到页面', 'getActivityInfo', 'getTime', 'json', '二维码过期,再扫一次', 'bd09ll', 'substring', 'geocode', 'https://sso.chaoxing.com/apis/login/userLogin4Uname.do', 'info', 'setStorage', 'defaultSign', 'msg', 'getText', 'beforeSign', 'cfid', 'phone', '通用签到', 'endTime', '聂云竹', 'validate', 'username', 'checkLogin', 'https://pan-yz.chaoxing.com/upload?_token=', 'getStorage', '获取用户信息', 'activeId', 'cataName', '自动登录\x20未登录', 'getUserInfo', '8SkykYP', 'course', 'clazz', '获取课程', 'nameFour', 'uploadFile', '/v2/apis/active/getPPTActiveInfo', '叶青雨', '签到成功', 'sougou', 'updatetime', 'baiduMapKey', 'https://pan-yz.chaoxing.com/api/token/uservalid', 'floor', 'success2', 'sex', 'sort', 'PRIMARY_KEY', 'startTime', 'find', '9501813xPuVFS', 'checkSignCode', 'success', 'keys', '非法请求', 'clazzName', 'true', '上传文件', '_uid', 'get', 'password', '/widget/sign/pcStuSignController/checkIfValidate', '唐舞麟', 'indexOf', 'assign', '11omFmFk', 'uid', 'activeList', 'cookies-updatetime-', '获取活动详情', 'clazzId', '获取活动', 'getUID', 'otherId', 'baseUrl', '/newsign/preSign', '检查签到码', 'startsWith', 'type', 'isShow', '150423GUexfB', 'catalogId', 'content', 'unitConfigInfos', 'name', '/v2/apis/active/student/activelist', '任意坐标转百度坐标', '签到成功,但是已迟到', '江玉饵', '君莫邪', '预签到,\x20访问签到页面', 'getActivity', '115564SBGGGv', 'logo', 'https://passport2-api.chaoxing.com/v11/loginregister', '3096942WktLOM', 'debug', '坐标转文本', 'teacherfactor', 'random', 'UID', 'cookies', '1950pFyozO', 'gcj02', 'folderName', '4757020mqmRRV', 'map', 'filter', '34225340DAKbmf', '中华人民共和国', 'channelList', 'key', '/pptSign/stuSignajax', 'schoolname', 'data', 'tianMapKey', 'length', 'result', 'getValidate', 'getResult', 'getAddressText', 'imageurl', 'errorLocation', 'dept', 'login']; a0_0x1e78 = function () { return _0xb62712; }; return a0_0x1e78(); } import a0_0x2eb452 from 'log'; class API { constructor(_0x45f5fa, _0x584b92 = '') { const _0x23df99 = a0_0x2714; this['cookies'] = a0_0x57dc04['getStorage']('cookies-' + _0x45f5fa, {}), this[_0x23df99(0x107)] = a0_0x57dc04[_0x23df99(0xf7)](_0x23df99(0xa5) + _0x45f5fa, 0x0), this[_0x23df99(0x121)] = '', this[_0x23df99(0xf4)] = _0x45f5fa, this[_0x23df99(0x11b)] = _0x584b92; } [a0_0x452df5(0xf5)] = async () => { const _0x35b396 = a0_0x452df5; !Object[_0x35b396(0x114)](this[_0x35b396(0xc6)])[_0x35b396(0xd5)] && (a0_0x2eb452[_0x35b396(0xc1)](_0x35b396(0xfb)), await this[_0x35b396(0xdd)]()), this[_0x35b396(0x107)] + 0x7 * 0x18 * 0xe10 * 0x3e8 <= new Date()['getTime']() && (a0_0x2eb452[_0x35b396(0xc1)]('自动登录\x20登录过期'), await this[_0x35b396(0xdd)]()); };[a0_0x452df5(0xdd)] = async () => { const _0x2e252e = a0_0x452df5; if (!this['username'] || !this[_0x2e252e(0x11b)]) return; const _0x2ba537 = await a0_0x4c1af4['get'](_0x2e252e(0xbf), { 'cx_xxt_passport': _0x2e252e(0xe2), 'roleSelect': _0x2e252e(0x117), 'uname': this['username'], 'code': this[_0x2e252e(0x11b)], 'loginType': '1' }); return Object[_0x2e252e(0x11f)](this[_0x2e252e(0xc6)], _0x2ba537['cookies']), a0_0x57dc04['setStorage']('cookies-' + this[_0x2e252e(0xf4)], this[_0x2e252e(0xc6)]), this[_0x2e252e(0x107)] = new Date()[_0x2e252e(0xe1)](), a0_0x57dc04[_0x2e252e(0xe9)](_0x2e252e(0xa5) + this[_0x2e252e(0xf4)], this[_0x2e252e(0x107)]), a0_0x2eb452['debug']('登录', _0x2ba537), await this[_0x2e252e(0xa9)](), _0x2ba537; };[a0_0x452df5(0xa9)] = async () => { const _0xca98b2 = a0_0x452df5; return await this[_0xca98b2(0xf5)](), this[_0xca98b2(0x121)] = this[_0xca98b2(0xc6)]['UID'] != undefined ? this[_0xca98b2(0xc6)][_0xca98b2(0xc5)] : this[_0xca98b2(0xc6)][_0xca98b2(0x119)], this['uid']; };['getCourse'] = async () => { const _0x3a801e = a0_0x452df5; await this[_0x3a801e(0xf5)](); const _0x3a8261 = 'https://mooc1-api.chaoxing.com/mycourse/backclazzdata', _0x130a6b = await a0_0x4c1af4[_0x3a801e(0x11a)](_0x3a8261, { 'view': 'json', 'rss': '1' }, this[_0x3a801e(0xc6)]); Object['assign'](this[_0x3a801e(0xc6)], _0x130a6b[_0x3a801e(0xc6)]); let _0x540f9a = _0x130a6b[_0x3a801e(0xcf)][_0x3a801e(0xcc)](_0x4e9c1a => _0x4e9c1a[_0x3a801e(0xfa)] == '课程')[_0x3a801e(0xcb)](_0x43ae4b => { const _0x443b76 = _0x3a801e; return { 'courseName': _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)] ? _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)][_0x443b76(0xd3)][0x0]?.[_0x443b76(0xb5)] : _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xb5)], 'className': _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)] ? _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xb5)] : _0x43ae4b[_0x443b76(0xb3)]['clazz'][0x0]?.[_0x443b76(0x116)], 'teacherName': _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)] ? _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)][_0x443b76(0xd3)][0x0]?.[_0x443b76(0xc3)] : _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xc3)], 'courseId': _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)] ? _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)]['data'][0x0]?.['id'] : _0x43ae4b['content']['id'], 'classId': _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)] ? _0x43ae4b[_0x443b76(0xd0)] : _0x43ae4b['content'][_0x443b76(0xff)][0x0]?.[_0x443b76(0xa7)], 'folder': (_0x130a6b['channelList'][_0x443b76(0x110)](_0x2e1451 => _0x2e1451[_0x443b76(0xb2)] == _0x43ae4b[_0x443b76(0xee)]) || {})[_0x443b76(0xb3)]?.[_0x443b76(0xc9)] || null, 'isTeach': !_0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)], 'img': _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)] ? _0x43ae4b[_0x443b76(0xb3)][_0x443b76(0xfe)][_0x443b76(0xd3)][0x0][_0x443b76(0xda)] : _0x43ae4b['content']['imageurl'] }; }); return _0x540f9a[_0x3a801e(0x10d)]((_0x29e943, _0x2a232d) => _0x2a232d[_0x3a801e(0xb0)] - _0x29e943['isShow']), a0_0x2eb452[_0x3a801e(0xc1)](_0x3a801e(0x100), _0x130a6b, _0x540f9a), _0x540f9a; };[a0_0x452df5(0xbc)] = async (_0x32df49, _0x87a63e) => { const _0x2ebc3e = a0_0x452df5; await this[_0x2ebc3e(0xf5)](); const _0x2a100f = a0_0x13519c[_0x2ebc3e(0xab)] + _0x2ebc3e(0xb6), _0x37f711 = await a0_0x4c1af4['get'](_0x2a100f, { 'fid': '0', 'courseId': _0x32df49, 'classId': _0x87a63e, 'showNotStartedActive': '0' }, this[_0x2ebc3e(0xc6)]); Object[_0x2ebc3e(0x11f)](this[_0x2ebc3e(0xc6)], _0x37f711['cookies']); const _0x569c07 = _0x37f711[_0x2ebc3e(0xd3)][_0x2ebc3e(0xa4)][_0x2ebc3e(0xcb)](_0x3fff72 => { const _0x24e8c0 = _0x2ebc3e; return { 'type': Number(_0x3fff72[_0x24e8c0(0xaa)]), 'name': _0x3fff72['nameOne'], 'time': _0x3fff72[_0x24e8c0(0x101)] ? _0x3fff72['nameFour'] : '无', 'startTime': _0x3fff72[_0x24e8c0(0x10f)], 'activeId': _0x3fff72['id'], 'courseId': _0x32df49, 'classId': _0x87a63e, 'img': _0x3fff72[_0x24e8c0(0xbe)], 'isExpire': _0x3fff72['endTime'] < new Date()[_0x24e8c0(0xe1)]() && _0x3fff72[_0x24e8c0(0xf1)] }; })[_0x2ebc3e(0xcc)](_0x47ad93 => 0x0 <= _0x47ad93['type'] && _0x47ad93[_0x2ebc3e(0xaf)] <= 0x5); return a0_0x2eb452['debug'](_0x2ebc3e(0xa8), _0x37f711, _0x569c07), _0x569c07; };[a0_0x452df5(0xe0)] = async _0x5cb122 => { const _0x56c541 = a0_0x452df5; await this['checkLogin'](); const _0x349f66 = a0_0x13519c[_0x56c541(0xab)] + _0x56c541(0x103), _0x562edf = await a0_0x4c1af4[_0x56c541(0x11a)](_0x349f66, { 'activeId': _0x5cb122 }, this[_0x56c541(0xc6)]); Object[_0x56c541(0x11f)](this[_0x56c541(0xc6)], _0x562edf['cookies']); const _0x1cd5b3 = _0x562edf[_0x56c541(0xd3)]; return a0_0x2eb452[_0x56c541(0xc1)](_0x56c541(0xa6), _0x562edf, _0x1cd5b3), _0x1cd5b3; };[a0_0x452df5(0xed)] = async (_0xac73de, _0x37aaf6, _0x1fef01) => { const _0x245e27 = a0_0x452df5; await this[_0x245e27(0xf5)](); const _0x1ae37d = a0_0x13519c[_0x245e27(0xab)] + _0x245e27(0xac), _0x49c87b = await a0_0x4c1af4['getText'](_0x1ae37d, { 'activePrimaryId': _0xac73de, 'courseId': _0x37aaf6, 'classId': _0x1fef01, 'uid': await this[_0x245e27(0xa9)](), 'appType': '15', 'general': '1', 'sys': '1', 'ls': '1', 'tid': '', 'ut': 's' }, this[_0x245e27(0xc6)]); return a0_0x2eb452[_0x245e27(0xc1)](_0x245e27(0xbb)), _0x49c87b; };[a0_0x452df5(0xea)] = async (_0x3001ea, _0x511f1f = null, _0x52841d = null, _0x174934 = null, _0x5f36c6 = null, _0x309b75 = null, _0xd281ad = null, _0x380772 = null, _0x19296b = null, _0x6b1935 = null) => { const _0x47819f = a0_0x452df5; await this[_0x47819f(0xf5)](); const _0xf8c3c1 = ['龙傲天', _0x47819f(0xf2), _0x47819f(0xba), _0x47819f(0x11d), _0x47819f(0x104), _0x47819f(0xb9)]; if (!_0x5f36c6) _0x5f36c6 = _0x47819f(0xce); const _0x28ccf3 = { 'activeId': _0x3001ea, 'objectId': _0x511f1f ? _0x511f1f : '', 'uid': await this[_0x47819f(0xa9)](), 'clientip': '', 'useragent': '', 'longitude': _0x52841d && !_0x380772 ? String(_0x52841d)[_0x47819f(0xe5)](0x0, 0xa) : -0x1, 'latitude': _0x174934 && !_0x380772 ? String(_0x174934)['substring'](0x0, 0xa) : -0x1, 'address': _0x5f36c6 && !_0x380772 ? _0x5f36c6 : '', 'location': JSON['stringify']({ 'result': 0x1, 'latitude': _0x174934, 'longitude': _0x52841d, 'address': _0x5f36c6 }), 'signCode': _0x309b75 ? _0x309b75 : '', 'role': _0xd281ad ? _0xd281ad : '', 'enc': _0x380772 ? _0x380772 : '', 'name': _0x19296b || _0xf8c3c1[Math[_0x47819f(0x10a)](Math[_0x47819f(0xc4)]() * _0xf8c3c1[_0x47819f(0xd5)])], 'appType': '15', 'ifTiJiao': '1', 'fid': '0', 'validate': _0x6b1935 ? _0x6b1935 : '', 'vpProbability': 0x0, 'vpStrategy': '' }, _0x436b0e = a0_0x13519c[_0x47819f(0xab)] + _0x47819f(0xd1), _0x3648e5 = await a0_0x4c1af4[_0x47819f(0xec)](_0x436b0e, _0x28ccf3, this[_0x47819f(0xc6)]); return a0_0x2eb452[_0x47819f(0xe8)](_0x47819f(0xf0), _0x3648e5, _0x28ccf3), _0x3648e5; };[a0_0x452df5(0x112)] = async (_0x174ae3, _0x9ab7b9) => { const _0x453d53 = a0_0x452df5; await this[_0x453d53(0xf5)](); const _0x56d798 = a0_0x13519c[_0x453d53(0xab)] + '/widget/sign/pcStuSignController/checkSignCode', _0xd9ab02 = await a0_0x4c1af4[_0x453d53(0x11a)](_0x56d798, { 'activeId': _0x174ae3, 'signCode': _0x9ab7b9 }, this[_0x453d53(0xc6)]); return a0_0x2eb452[_0x453d53(0xe8)](_0x453d53(0xad), _0xd9ab02), Boolean(_0xd9ab02[_0x453d53(0xd6)]); }; static [a0_0x452df5(0xd8)] = _0x237a84 => { const _0x4cd96e = a0_0x452df5; if (!_0x237a84) return null; else { if (_0x237a84 == _0x4cd96e(0x113)) return _0x4cd96e(0x105); else { if (_0x237a84 == _0x4cd96e(0x10b)) return _0x4cd96e(0xb8); else { if (_0x237a84[_0x4cd96e(0xae)](_0x4cd96e(0xf3))) return '滑块验证码,再试一次'; else { if (_0x237a84[_0x4cd96e(0xae)](_0x4cd96e(0xdb))) return '不在签到范围内'; else { if (_0x237a84['startsWith']('签到失败,请重新扫描')) return _0x4cd96e(0xe3); else { if (_0x237a84 == _0x4cd96e(0x115)) return _0x4cd96e(0xdf); else return _0x237a84; } } } } } } };['getToken'] = async () => { const _0x3ec227 = a0_0x452df5; await this['checkLogin'](); const _0x3486a6 = _0x3ec227(0x109), _0x4d9ad1 = await a0_0x4c1af4['get'](_0x3486a6, {}, this['cookies']); return _0x4d9ad1['_token']; };[a0_0x452df5(0xfc)] = async () => { const _0x13401a = a0_0x452df5; await this[_0x13401a(0xf5)](); const _0x1b9164 = _0x13401a(0xe7), _0x19c04d = await a0_0x4c1af4[_0x13401a(0x11a)](_0x1b9164, {}, this[_0x13401a(0xc6)]), _0x5e9998 = { 'name': _0x19c04d[_0x13401a(0xeb)][_0x13401a(0xb5)], 'dept': _0x19c04d[_0x13401a(0xeb)][_0x13401a(0xdc)], 'phone': _0x19c04d[_0x13401a(0xeb)][_0x13401a(0xef)], 'school': _0x19c04d['msg'][_0x13401a(0xd2)], 'uid': _0x19c04d[_0x13401a(0xeb)][_0x13401a(0x121)], 'sex': _0x19c04d[_0x13401a(0xeb)]['sex'] >= 0x0 ? ['女', '男'][_0x19c04d[_0x13401a(0xeb)][_0x13401a(0x10c)]] : '', 'unit': _0x19c04d['msg'][_0x13401a(0xb4)] }; return a0_0x2eb452['debug'](_0x13401a(0xf8), _0x19c04d, _0x5e9998), _0x5e9998; };['hasValidate'] = async _0x57c381 => { const _0x238fb0 = a0_0x452df5, _0x1daa7c = a0_0x13519c['baseUrl'] + _0x238fb0(0x11c), _0x15e448 = { 'DB_STRATEGY': _0x238fb0(0x10e), 'STRATEGY_PARA': _0x238fb0(0xf9), 'activeId': _0x57c381, 'puid': '' }, _0x4a1059 = await a0_0x4c1af4[_0x238fb0(0x11a)](_0x1daa7c, _0x15e448, this[_0x238fb0(0xc6)]); return Boolean(_0x4a1059[_0x238fb0(0xd6)]); };[a0_0x452df5(0x102)] = async (_0x2b67ce, _0x734fe8) => { const _0x8a2241 = a0_0x452df5, _0xb3f376 = _0x8a2241(0xf6) + token, _0x357c80 = await a0_0x57dc04['uploadFile'](_0xb3f376, _0x2b67ce, { 'puid': _0x734fe8 }); return a0_0x2eb452['debug'](_0x8a2241(0x118), _0x357c80), _0x357c80; }; static [a0_0x452df5(0xd7)] = async () => { return ''; }; static [a0_0x452df5(0xd9)] = async (_0x49f115 = null, _0x41a88d = null) => { const _0x139a33 = a0_0x452df5, _0x5cf50c = 'https://api.tianditu.gov.cn/geocoder', _0x707676 = await a0_0x4c1af4['get'](_0x5cf50c, { 'postStr': { 'lon': _0x49f115, 'lat': _0x41a88d }, 'type': _0x139a33(0xe6), 'tk': a0_0x13519c[_0x139a33(0xd4)] }, {}, 0xf * 0x3e8, ![]); return a0_0x2eb452[_0x139a33(0xe8)](_0x139a33(0xc2), _0x707676), _0x707676['result']['formatted_address']; }; static ['allToBaidu'] = async (_0x1bd233 = null, _0x1d17c3 = null, _0x18f01b = a0_0x452df5(0xc8), _0x4838c3 = a0_0x452df5(0xe4)) => { const _0x149d9e = a0_0x452df5, _0x46bb6e = ['wgs4', _0x149d9e(0x106), _0x149d9e(0xc8), null, _0x149d9e(0xe4)], _0x51b4d4 = _0x46bb6e[_0x149d9e(0x11e)](_0x18f01b) + 0x1, _0x4c26bd = _0x46bb6e['indexOf'](_0x4838c3) + 0x1; if (_0x51b4d4 <= 0x0 || _0x4c26bd <= 0x0) return; const _0x5a9257 = 'https://api.map.baidu.com/geoconv/v1/', _0x50d89a = { 'coords': _0x1bd233 + ',' + _0x1d17c3, 'from': _0x51b4d4, 'to': _0x4c26bd }, _0xf3439d = await a0_0x4c1af4['get'](_0x5a9257, { ..._0x50d89a, 'ak': a0_0x13519c[_0x149d9e(0x108)] }); return a0_0x2eb452[_0x149d9e(0xe8)](_0x149d9e(0xb7), _0xf3439d, _0x50d89a), _0xf3439d['result'][0x0]; }; } module['exports'] = API; |