Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持小米手环6吗? #11

Open
foenix66 opened this issue Mar 6, 2022 · 2 comments
Open

支持小米手环6吗? #11

foenix66 opened this issue Mar 6, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@foenix66
Copy link

foenix66 commented Mar 6, 2022

我测试了小米手环6,Auth验证收到的返回码是100307
我用的是js测试
async authenticate() {
await this.startNotifications(this.chars.auth, async (e) => {
const value = e.target.value.buffer;
const cmd = buf2hex(value.slice(0, 3));
if (cmd === "100101") {
console.log("Set new key OK");
} else if (cmd === "100201") {
const number = value.slice(3);
console.log("Received authentication challenge: ", buf2hex(value.slice(3)));
const key = aesjs.utils.hex.toBytes(this.authKey);
const aesCbc = new aesjs.ModeOfOperation.cbc(key);
const out = aesCbc.encrypt(new Uint8Array(number));
const cmd2 = concatBuffers(new Uint8Array([3, 0]), out);
console.log("Sending authentication response");
await this.chars.auth.writeValue(cmd2);
} else if (cmd === "100301") {
await this.onAuthenticated();
} else if (cmd === "100308") {
console.log("Received authentication failure");
} else {
throw new Error(Unknown callback, cmd='${cmd}');
}
});
await this.chars.auth.writeValue(Uint8Array.from([2, 0]));
}

@wuhan005
Copy link
Owner

我是使用小米手环 6 NFC 版本测试的。

参考这个项目的返回码 https://github.com/satcar77/miband4/blob/master/miband.py#L29-L43 ,好像没有提到 100307,我也不太清楚这个返回码是什么。

@wuhan005 wuhan005 added the help wanted Extra attention is needed label Mar 18, 2022
@LanDaZhuang
Copy link

@foenix66 我和你一样使用了这个思路进行测试,收到的验证码也是100307,之后我怀疑是固件问题,将小米手环降级为1.0.1.36后在进行测试通过了验证。。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants