Do some code clean up

- Use guard in validators

- Rename URL.openURL() to URL.open()

- Sort imports (SwiftLint)

- Drop unused VPNProtocolType.allTypes

- Drop unused imports
This commit is contained in:
Davide De Rosa 2023-04-04 09:50:45 +02:00
parent 1051a8dc52
commit b4ad8dea0d
163 changed files with 195 additions and 241 deletions

View File

@ -5,6 +5,8 @@ included:
analyzer_rules:
- unused_declaration
- unused_import
opt_in_rules:
- sorted_imports
disabled_rules:
- cyclomatic_complexity
- file_length

View File

@ -24,8 +24,8 @@
//
import Foundation
import UIKit
import PassepartoutLibrary
import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate, ObservableObject {
private let mac = MacBundle.shared

View File

@ -24,8 +24,8 @@
//
import Foundation
import UniformTypeIdentifiers
import SwiftyBeaver
import UniformTypeIdentifiers
extension Constants {
enum App {

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import LocalAuthentication
import PassepartoutLibrary
import SwiftUI
extension View {
var themeIdiom: UIUserInterfaceIdiom {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
import PassepartoutLibrary
@MainActor

View File

@ -24,8 +24,8 @@
//
import Foundation
import StoreKit
import PassepartoutLibrary
import StoreKit
struct LocalProduct: RawRepresentable, Equatable, Hashable {
private static let bundleSubdomain = "ios"

View File

@ -23,11 +23,11 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Combine
import Foundation
import Kvitto
import PassepartoutLibrary
import StoreKit
import Kvitto
import Combine
enum ProductError: Error {
case uneligible

View File

@ -23,10 +23,10 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Combine
import Foundation
import Intents
import IntentsUI
import Combine
import PassepartoutLibrary
@MainActor

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Combine
import Foundation
import PassepartoutLibrary
import Combine
class DefaultLightProfile: LightProfile {
let id: UUID

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
import PassepartoutLibrary
class DefaultLightProviderCategory: LightProviderCategory {

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Combine
import Foundation
import PassepartoutLibrary
import Combine
class DefaultLightVPNManager: LightVPNManager {
private let vpnManager = VPNManager.shared

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
@main
struct PassepartoutApp: App {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import UIKit
import SwiftUI
import UIKit
struct ActivityView: UIViewControllerRepresentable {
let activityItems: [Any]

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import Intents
import IntentsUI
import SwiftUI
struct IntentAddView: UIViewControllerRepresentable {
let shortcut: INShortcut

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import Intents
import IntentsUI
import SwiftUI
struct IntentEditView: UIViewControllerRepresentable {
let shortcut: Shortcut

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import MessageUI
import SwiftUI
struct MailComposerView: UIViewControllerRepresentable {
class Coordinator: NSObject, MFMailComposeViewControllerDelegate {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import UIKit
import StoreKit
import UIKit
public class Reviewer: ObservableObject {
private struct Keys {

View File

@ -61,13 +61,12 @@ struct Validators {
var sin = sockaddr_in()
var sin6 = sockaddr_in6()
if string.withCString({ cstring in inet_pton(AF_INET6, cstring, &sin6.sin6_addr) }) == 1 {
return
guard string.withCString({ cstring in inet_pton(AF_INET6, cstring, &sin6.sin6_addr) }) == 1 else {
throw ValidationError.ipAddress
}
if string.withCString({ cstring in inet_pton(AF_INET, cstring, &sin.sin_addr) }) == 1 {
return
throw ValidationError.ipAddress
}
throw ValidationError.ipAddress
}
static func domainName(_ string: String) throws {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
enum ShortcutType: String {
case enableVPN

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func sceneDidEnterBackground(_ scene: UIScene) {

View File

@ -73,7 +73,7 @@ struct AboutView: View {
private var supportSection: some View {
Section {
Button(L10n.About.Items.JoinCommunity.caption) {
URL.openURL(redditURL)
URL.open(redditURL)
}
Button(L10n.About.Items.ShareTwitter.caption, action: shareOnTwitter)
Button(L10n.About.Items.WriteReview.caption, action: submitReview)
@ -85,16 +85,16 @@ struct AboutView: View {
private var webSection: some View {
Section {
Button(L10n.About.Items.Website.caption) {
URL.openURL(homeURL)
URL.open(homeURL)
}
Button(Unlocalized.About.faq) {
URL.openURL(faqURL)
URL.open(faqURL)
}
Button(L10n.About.Items.Disclaimer.caption) {
URL.openURL(disclaimerURL)
URL.open(disclaimerURL)
}
Button(L10n.About.Items.PrivacyPolicy.caption) {
URL.openURL(privacyURL)
URL.open(privacyURL)
}
} header: {
Text(L10n.About.Sections.Web.header)
@ -104,10 +104,10 @@ struct AboutView: View {
private var githubSection: some View {
Section {
Button(Unlocalized.About.readme) {
URL.openURL(readmeURL)
URL.open(readmeURL)
}
Button(Unlocalized.About.changelog) {
URL.openURL(changelogURL)
URL.open(changelogURL)
}
} header: {
Text(Unlocalized.About.github)
@ -118,11 +118,11 @@ struct AboutView: View {
extension AboutView {
private func shareOnTwitter() {
let url = Unlocalized.Social.twitterIntent(withMessage: shareMessage)
URL.openURL(url)
URL.open(url)
}
private func submitReview() {
let reviewURL = Reviewer.urlForReview(withAppId: Constants.App.appStoreId)
URL.openURL(reviewURL)
URL.open(reviewURL)
}
}

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct AccountView: View {
@ObservedObject private var providerManager: ProviderManager
@ -116,7 +116,7 @@ struct AccountView: View {
}
private func openGuidanceURL(_ url: URL) {
URL.openURL(url)
URL.open(url)
}
}

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
import TunnelKitOpenVPN
import TunnelKitWireGuard

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct AddProfileMenu: View {
enum ModalType: Identifiable {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
enum AddProfileView {
struct Bindings {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension AddProviderView {
struct NameView: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct AddProviderView: View {
@ObservedObject private var providerManager: ProviderManager

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import Combine
import PassepartoutLibrary
import SwiftUI
struct DebugLogView: View {
private let title: String

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
import TunnelKitOpenVPN
extension DiagnosticsView {
@ -178,7 +178,7 @@ extension DiagnosticsView.OpenVPNView {
guard let url = URL.mailto(to: V.recipient, subject: V.subject, body: body) else {
return
}
guard URL.openURL(url) else {
guard URL.open(url) else {
alertType = .emailNotConfigured
return
}

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
import TunnelKitWireGuard
extension DiagnosticsView {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct DiagnosticsView: View {
let vpnProtocol: VPNProtocolType

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import StoreKit
import PassepartoutLibrary
import StoreKit
import SwiftUI
struct DonateView: View {
enum AlertType: Identifiable {

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import PassepartoutLibrary
import SwiftUI
import TunnelKitOpenVPN
import PassepartoutLibrary
extension EndpointAdvancedView {
struct OpenVPNView: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
import TunnelKitOpenVPN
extension EndpointView {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
import TunnelKitWireGuard
extension EndpointView {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct EndpointView: View {
@ObservedObject private var currentProfile: ObservableProfile

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct InteractiveConnectionView: View {
@Environment(\.presentationMode) private var presentationMode

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct NetworkSettingsView: View {
@ObservedObject private var currentProfile: ObservableProfile

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension OnDemandView {
struct SSIDList: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct OnDemandView: View {
@ObservedObject private var productManager: ProductManager

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension OrganizerView {
struct ProfileRow: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension OrganizerView {
struct ProfilesList: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension OrganizerView {
struct SceneView: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct OrganizerView: View {
enum ModalType: Identifiable {
@ -151,7 +151,7 @@ extension OrganizerView {
message: Text(L10n.Organizer.Alerts.Reddit.message),
primaryButton: .default(Text(L10n.Organizer.Alerts.Reddit.Buttons.subscribe)) {
didHandleSubreddit = true
URL.openURL(redditURL)
URL.open(redditURL)
},
secondaryButton: .cancel(Text(L10n.Global.Alerts.Buttons.never)) {
didHandleSubreddit = true

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import StoreKit
import PassepartoutLibrary
import StoreKit
import SwiftUI
extension PaywallView {
struct PurchaseView: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension ProfileView {
struct ConfigurationSection: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension ProfileView {
struct DiagnosticsSection: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension ProfileView {
struct ExtraSection: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension ProfileView {
struct MainMenu: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension ProfileView {
struct ProviderSection: View, ProviderProfileAvailability {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension ProfileView {
struct RenameView: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
extension ProfileView {
struct VPNSection: View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct ProfileView: View {
enum ModalType: Int, Identifiable {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct ProviderLocationView: View, ProviderProfileAvailability {
@ObservedObject var providerManager: ProviderManager

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct ProviderPresetView: View {
@Environment(\.presentationMode) private var presentationMode

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import MessageUI
import PassepartoutLibrary
import SwiftUI
struct ReportIssueView: View {
@Binding private var isPresented: Bool

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct SettingsButton: View {
@State private var isPresented = false

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct SettingsView: View {
@ObservedObject private var profileManager: ProfileManager

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import Intents
import PassepartoutLibrary
import SwiftUI
extension ShortcutsView {
struct AddView: View {

View File

@ -23,9 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import Intents
import PassepartoutLibrary
import SwiftUI
struct ShortcutsView: View {
enum ModalType: Identifiable {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct VPNStatusText: View {
@ObservedObject private var currentVPNState: ObservableVPNState

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
struct VPNToggle: View {
@ObservedObject private var profileManager: ProfileManager

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import SwiftUI
import PassepartoutLibrary
import SwiftUI
import SwiftyBeaver
extension View {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
import PassepartoutLibrary
@MainActor

View File

@ -24,11 +24,11 @@
//
import Foundation
import NetworkExtension
import PassepartoutLibrary
import TunnelKitManager
import TunnelKitOpenVPN
import TunnelKitWireGuard
import NetworkExtension
import PassepartoutLibrary
extension VPNStatus {
var localizedDescription: String {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
private let appURL = Constants.Launcher.appURL

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
private let bundle = Constants.Mac.bundle

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
class DefaultMacUtils: MacUtils {
private(set) lazy var isStartedByLauncher = NSApp.isHidden

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct HostProfileItem: Item {
private let viewModel: ViewModel

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
import ServiceManagement
extension LaunchOnLoginItem {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct LaunchOnLoginItem: Item {
private let viewModel: ViewModel

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
extension PassepartoutMenu {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
@MainActor
class PassepartoutMenu {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct ProfileItemGroup: ItemGroup {
private let profileManager: LightProfileManager

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct ProviderLocationItem: Item {
private let profile: LightProfile

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct ProviderProfileItem: Item {
private let viewModel: ViewModel

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct ProviderServerItem: Item {
private let profile: LightProfile

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
extension VPNItemGroup {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct VPNItemGroup: ItemGroup {
private let viewModel: ViewModel

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
extension VisibilityItem {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct VisibilityItem: Item {
private let title: String

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
protocol Item: ItemGroup {
func asMenuItem(withParent parent: NSMenu) -> NSMenuItem

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
@MainActor
protocol ItemGroup {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
class ObservableProcessTransformer: ObservableObject {
static let shared = ObservableProcessTransformer()

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct SeparatorItem: Item {
func asMenuItem(withParent parent: NSMenu) -> NSMenuItem {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct StaticSystemMenu: SystemMenu {
let children: [ItemGroup]

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
@MainActor
protocol SystemMenu {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
extension TextItem {
class ViewModel {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import AppKit
import Foundation
struct TextItem: Item {
enum State {

View File

@ -24,7 +24,6 @@
//
import Foundation
import TunnelKit
extension Profile {
public struct NetworkSettings: Codable, Equatable {

View File

@ -25,7 +25,7 @@
import Foundation
public enum VPNProtocolType: String, Codable {
public enum VPNProtocolType: String, CaseIterable, Codable {
case openVPN = "ovpn"
case wireGuard = "wg"

View File

@ -1,8 +1,8 @@
@_exported import PassepartoutVPN
@_exported import PassepartoutCore
@_exported import PassepartoutProfiles
@_exported import PassepartoutProviders
@_exported import PassepartoutServices
@_exported import PassepartoutUtils
@_exported import PassepartoutCore
@_exported import PassepartoutVPN
@_exported import TunnelKit
@_exported import TunnelKitCore

View File

@ -25,11 +25,11 @@
import Foundation
import GenericJSON
import TunnelKitCore
import TunnelKitOpenVPNCore
import TunnelKitManager
import PassepartoutCore
import PassepartoutUtils
import TunnelKitCore
import TunnelKitManager
import TunnelKitOpenVPNCore
private typealias Map = [String: Any]

View File

@ -23,11 +23,11 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import CoreData
import SwiftyBeaver
import Foundation
import PassepartoutCore
import PassepartoutUtils
import SwiftyBeaver
@MainActor
public final class UpgradeManager: ObservableObject {

View File

@ -7,8 +7,8 @@
// This file was automatically generated and should not be edited.
//
import Foundation
import CoreData
import Foundation
@objc(CDProfile)
public class CDProfile: NSManagedObject {

View File

@ -7,8 +7,8 @@
// This file was automatically generated and should not be edited.
//
import Foundation
import CoreData
import Foundation
extension CDProfile {

View File

@ -24,9 +24,9 @@
//
import Foundation
import PassepartoutCore
import TunnelKitCore
import TunnelKitOpenVPN
import PassepartoutCore
extension Profile.OpenVPNSettings: GatewaySettingsProviding {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import CoreData
import Foundation
import PassepartoutCore
extension PassepartoutDataModels {

View File

@ -23,12 +23,12 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import TunnelKitOpenVPN
import TunnelKitWireGuard
import Foundation
import PassepartoutCore
import PassepartoutUtils
import TunnelKitOpenVPN
import TunnelKitWireGuard
extension ProviderServer.Preset {
public var openVPNConfiguration: OpenVPN.Configuration? {

View File

@ -23,8 +23,8 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import Combine
import Foundation
import PassepartoutCore
import PassepartoutProviders

Some files were not shown because too many files have changed in this diff Show More