From b65c61f2acac2ccfedcd9d70728c34be89d04e38 Mon Sep 17 00:00:00 2001 From: Bug Magnet Date: Thu, 15 Aug 2024 16:04:30 +0200 Subject: [PATCH 1/5] Add support for building with Xcode 16 --- ios/MullvadVPN.xcodeproj/project.pbxproj | 76 +------------------ .../UIApplication+Extensions.swift | 8 ++ .../TunnelManager/UIApplication+Stubs.swift | 10 +++ 3 files changed, 22 insertions(+), 72 deletions(-) diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj index 2e42549f623f..466bac700b9b 100644 --- a/ios/MullvadVPN.xcodeproj/project.pbxproj +++ b/ios/MullvadVPN.xcodeproj/project.pbxproj @@ -6412,7 +6412,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -6452,7 +6451,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -6475,7 +6473,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -6497,7 +6494,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -6517,7 +6513,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -6537,7 +6532,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -6573,7 +6567,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -6611,7 +6604,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -6650,7 +6642,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -6690,7 +6681,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -6713,7 +6703,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -6734,7 +6723,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -6798,6 +6786,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -6855,6 +6844,7 @@ SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -6885,7 +6875,6 @@ "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Mullvad VPN Development"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -6913,7 +6902,6 @@ PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Mullvad VPN Release"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = Release; }; @@ -6934,7 +6922,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -6954,7 +6941,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "$(APPLICATION_IDENTIFIER).PacketTunnel"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = Release; }; @@ -6987,7 +6973,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7023,7 +7008,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7058,7 +7042,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7094,7 +7077,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7130,7 +7112,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7167,7 +7148,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7217,7 +7197,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -7237,7 +7216,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -7280,7 +7258,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -7321,7 +7298,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -7348,7 +7324,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -7374,7 +7349,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -7418,7 +7392,6 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG MULLVAD_ENVIRONMENT_PRODUCTION $(inherited)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/MullvadVPNUITests/BridgingHeader.h"; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = MullvadVPN; }; @@ -7451,7 +7424,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/MullvadVPNUITests/BridgingHeader.h"; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = MullvadVPN; }; @@ -7516,6 +7488,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Staging; @@ -7545,7 +7518,6 @@ "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Mullvad VPN Development"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = Staging; }; @@ -7584,7 +7556,6 @@ "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Packet Tunnel Development"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = Staging; }; @@ -7603,7 +7574,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Staging; @@ -7637,7 +7607,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7659,7 +7628,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Staging; @@ -7697,7 +7665,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7720,7 +7687,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Staging; @@ -7754,7 +7720,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7790,7 +7755,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -7828,7 +7792,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -7851,7 +7814,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Staging; @@ -7887,7 +7849,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -7932,7 +7893,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -7959,7 +7919,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Staging; @@ -7986,7 +7945,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG MULLVAD_ENVIRONMENT_STAGING"; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/MullvadVPNUITests/BridgingHeader.h"; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = MullvadVPN; }; @@ -8010,7 +7968,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_ACTIVE_COMPILATION_CONDITIONS = MULLVAD_ENVIRONMENT_PRODUCTION; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/MullvadVPNUITests/BridgingHeader.h"; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = MullvadVPN; }; @@ -8062,7 +8019,6 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8114,7 +8070,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8166,7 +8121,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8217,7 +8171,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8245,7 +8198,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -8270,7 +8222,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Staging; @@ -8295,7 +8246,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -8320,7 +8270,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = MockRelease; @@ -8377,6 +8326,7 @@ SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -8406,7 +8356,6 @@ PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Mullvad VPN Development"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = MockRelease; }; @@ -8441,7 +8390,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Packet Tunnel Development"; SWIFT_STRICT_CONCURRENCY = minimal; - SWIFT_VERSION = 5.0; }; name = MockRelease; }; @@ -8460,7 +8408,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = MockRelease; @@ -8494,7 +8441,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -8516,7 +8462,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = MockRelease; @@ -8554,7 +8499,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -8577,7 +8521,6 @@ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = MockRelease; @@ -8611,7 +8554,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -8647,7 +8589,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSION_INFO_PREFIX = ""; }; @@ -8685,7 +8626,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8708,7 +8648,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = MockRelease; @@ -8744,7 +8683,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8786,7 +8724,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -8813,7 +8750,6 @@ SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = MockRelease; @@ -8860,7 +8796,6 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INSTALL_OBJC_HEADER = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8908,7 +8843,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INSTALL_OBJC_HEADER = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -8957,7 +8891,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INSTALL_OBJC_HEADER = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -9008,7 +8941,6 @@ SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INSTALL_OBJC_HEADER = NO; - SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/ios/MullvadVPN/TunnelManager/UIApplication+Extensions.swift b/ios/MullvadVPN/TunnelManager/UIApplication+Extensions.swift index d1a39e40263f..ed06c325aa5b 100644 --- a/ios/MullvadVPN/TunnelManager/UIApplication+Extensions.swift +++ b/ios/MullvadVPN/TunnelManager/UIApplication+Extensions.swift @@ -15,10 +15,18 @@ public protocol BackgroundTaskProvider { var backgroundTimeRemaining: TimeInterval { get } func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier) + #if compiler(>=6) + nonisolated + func beginBackgroundTask( + withName taskName: String?, + expirationHandler handler: (@MainActor @Sendable () -> Void)? + ) -> UIBackgroundTaskIdentifier + #else func beginBackgroundTask( withName taskName: String?, expirationHandler handler: (() -> Void)? ) -> UIBackgroundTaskIdentifier + #endif } extension UIApplication: BackgroundTaskProvider {} diff --git a/ios/MullvadVPNTests/MullvadVPN/TunnelManager/UIApplication+Stubs.swift b/ios/MullvadVPNTests/MullvadVPN/TunnelManager/UIApplication+Stubs.swift index a729c88a1857..a220578bb610 100644 --- a/ios/MullvadVPNTests/MullvadVPN/TunnelManager/UIApplication+Stubs.swift +++ b/ios/MullvadVPNTests/MullvadVPN/TunnelManager/UIApplication+Stubs.swift @@ -16,10 +16,20 @@ struct UIApplicationStub: BackgroundTaskProvider { func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier) {} + #if compiler(>=6) + func beginBackgroundTask( + withName taskName: String?, + expirationHandler handler: (@MainActor @Sendable () -> Void)? + ) + -> UIBackgroundTaskIdentifier { + .invalid + } + #else func beginBackgroundTask( withName taskName: String?, expirationHandler handler: (() -> Void)? ) -> UIBackgroundTaskIdentifier { .invalid } + #endif } From b75973778137d3151189a0acf0c5c463ed837f26 Mon Sep 17 00:00:00 2001 From: Bug Magnet Date: Fri, 16 Aug 2024 15:32:11 +0200 Subject: [PATCH 2/5] Update Wireguard dependencies --- ios/MullvadVPN.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj index 466bac700b9b..28b7b8d2f982 100644 --- a/ios/MullvadVPN.xcodeproj/project.pbxproj +++ b/ios/MullvadVPN.xcodeproj/project.pbxproj @@ -9186,7 +9186,7 @@ repositoryURL = "https://github.com/mullvad/wireguard-apple.git"; requirement = { kind = revision; - revision = 3c55cc305d30a02f87af5d6228ff416d3901d8dd; + revision = a31e50faa79c85e4da054bcc8e1fb05db3b834e6; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b7c6470358f7..5cd9680d6ff0 100644 --- a/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/MullvadVPN.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mullvad/wireguard-apple.git", "state" : { - "revision" : "3c55cc305d30a02f87af5d6228ff416d3901d8dd" + "revision" : "a31e50faa79c85e4da054bcc8e1fb05db3b834e6" } } ], From a4ad185257a560ad841ef0a0f4b398828128ddef Mon Sep 17 00:00:00 2001 From: Bug Magnet Date: Fri, 16 Aug 2024 17:07:30 +0200 Subject: [PATCH 3/5] Remove unneeded swiftlint rule definition --- ios/.swiftlint.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ios/.swiftlint.yml b/ios/.swiftlint.yml index 93a558d52c79..8729b4a656f0 100644 --- a/ios/.swiftlint.yml +++ b/ios/.swiftlint.yml @@ -44,14 +44,6 @@ type_name: error: 60 excluded: iPhone # excluded via string allowed_symbols: ["_"] # these are allowed in type names -identifier_name: - allowed_symbols: ["_"] # these are allowed in type names - min_length: - error: 3 - excluded: - - id - - URL - - GlobalAPIKey reporter: "xcode" nesting: type_level: From 2b37ca7b23ce2b557003997758a1be0735f43545 Mon Sep 17 00:00:00 2001 From: Bug Magnet Date: Fri, 16 Aug 2024 17:08:53 +0200 Subject: [PATCH 4/5] Fix swift 6 related warnings --- .../Extensions/CodingErrors+CustomErrorDescription.swift | 4 ++-- ios/MullvadVPN/Extensions/NEVPNStatus+Debug.swift | 2 +- ios/MullvadVPN/Extensions/RESTError+Display.swift | 2 +- ios/MullvadVPN/Extensions/SKError+Localized.swift | 2 +- .../Actor/PacketTunnelActor+SleepCycle.swift | 8 ++++++-- ios/PacketTunnelCore/Actor/PacketTunnelActor.swift | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ios/MullvadVPN/Extensions/CodingErrors+CustomErrorDescription.swift b/ios/MullvadVPN/Extensions/CodingErrors+CustomErrorDescription.swift index 56bd591bf4c3..6643aeac6877 100644 --- a/ios/MullvadVPN/Extensions/CodingErrors+CustomErrorDescription.swift +++ b/ios/MullvadVPN/Extensions/CodingErrors+CustomErrorDescription.swift @@ -9,7 +9,7 @@ import Foundation import MullvadTypes -extension DecodingError: CustomErrorDescriptionProtocol { +extension DecodingError: MullvadTypes.CustomErrorDescriptionProtocol { public var customErrorDescription: String? { switch self { case let .typeMismatch(type, context): @@ -30,7 +30,7 @@ extension DecodingError: CustomErrorDescriptionProtocol { } } -extension EncodingError: CustomErrorDescriptionProtocol { +extension EncodingError: MullvadTypes.CustomErrorDescriptionProtocol { public var customErrorDescription: String? { switch self { case let .invalidValue(_, context): diff --git a/ios/MullvadVPN/Extensions/NEVPNStatus+Debug.swift b/ios/MullvadVPN/Extensions/NEVPNStatus+Debug.swift index 49320084d4f9..e4536dc2e88a 100644 --- a/ios/MullvadVPN/Extensions/NEVPNStatus+Debug.swift +++ b/ios/MullvadVPN/Extensions/NEVPNStatus+Debug.swift @@ -8,7 +8,7 @@ import NetworkExtension -extension NEVPNStatus: CustomStringConvertible { +extension NEVPNStatus: Swift.CustomStringConvertible { public var description: String { switch self { case .connected: diff --git a/ios/MullvadVPN/Extensions/RESTError+Display.swift b/ios/MullvadVPN/Extensions/RESTError+Display.swift index a4e5f9b7fc9c..c917ebbd825b 100644 --- a/ios/MullvadVPN/Extensions/RESTError+Display.swift +++ b/ios/MullvadVPN/Extensions/RESTError+Display.swift @@ -10,7 +10,7 @@ import Foundation import MullvadREST import MullvadTypes -extension REST.Error: DisplayError { +extension REST.Error: MullvadTypes.DisplayError { public var displayErrorDescription: String? { switch self { case let .network(urlError): diff --git a/ios/MullvadVPN/Extensions/SKError+Localized.swift b/ios/MullvadVPN/Extensions/SKError+Localized.swift index 024e258d2757..288cc3aabdf6 100644 --- a/ios/MullvadVPN/Extensions/SKError+Localized.swift +++ b/ios/MullvadVPN/Extensions/SKError+Localized.swift @@ -8,7 +8,7 @@ import StoreKit -extension SKError: LocalizedError { +extension SKError: Foundation.LocalizedError { public var errorDescription: String? { switch code { case .unknown: diff --git a/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift b/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift index c6339ce11ebe..0f831787476e 100644 --- a/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift +++ b/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift @@ -15,7 +15,9 @@ extension PacketTunnelActor { `NEPacketTunnelProvider` provides the corresponding lifecycle method. */ public nonisolated func onWake() { - tunnelMonitor.onWake() + Task { + await tunnelMonitor.onWake() + } } /** @@ -24,6 +26,8 @@ extension PacketTunnelActor { `NEPacketTunnelProvider` provides the corresponding lifecycle method. */ public nonisolated func onSleep() { - tunnelMonitor.onSleep() + Task { + await tunnelMonitor.onSleep() + } } } diff --git a/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift b/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift index 10cd928cf8a8..77989f97df1e 100644 --- a/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift +++ b/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift @@ -87,7 +87,7 @@ public actor PacketTunnelActor { for await event in channel { guard let self else { return } - self.logger.debug("Received event: \(event.logFormat())") + await self.logger.debug("Received event: \(event.logFormat())") let effects = await self.runReducer(event) From 48691d3bd0fad5d4e41974559ed6d59d32c3b9ac Mon Sep 17 00:00:00 2001 From: Bug Magnet Date: Mon, 19 Aug 2024 11:54:27 +0200 Subject: [PATCH 5/5] Specify nonisolation in PacketTunnelActor --- .../Actor/PacketTunnelActor+SleepCycle.swift | 8 ++------ ios/PacketTunnelCore/Actor/PacketTunnelActor.swift | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift b/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift index 0f831787476e..c6339ce11ebe 100644 --- a/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift +++ b/ios/PacketTunnelCore/Actor/PacketTunnelActor+SleepCycle.swift @@ -15,9 +15,7 @@ extension PacketTunnelActor { `NEPacketTunnelProvider` provides the corresponding lifecycle method. */ public nonisolated func onWake() { - Task { - await tunnelMonitor.onWake() - } + tunnelMonitor.onWake() } /** @@ -26,8 +24,6 @@ extension PacketTunnelActor { `NEPacketTunnelProvider` provides the corresponding lifecycle method. */ public nonisolated func onSleep() { - Task { - await tunnelMonitor.onSleep() - } + tunnelMonitor.onSleep() } } diff --git a/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift b/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift index 77989f97df1e..727b16215739 100644 --- a/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift +++ b/ios/PacketTunnelCore/Actor/PacketTunnelActor.swift @@ -37,11 +37,11 @@ public actor PacketTunnelActor { @Published internal(set) public var observedState: ObservedState = .initial - let logger = Logger(label: "PacketTunnelActor") + nonisolated let logger = Logger(label: "PacketTunnelActor") let timings: PacketTunnelActorTimings let tunnelAdapter: TunnelAdapterProtocol - let tunnelMonitor: TunnelMonitorProtocol + nonisolated let tunnelMonitor: TunnelMonitorProtocol let defaultPathObserver: DefaultPathObserverProtocol let blockedStateErrorMapper: BlockedStateErrorMapperProtocol public let relaySelector: RelaySelectorProtocol @@ -87,7 +87,7 @@ public actor PacketTunnelActor { for await event in channel { guard let self else { return } - await self.logger.debug("Received event: \(event.logFormat())") + self.logger.debug("Received event: \(event.logFormat())") let effects = await self.runReducer(event)