fix(ios): use security-scoped bookmarks for download directory persistence

- Switch iOS bookmark creation from .minimalBookmark to .withSecurityScope
- Add .withSecurityScope option when resolving bookmarks
- Add downloadDirectoryBookmark field to AppSettings for persisting iOS bookmarks
- Resolve bookmark and startAccessingIosBookmark before queue processing
- Guarantee stopAccessingIosBookmark cleanup via try/finally
- Create bookmark on folder pick in both setup screen and download settings
- Clear bookmark when switching to SAF mode or iOS path normalization
- Fix stale bottom sheet context usage (ctx -> context) in download settings
This commit is contained in:
zarzet
2026-05-02 01:19:39 +07:00
parent 64dbf4441c
commit 45fa33e1ec
7 changed files with 161 additions and 41 deletions
+3 -3
View File
@@ -1021,7 +1021,7 @@ import Gobackend // Import Go framework
let url = URL(fileURLWithPath: path)
do {
let bookmarkData = try url.bookmarkData(
options: .minimalBookmark,
options: .withSecurityScope,
includingResourceValuesForKeys: nil,
relativeTo: nil
)
@@ -1051,7 +1051,7 @@ import Gobackend // Import Go framework
do {
url = try URL(
resolvingBookmarkData: bookmarkData,
options: [],
options: .withSecurityScope,
relativeTo: nil,
bookmarkDataIsStale: &isStale
)
@@ -1086,7 +1086,7 @@ import Gobackend // Import Go framework
do {
url = try URL(
resolvingBookmarkData: bookmarkData,
options: [],
options: .withSecurityScope,
relativeTo: nil,
bookmarkDataIsStale: &isStale
)