From 23e1d72ac05fa4b383791921a98654160b7f5785 Mon Sep 17 00:00:00 2001 From: k1ngsterr1 Date: Sat, 24 Jan 2026 17:59:13 +0500 Subject: [PATCH] fix: Update decryption key variable from myPrivateKey to privateKey in attachment functions --- .../messenger/ui/chats/components/AttachmentComponents.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/components/AttachmentComponents.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/components/AttachmentComponents.kt index cc59918..669fe50 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/components/AttachmentComponents.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/components/AttachmentComponents.kt @@ -194,7 +194,7 @@ fun ImageAttachment( // КРИТИЧНО: chachaKey ЗАШИФРОВАН в БД (как в Desktop) // Сначала расшифровываем его: Buffer.from(await decrypt(message.chacha_key, privatePlain), "binary").toString('utf-8') - val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, myPrivateKey) + val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, privateKey) val decryptKeyString = String(decryptedKeyAndNonce, Charsets.UTF_8) Log.d(TAG, "🔑 Decrypted chacha_key: ${decryptKeyString.length} chars") @@ -397,7 +397,7 @@ fun FileAttachment( // КРИТИЧНО: chachaKey ЗАШИФРОВАН в БД (как в Desktop) // Сначала расшифровываем его - val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, myPrivateKey) + val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, privateKey) val decryptKeyString = String(decryptedKeyAndNonce, Charsets.UTF_8) val decrypted = MessageCrypto.decryptAttachmentBlobWithPassword( @@ -592,7 +592,7 @@ fun AvatarAttachment( // КРИТИЧНО: chachaKey ЗАШИФРОВАН в БД (как в Desktop) // Сначала расшифровываем его - val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, myPrivateKey) + val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, privateKey) val decryptKeyString = String(decryptedKeyAndNonce, Charsets.UTF_8) val decrypted = MessageCrypto.decryptAttachmentBlobWithPassword(