BackupStorage

interface BackupStorage

Storage-agnostic interface for encrypted backup blobs.

The encryption layer (PrfKeyDeriver + AppStateBackupEncryptor) is independent of storage. This interface allows swapping Google Block Store for Google Drive, a personal server, or even a QR code export.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun delete()

Delete the stored backup.

Link copied to clipboard
abstract suspend fun isAvailable(): Boolean

Whether the storage backend is available on this device.

Link copied to clipboard
abstract suspend fun retrieve(): ByteArray?

Retrieve the stored encrypted blob, or null if no backup exists.

Link copied to clipboard
abstract suspend fun store(encryptedBlob: ByteArray)

Store an encrypted blob. Overwrites any existing backup.