android: prevent imported archive from being written outside the export folder

This commit is contained in:
spaced4ndy
2026-08-14 17:24:28 +04:00
parent 6fcfbd54c5
commit 89d88621f2
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -345,7 +345,7 @@ class ArchiveConfig(
### Import Flow
1. User selects an archive file.
2. UI copies it to a temp location and constructs an `ArchiveConfig`.
2. UI copies it into `databaseExportDir` and constructs an `ArchiveConfig`. The destination is confined to that folder: `getFileName` returns a bare file name on every platform, and `saveArchiveFromURI` checks the canonical destination before copying.
3. Calls `apiImportArchive(config)` which sends `CC.ApiImportArchive` to the Haskell core.
4. The core extracts and replaces both databases.
5. Returns `CR.ArchiveImported` with a list of `ArchiveError` (non-fatal issues during import).