We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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,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])); }
Unknown callback, cmd='${cmd}'
The text was updated successfully, but these errors were encountered:
我是使用小米手环 6 NFC 版本测试的。
参考这个项目的返回码 https://github.com/satcar77/miband4/blob/master/miband.py#L29-L43 ,好像没有提到 100307,我也不太清楚这个返回码是什么。
Sorry, something went wrong.
@foenix66 我和你一样使用了这个思路进行测试,收到的验证码也是100307,之后我怀疑是固件问题,将小米手环降级为1.0.1.36后在进行测试通过了验证。。。。
No branches or pull requests
我测试了小米手环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]));
}
The text was updated successfully, but these errors were encountered: