Skip to content

Commit

Permalink
✨ 修复 lenovo
Browse files Browse the repository at this point in the history
  • Loading branch information
Oreomeow committed Oct 15, 2022
1 parent d38b912 commit 4b22c6b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ cp /ql/repo/OreosLab_checkinpanel_master/notify.sample.toml /ql/config/notify.to

### 测试情况

| 状态 | 名称 |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|| 国内加速 \| Hax 监控 \| LeetCode 每日一题 \| 每日一句 \| 天气预报 \| 每日新闻 \| RSS 订阅 \| 机场签到 \| 爱企查 \| 百度搜索资源平台 \| Bilibili \| Bilibili 助手 \| CCAVA \| 天翼云盘 \| CSDN \| 网易蜗牛读书 \| 多看阅读 \| 恩山论坛 \| EUserv \| 时光相册 \| Fa米家 \| FreeNom \| GLaDOS \| 网易云游戏 \| HiFiNi \| 葫芦侠 \| HOSTLOC \| JSON5toTOML 工具 \| 掘金 \| 全民K歌 \| MEIZU 社区 \| 小米运动 \| NGA \| 一加手机社区官方论坛 \| 吾爱破解 \| Site \| 什么值得买 \| 什么值得买任务版 \| SSPanel 签到 \| 百度贴吧 \| 在线工具 \| V2EX \| 微博 \| WPS \| 王者营地 \| 有道云笔记 |
|| 哔咔漫画 \| 哔咔网单 \| 智友邦 |
|| 联想商城 |
| 状态 | 名称 |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|| 国内加速 \| Hax 监控 \| LeetCode 每日一题 \| 每日一句 \| 天气预报 \| 每日新闻 \| RSS 订阅 \| 机场签到 \| 爱企查 \| 百度搜索资源平台 \| Bilibili \| Bilibili 助手 \| CCAVA \| 天翼云盘 \| CSDN \| 网易蜗牛读书 \| 多看阅读 \| 恩山论坛 \| EUserv \| 时光相册 \| Fa米家 \| FreeNom \| GLaDOS \| 网易云游戏 \| HiFiNi \| 葫芦侠 \| HOSTLOC \| JSON5toTOML 工具 \| 掘金 \| 全民K歌 \| 联想商城 \| MEIZU 社区 \| 小米运动 \| NGA \| 一加手机社区官方论坛 \| 吾爱破解 \| Site \| 什么值得买 \| 什么值得买任务版 \| SSPanel 签到 \| 百度贴吧 \| 在线工具 \| V2EX \| 微博 \| WPS \| 王者营地 \| 有道云笔记 |
|| 哔咔漫画 \| 哔咔网单 \| 智友邦 |
|| |

## 致谢

Expand Down
30 changes: 25 additions & 5 deletions ck_lenovo.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const ACCOUNTS_LENOVO = getData().LENOVO;

const url = {
login: '',
session:
'https://api.club.lenovo.cn/users/getSessionID?s=8091b7729079682e9a58f609035619625b984e3a2d2b229caf45c7108b37221864b1cd92353716a721f8a240b455740951002d5cdfe3bd723c6e5a35f7bd6f2ffa955e1edf92d0a82274805efb604d602ac2900470589637e65903b9c136e458d6e6c581433bdc857f10fba9e615e3fea1ddb98a2cd86f1a828c03630c96155f3bda0b12c963868f80fc791fab1edcc1dda8a25c5722e5ec521b6050605e0da191edcfabf3d3d5412391dc77cd7ddbda89cb1abf4a0e6da165394d96b546a578c2577df88d04f6cb55d37ed4bcda03c9844a728dedc1c09558e3d08a4c2c89281ca2500ee5d9a67bd66edc6866e86114d6f2e447efbfad104461c0f75be2d9461047434315e57febbae78a30500f27ae25b3ea33a7dc50c16a50fa7fa900ca0a',
session: 'https://api.club.lenovo.cn/users/getSessionID',
sign1: 'https://api.club.lenovo.cn/common/signin/add',
sign2: 'https://api.club.lenovo.cn/signin/v2/add',
};
Expand All @@ -29,6 +28,10 @@ const headers = {
token: '',
//"User-Agent":"Apache-HttpClient/UNAVAILABLE (java 1.5)",
Authorization: '',
itemid: '1',
sversion: '0',
'X-Lenovo-APPID': '1',
versionCode: '1000082',
};

var desp = '';
Expand Down Expand Up @@ -69,7 +72,7 @@ function lxlogin(deviceid, info, password) {
try {
let data = `lang=zh-CN-%23Hans&source=android%3Acom.lenovo.club.app-V4.2.5&deviceidtype=mac&deviceid=${deviceid}&devicecategory=unknown&devicevendor=${info.phoneManufacturer}&devicefamily=unknown&devicemodel=${info.phoneModel}&osversion=${info.systemVersion}&osname=Android&password=${password}`;
let res = await axios.post(url['login'], data);
var lpsutgt = res.data.match(/<Value>(.+?)<\/Value>/);
let lpsutgt = res.data.match(/<Value>(.+?)<\/Value>/);
if (lpsutgt) {
let res2 = await axios.get(
`https://uss.lenovomm.com/authen/1.2/st/get?lpsutgt=${lpsutgt[1]}&source=ios%3Alenovo%3Aclub%3A4.1.0&lang=zh-CN&realm=club.lenovo.com.cn`
Expand All @@ -78,12 +81,13 @@ function lxlogin(deviceid, info, password) {
lpsutgt = lpsutgt2 ? lpsutgt2[1] : null;
}
Log('登录成功!');
resolve(lpsutgt);
// 预约游戏id
} catch (err) {
lpsutgt = null;
Log(`登录失败!${err.response}`);
}
resolve(lpsutgt);
resolve();
});
}

Expand All @@ -92,6 +96,8 @@ function getsession(lpsutgt) {
try {
headers.Authorization = 'Lenovosso ' + lpsutgt;
headers['token'] = headers.Authorization + '==';
let s = aesEncrypto(`{"sessionid":"Lenovosso ${lpsutgt}","time":"${new Date().getTime()}"}`);
url['session'] += `?s=${s}`;
let res3 = await axios.get(url['session'], {
headers,
});
Expand All @@ -114,7 +120,10 @@ function addsign(session, deviceid) {
headers.Authorization = 'Lenovo ' + session.sessionid;
headers['token'] = session.token + '==';
headers['User-Agent'] = 'Apache-HttpClient/UNAVAILABLE (java 1.5)';
let data = `imei=${deviceid}&uid=${session.lenovoid}`;
headers['Content-Type'] = 'text/json';
let data = aesEncrypto(
`{"uid":"${session.lenovoid}","imei":"${deviceid}","source":"0","sessionid":"Lenovo ${session.sessionid}","time":"${new Date().getTime()}"}`
);
let res = await axios.post(url['sign2'], data, {
headers,
});
Expand All @@ -133,6 +142,17 @@ function addsign(session, deviceid) {
});
}

function aesEncrypto(text) {
let key = CryptoJS.enc.Utf8.parse('nihao_liu#zh*9@7');
let iv = CryptoJS.enc.Utf8.parse('A*8@Stii_jin)*%6');
let encrypto = CryptoJS.AES.encrypt(text, key, {
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
});
return encrypto.ciphertext.toString();
}

function Log(info) {
console.log(info);
desp = desp + info + '\n';
Expand Down
2 changes: 1 addition & 1 deletion utils_ver.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import requests

__version__ = "20221015-4-021"
__version__ = "20221015-4-121"
ver_re = re.compile("__version__ = .(\\d+-\\d+-...).")


Expand Down

0 comments on commit 4b22c6b

Please sign in to comment.