AppStateCloudBackupCoordinator

AppStateCloudBackup over an injected BackupStorage + a pre-derived AES key (SeedDerivedKeyDeriver.deriveAppStateBackupKey).

Pure logic — encrypt/decrypt the single app-state blob + a content-hash upload guard — so it's fully JVM-unit-testable with a fake storage + digest store. Unlike the manual AppStateBackup, this needs NO passkey assertion per call (the key is seed-derived), which is what makes automatic background backup possible.

Failure-tolerant by contract: fetchAppState returns null on any problem; uploadAppState is best-effort (callers wrap it in runCatching).

Constructors

Link copied to clipboard
constructor(storage: BackupStorage, encryptionKey: ByteArray, digestStore: AppStateBackupDigestStore)

Functions

Link copied to clipboard
open suspend override fun clear()
Link copied to clipboard
open suspend override fun fetchAppState(): ByteArray?
Link copied to clipboard
open suspend override fun uploadAppState(appMetadata: ByteArray)