core/disaster_recovery_save_export
library
Classes
-
DisasterRecoverySaveExport
-
Multi-slot disaster-recovery export/restore, composing 3 already-
shipped primitives rather than inventing new ones:
SaveSlotManager (which slots exist, and SaveSlotManager.keyFor's
per-slot key prefix), StorageService.exportWithPrefix/
StorageService.importWithPrefix (the actual data movement — whose
existing rollback-on-failure guarantee, see
storage_service.dart's
importAll, is exactly what makes applyRestore crash-safe: a
SharedPreferences write has no transaction primitive, so
importAll snapshots the WHOLE store first and re-applies that
snapshot if the replace throws, meaning a slot that never got reached
keeps its pre-restore data, and a slot whose own import failed
mid-way rolls back to what IT had before that one call, not a
half-written mix), and save_integrity.dart's HMAC sign/verify (the
same convention ReplayCapsule.exportSigned already uses).
-
RestoreLogEntry
-
One step of an DisasterRecoverySaveExport.applyRestore run — the
recovery log a crash/interruption mid-restore leaves behind, so
"which slots actually got restored before it broke" is answerable
afterward instead of guessed.
-
RestorePreview
-
A validated, NOT-YET-APPLIED export — DisasterRecoverySaveExport.previewRestore
returns this so a UI/support agent can review exactly what a backup
contains (slot names, when each was last played, how many keys) before
DisasterRecoverySaveExport.applyRestore ever touches real storage.
Building this never writes anything — see that method's own doc.
-
SlotExportEntry
-
One save slot's exported data — meta mirrors SaveSlotMeta (plain
fields, this class never holds a live reference to it), data is the
raw
StorageService.exportWithPrefix result for that slot's key
range.