Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
internal interface ApplyCryptoStateUseCase

Applies crypto state (MLS and Proteus keystores) from extracted backup files. This replaces the existing keystores with the ones from the backup and updates the database passphrases in storage.

Link copied to clipboard
internal class ApplyCryptoStateUseCaseImpl(userId: UserId, rootPathsProvider: RootPathsProvider, kaliumFileSystem: KaliumFileSystem, securityHelper: SecurityHelper, clientRepository: ClientRepository, eventRepository: EventRepository, dispatcher: KaliumDispatcher = KaliumDispatcherImpl) : ApplyCryptoStateUseCase
Link copied to clipboard
Link copied to clipboard

Creates a crypto state backup and uploads it to the remote endpoint.

Link copied to clipboard
internal class BackupAndUploadCryptoStateUseCaseImpl(backupCryptoDBUseCase: BackupCryptoDBUseCase, cryptoStateBackupRemoteRepository: CryptoStateBackupRemoteRepository, kaliumFileSystem: KaliumFileSystem, currentClientIdProvider: CurrentClientIdProvider, executionMutex: Mutex = Mutex()) : BackupAndUploadCryptoStateUseCase
Link copied to clipboard
internal object BackupConstants
Link copied to clipboard
sealed interface BackupCryptoDBResult
Link copied to clipboard

Performs the backup of the cryptographic database by exporting it, creating a metadata file, and packaging them into a ZIP file.

Link copied to clipboard
internal class BackupCryptoDBUseCaseImpl(userId: UserId, cryptoTransactionProvider: CryptoTransactionProvider, eventRepository: EventRepository, kaliumFileSystem: KaliumFileSystem, dispatchers: KaliumDispatcher = KaliumDispatcherImpl) : BackupCryptoDBUseCase
Link copied to clipboard
Link copied to clipboard
@Serializable
internal data class BackupMetadata(val platform: String, val version: String, val userId: String, val creationTime: String, val clientId: String?)
Link copied to clipboard
class BackupScope(userId: UserId, clientIdProvider: CurrentClientIdProvider, userRepository: UserRepository, clientRepository: ClientRepository, eventRepository: EventRepository, upgradeCurrentSession: UpgradeCurrentSessionUseCase, kaliumFileSystem: KaliumFileSystem, userStorage: UserStorage, cryptoTransactionProvider: CryptoTransactionProvider, val globalPreferences: GlobalPrefProvider, cryptoStateBackupRemoteRepository: CryptoStateBackupRemoteRepository, rootPathsProvider: RootPathsProvider)
Link copied to clipboard
sealed class CreateBackupResult
Link copied to clipboard
Link copied to clipboard
internal class CreateBackupUseCaseImpl(userId: UserId, clientIdProvider: CurrentClientIdProvider, userRepository: UserRepository, kaliumFileSystem: KaliumFileSystem, databaseExporter: DatabaseExporter, securityHelper: SecurityHelper, dispatchers: KaliumDispatcher = KaliumDispatcherImpl, idMapper: IdMapper = MapperProvider.idMapper()) : CreateBackupUseCase
Link copied to clipboard
Link copied to clipboard
internal class CreateMPBackupUseCaseImpl(backupRepository: BackupRepository, userRepository: UserRepository, kaliumFileSystem: KaliumFileSystem, fileSystem: FileSystem = FileSystem.SYSTEM, exporterProvider: MPBackupExporterProvider = MPBackupExporterProviderImpl(), dispatchers: KaliumDispatcher = KaliumDispatcherImpl) : CreateMPBackupUseCase
Link copied to clipboard
class CreateObfuscatedCopyUseCase(userId: UserId, clientIdProvider: CurrentClientIdProvider, userRepository: UserRepository, kaliumFileSystem: KaliumFileSystem, obfuscatedCopyExporter: ObfuscatedCopyExporter, dispatchers: KaliumDispatcher = KaliumDispatcherImpl, idMapper: IdMapper = MapperProvider.idMapper())

Creates an obfuscated copy of the user's data. TO BE USED FOR DEBUGGING PURPOSES ONLY.

Link copied to clipboard
@Serializable
data class CryptoStateBackupMetadata(val version: String, val clientId: String, val lastProcessedEventId: String, val mlsDbPassphrase: String, val proteusDbPassphrase: String)
Link copied to clipboard
Link copied to clipboard
internal interface DownloadCryptoStateUseCase

Downloads the crypto state backup from the remote endpoint.

Link copied to clipboard
internal class DownloadCryptoStateUseCaseImpl(userId: UserId, cryptoStateBackupRemoteRepository: CryptoStateBackupRemoteRepository, kaliumFileSystem: KaliumFileSystem, dispatchers: KaliumDispatcher = KaliumDispatcherImpl) : DownloadCryptoStateUseCase
Link copied to clipboard
Link copied to clipboard
internal interface ExtractCryptoStateUseCase

Extracts the crypto state backup from a downloaded zip file.

Link copied to clipboard
internal class ExtractCryptoStateUseCaseImpl(kaliumFileSystem: KaliumFileSystem, kaliumDispatcher: KaliumDispatcher = KaliumDispatcherImpl) : ExtractCryptoStateUseCase
Link copied to clipboard
class MultiPlatformBackupScope(selfUserId: UserId, kaliumFileSystem: KaliumFileSystem, backupRepository: BackupRepository, userRepository: UserRepository)
Link copied to clipboard
sealed class RestoreBackupResult
Link copied to clipboard
Link copied to clipboard
internal class RestoreBackupUseCaseImpl(databaseImporter: DatabaseImporter, kaliumFileSystem: KaliumFileSystem, userId: UserId, userRepository: UserRepository, currentClientIdProvider: CurrentClientIdProvider, dispatchers: KaliumDispatcher = KaliumDispatcherImpl, idMapper: IdMapper = MapperProvider.idMapper()) : RestoreBackupUseCase
Link copied to clipboard
sealed interface RestoreCryptoStateResult
Link copied to clipboard
Link copied to clipboard
internal class RestoreCryptoStateUseCaseImpl(downloadCryptoState: DownloadCryptoStateUseCase, extractCryptoState: ExtractCryptoStateUseCase, setLastDeviceId: SetLastDeviceIdUseCase, applyCryptoState: ApplyCryptoStateUseCase, clientRepository: ClientRepository, upgradeCurrentSession: UpgradeCurrentSessionUseCase) : RestoreCryptoStateUseCase
Link copied to clipboard
Link copied to clipboard
internal class RestoreMPBackupUseCaseImpl(selfUserId: UserId, backupRepository: BackupRepository, kaliumFileSystem: KaliumFileSystem, backupImporterProvider: MPBackupImporterProvider = MPBackupImporterProviderImpl(), dispatchers: KaliumDispatcher = KaliumDispatcherImpl, progressDispatcher: CoroutineDispatcher? = null) : RestoreMPBackupUseCase
Link copied to clipboard
Link copied to clipboard

Sets the last device ID used for crypto state backup on the remote server. This is used to track which device last uploaded the crypto state.

Link copied to clipboard
internal class SetLastDeviceIdUseCaseImpl(cryptoStateBackupRemoteRepository: CryptoStateBackupRemoteRepository) : SetLastDeviceIdUseCase
Link copied to clipboard
sealed class VerifyBackupResult
Link copied to clipboard
Link copied to clipboard
internal class VerifyBackupUseCaseImpl(userId: UserId, kaliumFileSystem: KaliumFileSystem, fileSystem: FileSystem = FileSystem.SYSTEM, backupImporterProvider: MPBackupImporterProvider = MPBackupImporterProviderImpl(fileSystem), dispatchers: KaliumDispatcher = KaliumDispatcherImpl) : VerifyBackupUseCase

Functions

Link copied to clipboard
internal fun BackupMetadata.isWebBackup(): Boolean