[JavaScript] 纯文本查看 复制代码
"use strict";
var accessToken, userId, phone, pw;
var steps = 9999;//设置步数
var code = ['http://we.qq.com/d/AQC7PnaOelOaCg9Ux8c9Ew95yumTVfMcFuGCHMY-', 'http://we.qq.com/d/AQC7PnaOysMBFUhD6sByjYwH2MT12Jf2rqr2kFKm', 'http://we.qq.com/d/AQC7PnaOEcpmVUpHtrZBmRUVq4wOOgKw-gfh6wPj', 'http://we.qq.com/d/AQC7PnaOuG5SHierDiEH2AdZLzMt3W__GL8E1MJj', 'http://we.qq.com/d/AQC7PnaOC0S07XFU-c_R1cpxY1mtf8oiXiDrXET7', 'http://we.qq.com/d/AQC7PnaOoraxuZEdkFyVSO6gaTvMjzEzhEfLRXbE', 'http://we.qq.com/d/AQC7PnaOhQxO8K2EuU44QBZ8cRzB2ofP-oFJSU_6', 'http://we.qq.com/d/AQC7PnaOmwgxedHWCLVr-ZyeoLxHtRrHBGDuyH9E', 'ttp://we.qq.com/d/AQC7PnaO4am4196RIo98NYn_vPfHN-Y5j-w9FmSN', 'http://we.qq.com/d/AQC7PnaO2WczbXNLV7PzC7V60i7-iOgLha5Bg4cV', 'http://we.qq.com/d/AQC7PnaOZAUJTMxJ6-gbdrWV6y-jHHofCYFl-Jv0'];
start(手机号1, "密码1");
start(手机号2, "密码2");
function start(e, t) {
phone = e, pw = t;
var s = storages.create("lx");
//获取token
if (s.get(phone+"accessToken")) accessToken = s.get(phone+"accessToken"), userId = s.get(phone+"userId");
else login();
//开刷
bind();
step(steps);
}
function login() {
phone && pw || (toast("检查手机号和密码"), exit());
var e = {
password: md5(pw),
clientId: md5(phone),
appType: 6,
loginName: phone,
roleType: 0
}, n = http.postJson("https://sports.lifesense.com/sessions_service/login?systemType=2&version=4.6.7", e, {
headers: {
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 9; SM-G9500 Build/PPR1.180610.011)"
}
}), t = n.body.string(); t = JSON.parse(t), console.log(t);
if (t.data && t.data.accessToken) {
accessToken = t.data.accessToken, userId = t.data.userId;
var s = storages.create("lx");//缓存token
s.put(phone+"accessToken", accessToken), s.put(phone+"userId", userId);
} else toast("accessToken获取失败"), exit();
}
function bind() {
code.length == 0 && toastLog('设备码用光了!') && exit();
var t = {
"qrcode": code[code.length-1],//结合.pop()取最后一个值
"userId": userId
},
s = http.postJson("https://sports.lifesense.com/device_service/device_user/bind", t, {
headers: {
Cookie: "accessToken=" + accessToken,
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 9; SM-G9500 Build/PPR1.180610.011)"
}
}),
n = s.body.string();
n = JSON.parse(n), console.log(n);
if (n.code == 401) {
toast('token失效,即将自动重登');
login(), bind(); //token失效自动重登,注意可能的死循环
}
else if(n.code == 22301) {
code.pop();//删除失败code,多号共用code数组
bind();//继续绑定
}
else if(n.code == 1504){
toast('你已绑定4台设备....直接开刷');
}
else if(n.msg == "成功"){
toast(phone + '绑定成功,即将开刷');
}
else toast('不知道啥错误,自己看日志') && exit();
//sleep(999); //不看提示了直接开刷
}
function step(e) {
var t = {
list: [ {
calories: e / 30,
deviceId: "M_NULL",
distance: e / 2,
measurementTime: YMDH(),
step: e,
userId: userId,
} ]
}, s = http.postJson("https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?version=4.5&systemType=2", t, {
headers: {
Cookie: "accessToken=" + accessToken,
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 9; SM-G9500 Build/PPR1.180610.011)"
}
}), n = s.body.string();
n = JSON.parse(n), console.log(n);
if(n.code == 401){
toast('token失效,即将自动重登');
login(); step(steps);//token失效自动重登,注意可能的死循环
}else{
n.msg == "成功" && (n.msg = 0 === n.data.pedometerRecordHourlyList.length ? "刷的太早了" : '已刷'+n.data.pedometerRecordHourlyList[0].step.split(',')[new Date().getHours()]);
console.log(n.data.pedometerRecordHourlyList);
toast(phone+n.msg);
}
sleep(2333);
}
function YMDH() {
var e = new Date(), t = e.getMonth() + 1, s = e.getDate(), n = e.getHours(), o = e.getMinutes(), r = e.getSeconds();
return e.getFullYear() + "-" + (t < 10 ? "0" + t : t) + "-" + (s < 10 ? "0" + s : s) + " " + (n < 10 ? "0" + n : n) + ":" + (o < 10 ? "0" + o : o) + ":" + (r < 10 ? "0" + r : r);
}
function md5(e) {
return function(e) {
for (var t = "0123456789abcdef", s = "", n = 0; n < 4 * e.length; n++) s += t.charAt(e[n >> 2] >> n % 4 * 8 + 4 & 15) + t.charAt(e[n >> 2] >> n % 4 * 8 & 15);
return s;
}(function(e, t) {
function s(e, t, s, n, o, r) {
return c(i(c(c(t, e), c(n, r)), o), s);
}
function n(e, t, n, o, r, a, c) {
return s(t & n | ~t & o, e, t, r, a, c);
}
function o(e, t, n, o, r, a, c) {
return s(t & o | n & ~o, e, t, r, a, c);
}
function r(e, t, n, o, r, a, c) {
return s(t ^ n ^ o, e, t, r, a, c);
}
function a(e, t, n, o, r, a, c) {
return s(n ^ (t | ~o), e, t, r, a, c);
}
function c(e, t) {
var s = (65535 & e) + (65535 & t);
return (e >> 16) + (t >> 16) + (s >> 16) << 16 | 65535 & s;
}
function i(e, t) {
return e << t | e >>> 32 - t;
}
e[t >> 5] |= 128 << t % 32, e[14 + (t + 64 >>> 9 << 4)] = t;
for (var u = 1732584193, p = -271733879, d = -1732584194, l = 271733878, g = 0; g < e.length; g += 16) {
var h = u, f = p, m = d, v = l;
u = n(u, p, d, l, e[g + 0], 7, -680876936), l = n(l, u, p, d, e[g + 1], 12, -389564586),
d = n(d, l, u, p, e[g + 2], 17, 606105819), p = n(p, d, l, u, e[g + 3], 22, -1044525330),
u = n(u, p, d, l, e[g + 4], 7, -176418897), l = n(l, u, p, d, e[g + 5], 12, 1200080426),
d = n(d, l, u, p, e[g + 6], 17, -1473231341), p = n(p, d, l, u, e[g + 7], 22, -45705983),
u = n(u, p, d, l, e[g + 8], 7, 1770035416), l = n(l, u, p, d, e[g + 9], 12, -1958414417),
d = n(d, l, u, p, e[g + 10], 17, -42063), p = n(p, d, l, u, e[g + 11], 22, -1990404162),
u = n(u, p, d, l, e[g + 12], 7, 1804603682), l = n(l, u, p, d, e[g + 13], 12, -40341101),
d = n(d, l, u, p, e[g + 14], 17, -1502002290), p = n(p, d, l, u, e[g + 15], 22, 1236535329),
u = o(u, p, d, l, e[g + 1], 5, -165796510), l = o(l, u, p, d, e[g + 6], 9, -1069501632),
d = o(d, l, u, p, e[g + 11], 14, 643717713), p = o(p, d, l, u, e[g + 0], 20, -373897302),
u = o(u, p, d, l, e[g + 5], 5, -701558691), l = o(l, u, p, d, e[g + 10], 9, 38016083),
d = o(d, l, u, p, e[g + 15], 14, -660478335), p = o(p, d, l, u, e[g + 4], 20, -405537848),
u = o(u, p, d, l, e[g + 9], 5, 568446438), l = o(l, u, p, d, e[g + 14], 9, -1019803690),
d = o(d, l, u, p, e[g + 3], 14, -187363961), p = o(p, d, l, u, e[g + 8], 20, 1163531501),
u = o(u, p, d, l, e[g + 13], 5, -1444681467), l = o(l, u, p, d, e[g + 2], 9, -51403784),
d = o(d, l, u, p, e[g + 7], 14, 1735328473), p = o(p, d, l, u, e[g + 12], 20, -1926607734),
u = r(u, p, d, l, e[g + 5], 4, -378558), l = r(l, u, p, d, e[g + 8], 11, -2022574463),
d = r(d, l, u, p, e[g + 11], 16, 1839030562), p = r(p, d, l, u, e[g + 14], 23, -35309556),
u = r(u, p, d, l, e[g + 1], 4, -1530992060), l = r(l, u, p, d, e[g + 4], 11, 1272893353),
d = r(d, l, u, p, e[g + 7], 16, -155497632), p = r(p, d, l, u, e[g + 10], 23, -1094730640),
u = r(u, p, d, l, e[g + 13], 4, 681279174), l = r(l, u, p, d, e[g + 0], 11, -358537222),
d = r(d, l, u, p, e[g + 3], 16, -722521979), p = r(p, d, l, u, e[g + 6], 23, 76029189),
u = r(u, p, d, l, e[g + 9], 4, -640364487), l = r(l, u, p, d, e[g + 12], 11, -421815835),
d = r(d, l, u, p, e[g + 15], 16, 530742520), p = r(p, d, l, u, e[g + 2], 23, -995338651),
u = a(u, p, d, l, e[g + 0], 6, -198630844), l = a(l, u, p, d, e[g + 7], 10, 1126891415),
d = a(d, l, u, p, e[g + 14], 15, -1416354905), p = a(p, d, l, u, e[g + 5], 21, -57434055),
u = a(u, p, d, l, e[g + 12], 6, 1700485571), l = a(l, u, p, d, e[g + 3], 10, -1894986606),
d = a(d, l, u, p, e[g + 10], 15, -1051523), p = a(p, d, l, u, e[g + 1], 21, -2054922799),
u = a(u, p, d, l, e[g + 8], 6, 1873313359), l = a(l, u, p, d, e[g + 15], 10, -30611744),
d = a(d, l, u, p, e[g + 6], 15, -1560198380), p = a(p, d, l, u, e[g + 13], 21, 1309151649),
u = a(u, p, d, l, e[g + 4], 6, -145523070), l = a(l, u, p, d, e[g + 11], 10, -1120210379),
d = a(d, l, u, p, e[g + 2], 15, 718787259), p = a(p, d, l, u, e[g + 9], 21, -343485551),
u = c(u, h), p = c(p, f), d = c(d, m), l = c(l, v);
}
return Array(u, p, d, l);
}(function(e) {
for (var t = Array(), s = 0; s < 8 * e.length; s += 8) t[s >> 5] |= (255 & e.charCodeAt(s / 8)) << s % 32;
return t;
}(e), 8 * e.length));
}