Commit Graph

9 Commits

Author SHA1 Message Date
Davide De Rosa 85129f17af Prefix store keys with "Passepartout." domain
Also remove stale preferences from early betas after migrating
relevant ones.

Extend KeyValueStore with removeValue() for this purpose.
2022-06-19 13:33:49 +02:00
Davide De Rosa 14b42fbea5 Persist managers state to generic key-value store
Move all persisted state out of AppManager to where it really
belongs. To do that, inject a shared KeyValueStore object into
managers that need to persist part of their state in a strongly
typed manner.

Below are persisted states:

- PersistenceManager
    - persistenceAuthor

- ProfileManager
    - activeProfileId

- UpgradeManager (formerly AppManager)
    - didMigrateToV2 (migrate former value)

- VPNManager
    - tunnelLogFormat
    - masksPrivateData

A similar approach is used for app-specific preferences, by using
a strongly typed enum (AppPreference) together with SwiftUI
@AppStorage property wrapper.

Worth moving logging logic into a specific LogManager.

Finally, drop any former view dependency on AppManager, as states
are now accessed through specific managers.
2022-06-16 13:42:37 +02:00
Davide De Rosa 4455f66d10 Detect TestFlight on macOS
Move function to Utils.
2022-05-18 11:16:31 +02:00
Davide De Rosa 05f3457249 Fix some Mac specific code in Core
- Improve network conditionals in on-demand rules

- Restore native version of DebugLog

- Restore correct code to fetch current SSID
2022-05-17 12:24:28 +02:00
Davide De Rosa 7196aeab0d Trust Ethernet on Mac 2022-05-16 11:19:33 +02:00
Davide De Rosa 35ec73570e Use NEHotspotNetwork to fetch current SSID
Old method did not work on Catalyst.
2022-05-15 22:24:36 +02:00
Davide De Rosa cca2dca047 Export providers database in beta 2022-05-05 09:46:12 +02:00
Davide De Rosa f1aa192c9c Make App/Core iOS/Catalyst only
- Drop macOS target from Package.swift

- Drop @available attributes
    - UI idiom
    - Intents API
    - Swipe actions in ProviderLocationView

- Review os(iOS)
    - DebugLog, append idiom to tell Mac from iPad

- Drop redundant canImport
2022-04-19 15:56:41 +02:00
Davide De Rosa 4aba5f46aa Rewrite app in SwiftUI 2022-04-12 15:12:45 +02:00