mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
fix: qr code size validation
This commit is contained in:
parent
ed33993a42
commit
75e2444541
3 changed files with 10 additions and 4 deletions
|
|
@ -72,7 +72,14 @@ export default function SubmitForm() {
|
|||
const decode = async () => {
|
||||
setError("");
|
||||
|
||||
// Decrypt the QR code
|
||||
// Validate QR code size
|
||||
if (qrBytesRaw.length !== 372) {
|
||||
setError("QR code size is not a valid Tomodachi Life QR code");
|
||||
return;
|
||||
}
|
||||
|
||||
// Decrypt the Mii part of the QR code
|
||||
// (Credits to kazuki-4ys)
|
||||
const nonce = qrBytes.subarray(0, 8);
|
||||
const content = qrBytes.subarray(8, 0x70);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue