fix(blender): improve QR content detection

Fixes a bug where plain text mnemonics and Krux QR codes were being misidentified as encrypted SeedPGP frames.

- The `detectEncryptionMode` function has been rewritten to be stricter and now correctly identifies 'text' as a type.
- It no longer defaults to 'pgp', which was causing plain text to be treated as an encrypted format.
- The `EncryptionMode` type in `types.ts` has been updated to include 'text'.
- This resolves issues where the UI would incorrectly ask for a password for plain text mnemonics and use the wrong decryption logic for Krux QRs.
This commit is contained in:
LC mac
2026-02-04 13:10:12 +08:00
parent c2aeb4ce83
commit 48e8acbe32
2 changed files with 15 additions and 21 deletions

View File

@@ -20,7 +20,7 @@ export type KruxEncryptionParams = {
version?: number;
};
export type EncryptionMode = 'pgp' | 'krux';
export type EncryptionMode = 'pgp' | 'krux' | 'text';
export type EncryptionParams = {
plaintext: SeedPgpPlaintext | string;