diff --git a/Library/Package.resolved b/Library/Package.resolved index 0af4c759..85a7ca05 100644 --- a/Library/Package.resolved +++ b/Library/Package.resolved @@ -41,8 +41,7 @@ "kind" : "remoteSourceControl", "location" : "git@github.com:passepartoutvpn/passepartoutkit-source", "state" : { - "revision" : "a08e04fccde51d92d5bed3fbe1880c4225f18618", - "version" : "1.0.0" + "revision" : "612168933da04498bfe60abd09d466183388196f" } }, { @@ -50,8 +49,7 @@ "kind" : "remoteSourceControl", "location" : "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", "state" : { - "revision" : "3c3d7a4b477976fed638858bca9bb06e224bea3c", - "version" : "1.0.0" + "revision" : "dc14907a90eb9ece4f2a2d993a99ebde674fe409" } }, { @@ -59,8 +57,7 @@ "kind" : "remoteSourceControl", "location" : "git@github.com:passepartoutvpn/passepartoutkit-source-wireguard-go", "state" : { - "revision" : "7c1e0279eadf319a8744b34c09cb481a32d17623", - "version" : "1.0.0" + "revision" : "6b24ea9ad16b37ecfe5d18ddccc8be8fc2f612f8" } }, { diff --git a/Library/Package.swift b/Library/Package.swift index 7532dad3..ce7f5fac 100644 --- a/Library/Package.swift +++ b/Library/Package.swift @@ -61,14 +61,14 @@ let package = Package( ) ], dependencies: [ - .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "1.0.0"), -// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "a08e04fccde51d92d5bed3fbe1880c4225f18618"), +// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "1.0.0"), + .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "612168933da04498bfe60abd09d466183388196f"), // .package(path: "../../passepartoutkit-source"), - .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "1.0.0"), -// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"), +// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "1.0.0"), + .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "dc14907a90eb9ece4f2a2d993a99ebde674fe409"), // .package(path: "../../passepartoutkit-source-openvpn-openssl"), - .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-wireguard-go", from: "1.0.0"), -// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-wireguard-go", revision: "68fceaa664913988b2d9053405738682a30b87b8"), +// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-wireguard-go", from: "1.0.0"), + .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-wireguard-go", revision: "6b24ea9ad16b37ecfe5d18ddccc8be8fc2f612f8"), // .package(path: "../../passepartoutkit-source-wireguard-go"), .package(url: "https://github.com/Cocoanetics/Kvitto", from: "1.0.0") ], diff --git a/Passepartout.xcodeproj/xcshareddata/xcschemes/Passepartout.xcscheme b/Passepartout.xcodeproj/xcshareddata/xcschemes/Passepartout.xcscheme index 946e30cb..dd7d5885 100644 --- a/Passepartout.xcodeproj/xcshareddata/xcschemes/Passepartout.xcscheme +++ b/Passepartout.xcodeproj/xcshareddata/xcschemes/Passepartout.xcscheme @@ -89,7 +89,7 @@ + isEnabled = "NO"> ProfileRepository = { let remoteStore = CoreDataPersistentStore( @@ -84,10 +101,7 @@ extension AppContext { ) } return ProfileManager( - repository: dependencies.mainProfileRepository( - model: cdRemoteModel, - environment: tunnelEnvironment - ), + repository: mainProfileRepository, backupRepository: dependencies.backupProfileRepository( model: cdRemoteModel ), @@ -98,7 +112,7 @@ extension AppContext { }() let tunnel = ExtendedTunnel( - tunnel: Tunnel(strategy: dependencies.tunnelStrategy(environment: tunnelEnvironment)), + tunnel: Tunnel(strategy: tunnelStrategy), environment: tunnelEnvironment, processor: processor, interval: Constants.shared.tunnel.refreshInterval @@ -214,49 +228,7 @@ private extension Dependencies { var betaReceiptURL: URL? { Bundle.main.appStoreProductionReceiptURL } -} -// MARK: Simulator - -#if targetEnvironment(simulator) - -private extension Dependencies { - func tunnelStrategy(environment: TunnelEnvironment) -> TunnelObservableStrategy { - FakeTunnelStrategy(environment: environment, dataCountInterval: 1000) - } - - func mainProfileRepository(model: NSManagedObjectModel, environment: TunnelEnvironment) -> ProfileRepository { - coreDataProfileRepository(model: model, observingResults: true) - } - - func backupProfileRepository(model: NSManagedObjectModel) -> ProfileRepository? { - nil - } -} - -#else - -// MARK: Device - -private extension Dependencies { - func tunnelStrategy(environment: TunnelEnvironment) -> TunnelObservableStrategy { - neStrategy(environment: environment) - } - - func mainProfileRepository(model: NSManagedObjectModel, environment: TunnelEnvironment) -> ProfileRepository { - neProfileRepository(environment: environment) - } - - func backupProfileRepository(model: NSManagedObjectModel) -> ProfileRepository? { - coreDataProfileRepository(model: model, observingResults: false) - } -} - -#endif - -// MARK: Common - -private extension Dependencies { var mirrorsRemoteRepository: Bool { #if os(tvOS) true @@ -265,18 +237,12 @@ private extension Dependencies { #endif } - func neProfileRepository(environment: TunnelEnvironment) -> ProfileRepository { - NEProfileRepository(repository: neStrategy(environment: environment)) { - profileTitle($0) - } - } - - func neStrategy(environment: TunnelEnvironment) -> NETunnelStrategy { - NETunnelStrategy( - bundleIdentifier: BundleConfiguration.mainString(for: .tunnelId), - coder: neProtocolCoder(), - environment: environment - ) + func backupProfileRepository(model: NSManagedObjectModel) -> ProfileRepository? { +#if targetEnvironment(simulator) + nil +#else + coreDataProfileRepository(model: model, observingResults: false) +#endif } func coreDataProfileRepository(model: NSManagedObjectModel, observingResults: Bool) -> ProfileRepository {