From e96245b9d846331e86e8d2dca38240c325ea7bdb Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Sat, 12 Nov 2022 23:00:48 -0500 Subject: [PATCH] WireGuard extension Signed-off-by: Joseph Mattello --- .gitignore | 3 +- AltStore.xcodeproj/project.pbxproj | 336 +++++++++++++++++- .../xcshareddata/swiftpm/Package.resolved | 86 ----- AltStore/AltStore.entitlements | 24 ++ AltStore/Info.plist | 35 ++ .../AppProxyProvider.swift | 42 +++ WireguardNetworkExtension/Info.plist | 13 + .../WireguardNetworkExtension.entitlements | 10 + 8 files changed, 461 insertions(+), 88 deletions(-) delete mode 100644 AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 WireguardNetworkExtension/AppProxyProvider.swift create mode 100644 WireguardNetworkExtension/Info.plist create mode 100644 WireguardNetworkExtension/WireguardNetworkExtension.entitlements diff --git a/.gitignore b/.gitignore index d750188a..d8f40e4f 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ xcuserdata /.vscode ## AppCode specific -.idea/ \ No newline at end of file +.idea/ +/.build diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index 4a46b7e7..45b53c53 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -23,6 +23,11 @@ 4879A9622861049C00FC1BBD /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A9612861049C00FC1BBD /* OpenSSL */; }; B3146ED2284F581E00BBC3FD /* Roxas.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3146ECD284F580500BBC3FD /* Roxas.framework */; }; B3146ED3284F581E00BBC3FD /* Roxas.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3146ECD284F580500BBC3FD /* Roxas.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B355DFB129209C6900E4C858 /* WireGuardKit in Frameworks */ = {isa = PBXBuildFile; productRef = B355DFB029209C6900E4C858 /* WireGuardKit */; }; + B355DFC029209E2400E4C858 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B355DFBF29209E2400E4C858 /* NetworkExtension.framework */; }; + B355DFC329209E2500E4C858 /* AppProxyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = B355DFC229209E2500E4C858 /* AppProxyProvider.swift */; }; + B355DFC829209E2500E4C858 /* WireguardNetworkExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = B355DFBE29209E2400E4C858 /* WireguardNetworkExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + B355DFCF29209E4C00E4C858 /* WireGuardKit in Frameworks */ = {isa = PBXBuildFile; productRef = B355DFCE29209E4C00E4C858 /* WireGuardKit */; }; B33FFBA8295F8E98002259E6 /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B343F894295F7F9B002B1159 /* libfragmentzip.a */; }; B33FFBAA295F8F78002259E6 /* preboard.c in Sources */ = {isa = PBXBuildFile; fileRef = B33FFBA9295F8F78002259E6 /* preboard.c */; }; B33FFBAC295F8F98002259E6 /* companion_proxy.c in Sources */ = {isa = PBXBuildFile; fileRef = B33FFBAB295F8F98002259E6 /* companion_proxy.c */; }; @@ -386,6 +391,26 @@ remoteGlobalIDString = BFADB00319AE7BB80050CF31; remoteInfo = RoxasTests; }; + B355DFC629209E2500E4C858 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFD247622284B9A500981D42 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B355DFBD29209E2400E4C858; + remoteInfo = WireguardNetworkExtension; + }; + B355DFCC29209E3F00E4C858 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFD247622284B9A500981D42 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B355DFB229209DB000E4C858; + remoteInfo = WireGuardGoBridgeiOS; + }; + BF4588442298D48B00BD7491 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFD247622284B9A500981D42 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BF45872A2298D31600BD7491; + remoteInfo = libimobiledevice; B343F84B295F6321002B1159 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = B343F847295F6321002B1159 /* minimuxer.xcodeproj */; @@ -492,6 +517,7 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( + B355DFC829209E2500E4C858 /* WireguardNetworkExtension.appex in Embed App Extensions */, BF989177250AABF4002ACF50 /* AltWidgetExtension.appex in Embed App Extensions */, ); name = "Embed App Extensions"; @@ -513,6 +539,11 @@ 1920B04E2924AC8300744F60 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; 19B9B7442845E6DF0076EF69 /* SelectTeamViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectTeamViewController.swift; sourceTree = ""; }; B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Roxas.xcodeproj; path = Dependencies/Roxas/Roxas.xcodeproj; sourceTree = ""; }; + B355DFBE29209E2400E4C858 /* WireguardNetworkExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WireguardNetworkExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + B355DFBF29209E2400E4C858 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; + B355DFC229209E2500E4C858 /* AppProxyProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppProxyProvider.swift; sourceTree = ""; }; + B355DFC429209E2500E4C858 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B355DFC529209E2500E4C858 /* WireguardNetworkExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WireguardNetworkExtension.entitlements; sourceTree = ""; }; B33FFBA9295F8F78002259E6 /* preboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = preboard.c; path = src/preboard.c; sourceTree = ""; }; B33FFBAB295F8F98002259E6 /* companion_proxy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = companion_proxy.c; path = src/companion_proxy.c; sourceTree = ""; }; B343F847295F6321002B1159 /* minimuxer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = minimuxer.xcodeproj; path = Dependencies/minimuxer.xcodeproj; sourceTree = SOURCE_ROOT; }; @@ -876,6 +907,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B355DFBB29209E2400E4C858 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B355DFCF29209E4C00E4C858 /* WireGuardKit in Frameworks */, + B355DFC029209E2400E4C858 /* NetworkExtension.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; BF18BFE424857D7900DD5981 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -922,6 +962,7 @@ D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */, B3C395F9284F362400DA9E2F /* AppCenterCrashes in Frameworks */, D533E8BE2727BBF800A9B5DD /* libcurl.a in Frameworks */, + B355DFB129209C6900E4C858 /* WireGuardKit in Frameworks */, 4879A9622861049C00FC1BBD /* OpenSSL in Frameworks */, B3C395F4284F35DD00DA9E2F /* Nuke in Frameworks */, BF1614F1250822F100767AEA /* Roxas.framework in Frameworks */, @@ -980,6 +1021,16 @@ name = Products; sourceTree = ""; }; + B355DFC129209E2500E4C858 /* WireguardNetworkExtension */ = { + isa = PBXGroup; + children = ( + B355DFC229209E2500E4C858 /* AppProxyProvider.swift */, + B355DFC429209E2500E4C858 /* Info.plist */, + B355DFC529209E2500E4C858 /* WireguardNetworkExtension.entitlements */, + ); + path = WireguardNetworkExtension; + sourceTree = ""; + }; B33FFB8F295F8CF2002259E6 /* Recovered References */ = { isa = PBXGroup; children = ( @@ -1509,6 +1560,7 @@ BF98916C250AABF3002ACF50 /* AltWidget */, 19104DB32909C06D00C49C7B /* EmotionalDamage */, 191E5FAC290A5D92001A3B7C /* minimuxer */, + B355DFC129209E2500E4C858 /* WireguardNetworkExtension */, B343F886295F7F9B002B1159 /* libfragmentzip.xcodeproj */, BFD247852284BB3300981D42 /* Frameworks */, B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */, @@ -1528,6 +1580,7 @@ BF989167250AABF3002ACF50 /* AltWidgetExtension.appex */, 19104DB22909C06C00C49C7B /* libEmotionalDamage.a */, 191E5FAB290A5D92001A3B7C /* libminimuxer.a */, + B355DFBE29209E2400E4C858 /* WireguardNetworkExtension.appex */, ); name = Products; sourceTree = ""; @@ -1575,6 +1628,7 @@ BF580497246A3D19008AE704 /* UIKit.framework */, BF4588872298DD3F00BD7491 /* libxml2.tbd */, BFD247862284BB3B00981D42 /* Roxas.framework */, + B355DFBF29209E2400E4C858 /* NetworkExtension.framework */, ); name = Frameworks; sourceTree = ""; @@ -1833,6 +1887,37 @@ }; /* End PBXHeadersBuildPhase section */ +/* Begin PBXLegacyTarget section */ + B355DFB229209DB000E4C858 /* WireGuardGoBridgeiOS */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "$(ACTION)"; + buildConfigurationList = B355DFB329209DB000E4C858 /* Build configuration list for PBXLegacyTarget "WireGuardGoBridgeiOS" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/make; + buildWorkingDirectory = "${BUILD_DIR}/../../SourcePackages/checkouts/wireguard-apple/Sources/WireGuardKitGo"; + dependencies = ( + ); + name = WireGuardGoBridgeiOS; + passBuildSettingsInEnvironment = 1; + productName = WireGuardGoBridgeiOS; + }; + B355DFB629209DD200E4C858 /* WireGuardGoBridgemacOS */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "$(ACTION)"; + buildConfigurationList = B355DFB729209DD200E4C858 /* Build configuration list for PBXLegacyTarget "WireGuardGoBridgemacOS" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/make; + buildWorkingDirectory = "${BUILD_DIR%Build/*}SourcePackages/checkouts/wireguard-apple/Sources/WireGuardKitGo"; + dependencies = ( + ); + name = WireGuardGoBridgemacOS; + passBuildSettingsInEnvironment = 1; + productName = WireGuardGoBridgeiOS; + }; +/* End PBXLegacyTarget section */ + /* Begin PBXNativeTarget section */ 19104DB12909C06C00C49C7B /* EmotionalDamage */ = { isa = PBXNativeTarget; @@ -1869,6 +1954,27 @@ productReference = 191E5FAB290A5D92001A3B7C /* libminimuxer.a */; productType = "com.apple.product-type.library.static"; }; + B355DFBD29209E2400E4C858 /* WireguardNetworkExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = B355DFC929209E2600E4C858 /* Build configuration list for PBXNativeTarget "WireguardNetworkExtension" */; + buildPhases = ( + B355DFBA29209E2400E4C858 /* Sources */, + B355DFBB29209E2400E4C858 /* Frameworks */, + B355DFBC29209E2400E4C858 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + B355DFCD29209E3F00E4C858 /* PBXTargetDependency */, + ); + name = WireguardNetworkExtension; + packageProductDependencies = ( + B355DFCE29209E4C00E4C858 /* WireGuardKit */, + ); + productName = WireguardNetworkExtension; + productReference = B355DFBE29209E2400E4C858 /* WireguardNetworkExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; BF18BFE624857D7900DD5981 /* AltDaemon */ = { isa = PBXNativeTarget; buildConfigurationList = BF18BFEB24857D7900DD5981 /* Build configuration list for PBXNativeTarget "AltDaemon" */; @@ -1983,6 +2089,7 @@ 19104D942909BADB00C49C7B /* PBXTargetDependency */, BF66EE842501AE50007EE018 /* PBXTargetDependency */, BF989176250AABF4002ACF50 /* PBXTargetDependency */, + B355DFC729209E2500E4C858 /* PBXTargetDependency */, ); name = SideStore; packageProductDependencies = ( @@ -1990,6 +2097,7 @@ B3C395F6284F362400DA9E2F /* AppCenterAnalytics */, B3C395F8284F362400DA9E2F /* AppCenterCrashes */, 4879A9612861049C00FC1BBD /* OpenSSL */, + B355DFB029209C6900E4C858 /* WireGuardKit */, ); productName = AltStore; productReference = BFD2476A2284B9A500981D42 /* SideStore.app */; @@ -2001,7 +2109,7 @@ BFD247622284B9A500981D42 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1400; + LastSwiftUpdateCheck = 1410; LastUpgradeCheck = 1020; ORGANIZATIONNAME = SideStore; TargetAttributes = { @@ -2011,6 +2119,12 @@ 191E5FAA290A5D92001A3B7C = { CreatedOnToolsVersion = 14.0; }; + B355DFB229209DB000E4C858 = { + CreatedOnToolsVersion = 14.1; + }; + B355DFBD29209E2400E4C858 = { + CreatedOnToolsVersion = 14.1; + }; BF18BFE624857D7900DD5981 = { CreatedOnToolsVersion = 11.5; LastSwiftMigration = 1150; @@ -2060,6 +2174,7 @@ B3C395FD284F3C0900DA9E2F /* XCRemoteSwiftPackageReference "STPrivilegedTask" */, 4879A95D2861046500FC1BBD /* XCRemoteSwiftPackageReference "AltSign" */, 4879A9602861049C00FC1BBD /* XCRemoteSwiftPackageReference "OpenSSL" */, + B355DFAF29209C6900E4C858 /* XCRemoteSwiftPackageReference "wireguard-apple" */, ); productRefGroup = BFD2476B2284B9A500981D42 /* Products */; projectDirPath = ""; @@ -2091,6 +2206,9 @@ BF989166250AABF3002ACF50 /* AltWidgetExtension */, 19104DB12909C06C00C49C7B /* EmotionalDamage */, 191E5FAA290A5D92001A3B7C /* minimuxer */, + B355DFB229209DB000E4C858 /* WireGuardGoBridgeiOS */, + B355DFB629209DD200E4C858 /* WireGuardGoBridgemacOS */, + B355DFBD29209E2400E4C858 /* WireguardNetworkExtension */, ); }; /* End PBXProject section */ @@ -2169,6 +2287,23 @@ /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ + B355DFBC29209E2400E4C858 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BF45868B229872EA00BD7491 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BFE4FFB6251BF7BA0018CF9B /* AltPlugin.zip in Resources */, + BF458694229872EA00BD7491 /* Assets.xcassets in Resources */, + BF458697229872EA00BD7491 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; BF580479246A28F7008AE704 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2236,6 +2371,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B355DFBA29209E2400E4C858 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B355DFC329209E2500E4C858 /* AppProxyProvider.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; BF18BFE324857D7900DD5981 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2543,6 +2686,20 @@ isa = PBXTargetDependency; productRef = 191E5FD9290AFA49001A3B7C /* OpenSSL */; }; + B355DFC729209E2500E4C858 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B355DFBD29209E2400E4C858 /* WireguardNetworkExtension */; + targetProxy = B355DFC629209E2500E4C858 /* PBXContainerItemProxy */; + }; + B355DFCD29209E3F00E4C858 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B355DFB229209DB000E4C858 /* WireGuardGoBridgeiOS */; + targetProxy = B355DFCC29209E3F00E4C858 /* PBXContainerItemProxy */; + }; + BF4588452298D48B00BD7491 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BF45872A2298D31600BD7491 /* libimobiledevice */; + targetProxy = BF4588442298D48B00BD7491 /* PBXContainerItemProxy */; B343F86F295F76FD002B1159 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "minimuxer-staticlib"; @@ -2700,6 +2857,138 @@ }; name = Release; }; + B355DFB429209DB000E4C858 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + DEBUGGING_SYMBOLS = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = S32Z3HMYVQ; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + B355DFB529209DB000E4C858 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = S32Z3HMYVQ; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + B355DFB829209DD200E4C858 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + DEBUGGING_SYMBOLS = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = S32Z3HMYVQ; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macos; + }; + name = Debug; + }; + B355DFB929209DD200E4C858 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = S32Z3HMYVQ; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macos; + }; + name = Release; + }; + B355DFCA29209E2600E4C858 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_ENTITLEMENTS = WireguardNetworkExtension/WireguardNetworkExtension.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WireguardNetworkExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WireguardNetworkExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 Riley Testut. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.joemattiello.AltStore.WireguardNetworkExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B355DFCB29209E2600E4C858 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_ENTITLEMENTS = WireguardNetworkExtension/WireguardNetworkExtension.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WireguardNetworkExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WireguardNetworkExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 Riley Testut. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.joemattiello.AltStore.WireguardNetworkExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; BF18BFEC24857D7900DD5981 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3264,6 +3553,33 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + B355DFB329209DB000E4C858 /* Build configuration list for PBXLegacyTarget "WireGuardGoBridgeiOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B355DFB429209DB000E4C858 /* Debug */, + B355DFB529209DB000E4C858 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B355DFB729209DD200E4C858 /* Build configuration list for PBXLegacyTarget "WireGuardGoBridgemacOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B355DFB829209DD200E4C858 /* Debug */, + B355DFB929209DD200E4C858 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B355DFC929209E2600E4C858 /* Build configuration list for PBXNativeTarget "WireguardNetworkExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B355DFCA29209E2600E4C858 /* Debug */, + B355DFCB29209E2600E4C858 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; BF18BFEB24857D7900DD5981 /* Build configuration list for PBXNativeTarget "AltDaemon" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3346,6 +3662,14 @@ minimumVersion = 1.1.180; }; }; + B355DFAF29209C6900E4C858 /* XCRemoteSwiftPackageReference "wireguard-apple" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/WireGuard/wireguard-apple"; + requirement = { + branch = master; + kind = branch; + }; + }; B3C395EF284F2DE700DA9E2F /* XCRemoteSwiftPackageReference "KeychainAccess" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess.git"; @@ -3417,6 +3741,16 @@ package = 4879A9602861049C00FC1BBD /* XCRemoteSwiftPackageReference "OpenSSL" */; productName = OpenSSL; }; + B355DFB029209C6900E4C858 /* WireGuardKit */ = { + isa = XCSwiftPackageProductDependency; + package = B355DFAF29209C6900E4C858 /* XCRemoteSwiftPackageReference "wireguard-apple" */; + productName = WireGuardKit; + }; + B355DFCE29209E4C00E4C858 /* WireGuardKit */ = { + isa = XCSwiftPackageProductDependency; + package = B355DFAF29209C6900E4C858 /* XCRemoteSwiftPackageReference "wireguard-apple" */; + productName = WireGuardKit; + }; B3C395F0284F2DE700DA9E2F /* KeychainAccess */ = { isa = XCSwiftPackageProductDependency; package = B3C395EF284F2DE700DA9E2F /* XCRemoteSwiftPackageReference "KeychainAccess" */; diff --git a/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index ce2c36c6..00000000 --- a/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,86 +0,0 @@ -{ - "pins" : [ - { - "identity" : "altsign", - "kind" : "remoteSourceControl", - "location" : "https://github.com/SideStore/AltSign", - "state" : { - "branch" : "master", - "revision" : "7e0e7edcf8fbc44ac1e35da3e9030a297aa18b84" - } - }, - { - "identity" : "appcenter-sdk-apple", - "kind" : "remoteSourceControl", - "location" : "https://github.com/microsoft/appcenter-sdk-apple.git", - "state" : { - "revision" : "8354a50fe01a7e54e196d3b5493b5ab53dd5866a", - "version" : "4.4.2" - } - }, - { - "identity" : "keychainaccess", - "kind" : "remoteSourceControl", - "location" : "https://github.com/kishikawakatsumi/KeychainAccess.git", - "state" : { - "revision" : "84e546727d66f1adc5439debad16270d0fdd04e7", - "version" : "4.2.2" - } - }, - { - "identity" : "launchatlogin", - "kind" : "remoteSourceControl", - "location" : "https://github.com/sindresorhus/LaunchAtLogin.git", - "state" : { - "revision" : "e8171b3e38a2816f579f58f3dac1522aa39efe41", - "version" : "4.2.0" - } - }, - { - "identity" : "nuke", - "kind" : "remoteSourceControl", - "location" : "https://github.com/kean/Nuke.git", - "state" : { - "revision" : "9318d02a8a6d20af56505c9673261c1fd3b3aebe", - "version" : "7.6.3" - } - }, - { - "identity" : "openssl", - "kind" : "remoteSourceControl", - "location" : "https://github.com/krzyzanowskim/OpenSSL", - "state" : { - "revision" : "033fcb41dac96b1b6effa945ca1f9ade002370b2", - "version" : "1.1.1501" - } - }, - { - "identity" : "plcrashreporter", - "kind" : "remoteSourceControl", - "location" : "https://github.com/microsoft/PLCrashReporter.git", - "state" : { - "revision" : "6b27393cad517c067dceea85fadf050e70c4ceaa", - "version" : "1.10.1" - } - }, - { - "identity" : "sparkle", - "kind" : "remoteSourceControl", - "location" : "https://github.com/sparkle-project/Sparkle.git", - "state" : { - "revision" : "286edd1fa22505a9e54d170e9fd07d775ea233f2", - "version" : "2.1.0" - } - }, - { - "identity" : "stprivilegedtask", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JoeMatt/STPrivilegedTask.git", - "state" : { - "branch" : "master", - "revision" : "10a9150ef32d444af326beba76356ae9af95a3e7" - } - } - ], - "version" : 2 -} diff --git a/AltStore/AltStore.entitlements b/AltStore/AltStore.entitlements index 2a941d95..d4723eeb 100644 --- a/AltStore/AltStore.entitlements +++ b/AltStore/AltStore.entitlements @@ -4,11 +4,35 @@ aps-environment development + com.apple.developer.associated-domains + + webcredentials:sidestore.io + + com.apple.developer.icloud-container-identifiers + + com.apple.developer.kernel.increased-memory-limit + + com.apple.developer.networking.multipath + + com.apple.developer.networking.vpn.api + + allow-vpn + + com.apple.developer.networking.wifi-info + + com.apple.developer.shared-with-you + com.apple.developer.siri + com.apple.developer.ubiquity-kvstore-identifier + $(TeamIdentifierPrefix)$(CFBundleIdentifier) com.apple.security.application-groups group.$(APP_GROUP_IDENTIFIER) + keychain-access-groups + + $(AppIdentifierPrefix)$(PRODUCT_BUNDLE_IDENTIFIER) + diff --git a/AltStore/Info.plist b/AltStore/Info.plist index 4e131842..24d3eb70 100644 --- a/AltStore/Info.plist +++ b/AltStore/Info.plist @@ -93,6 +93,40 @@ LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + 127.0.0.1 + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + New Exception Domain 1 + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + apps.sidestore.io + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + sidestore.io + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + + NSBonjourServices _altserver._tcp @@ -129,6 +163,7 @@ audio fetch + processing remote-notification UILaunchStoryboardName diff --git a/WireguardNetworkExtension/AppProxyProvider.swift b/WireguardNetworkExtension/AppProxyProvider.swift new file mode 100644 index 00000000..cdbd39aa --- /dev/null +++ b/WireguardNetworkExtension/AppProxyProvider.swift @@ -0,0 +1,42 @@ +// +// AppProxyProvider.swift +// WireguardNetworkExtension +// +// Created by Joseph Mattiello on 11/12/22. +// Copyright © 2022 Riley Testut. All rights reserved. +// + +import NetworkExtension + +class AppProxyProvider: NEAppProxyProvider { + + override func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void) { + // Add code here to start the process of connecting the tunnel. + } + + override func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { + // Add code here to start the process of stopping the tunnel. + completionHandler() + } + + override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)?) { + // Add code here to handle the message. + if let handler = completionHandler { + handler(messageData) + } + } + + override func sleep(completionHandler: @escaping() -> Void) { + // Add code here to get ready to sleep. + completionHandler() + } + + override func wake() { + // Add code here to wake up. + } + + override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool { + // Add code here to handle the incoming flow. + return false + } +} diff --git a/WireguardNetworkExtension/Info.plist b/WireguardNetworkExtension/Info.plist new file mode 100644 index 00000000..dd575d7f --- /dev/null +++ b/WireguardNetworkExtension/Info.plist @@ -0,0 +1,13 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.networkextension.app-proxy + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).AppProxyProvider + + + diff --git a/WireguardNetworkExtension/WireguardNetworkExtension.entitlements b/WireguardNetworkExtension/WireguardNetworkExtension.entitlements new file mode 100644 index 00000000..9a21f3d5 --- /dev/null +++ b/WireguardNetworkExtension/WireguardNetworkExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.com.joemattiello.AltStore + + +