feat: fix CompactSeedQR binary QR code scanning with jsQR library

- Replace BarcodeDetector with jsQR for raw binary byte access
- BarcodeDetector forced UTF-8 decoding which corrupted binary data
- jsQR's binaryData property preserves raw bytes without text conversion
- Fix regex bug: use single backslash \x00 instead of \x00 for binary detection
- Add debug logging for scan data inspection
- QR generation already worked (Krux-compatible), only scanning was broken

Resolves binary QR code scanning for 12/24-word CompactSeedQR format.
Tested with Krux device - full bidirectional compatibility confirmed.
This commit is contained in:
LC mac
2026-02-07 04:22:56 +08:00
parent 49d73a7ae4
commit aa06c9ae27
39 changed files with 4664 additions and 777 deletions

View File

@@ -21,7 +21,7 @@ export type KruxEncryptionParams = {
version?: number;
};
export type EncryptionMode = 'pgp' | 'krux' | 'text';
export type EncryptionMode = 'pgp' | 'krux' | 'seedqr' | 'text';
export type EncryptionParams = {
plaintext: SeedPgpPlaintext | string;
@@ -42,7 +42,7 @@ export type DecryptionParams = {
};
export type EncryptionResult = {
framed: string;
framed: string | Uint8Array;
pgpBytes?: Uint8Array;
recipientFingerprint?: string;
label?: string;