feat: Implement secure database operations and caching for encrypted accounts

This commit is contained in:
k1ngsterr1
2026-01-09 01:09:40 +05:00
parent 4adbbd095d
commit 2f77c16484
7 changed files with 523 additions and 105 deletions

View File

@@ -0,0 +1,38 @@
package com.rosetta.messenger.database
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
/**
* Зашифрованный аккаунт в базе данных
* Соответствует структуре из React Native приложения
*/
@Entity(
tableName = "encrypted_accounts",
indices = [Index(value = ["public_key"], unique = true)]
)
data class EncryptedAccountEntity(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "id")
val id: Long = 0,
@ColumnInfo(name = "public_key")
val publicKey: String,
@ColumnInfo(name = "private_key_encrypted")
val privateKeyEncrypted: String,
@ColumnInfo(name = "seed_phrase_encrypted")
val seedPhraseEncrypted: String,
@ColumnInfo(name = "created_at")
val createdAt: String,
@ColumnInfo(name = "last_used")
val lastUsed: String? = null,
@ColumnInfo(name = "is_active")
val isActive: Boolean = true
)