From f270ecc537e6f7a6527acb9ff0ba4fec21ee246e Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Sat, 25 Feb 2023 01:37:52 -0500 Subject: [PATCH] Replace local code with updated Roxas and SideKit Signed-off-by: Joseph Mattello --- AltStore.xcodeproj/project.pbxproj | 192 +++---- .../xcshareddata/swiftpm/Package.resolved | 34 +- AltStoreCore/AltStoreCore.h | 2 - AltWidget/AltWidget.swift | 2 + Shared/Categories/NSError+ALTServerError.h | 72 --- Shared/Categories/NSError+ALTServerError.m | 316 ------------ Shared/Connections/ALTConnection.h | 23 - Shared/Connections/Connection.swift | 18 +- Shared/Connections/ConnectionManager.swift | 22 +- Shared/Connections/NetworkConnection.swift | 3 +- Shared/Connections/XPCConnection.swift | 3 +- .../ALTServerError+Conveniences.swift | 39 -- .../Server Protocol/CodableServerError.swift | 126 ----- Shared/Server Protocol/ServerProtocol.swift | 472 ------------------ 14 files changed, 124 insertions(+), 1200 deletions(-) delete mode 100644 Shared/Categories/NSError+ALTServerError.h delete mode 100644 Shared/Categories/NSError+ALTServerError.m delete mode 100644 Shared/Connections/ALTConnection.h delete mode 100644 Shared/Extensions/ALTServerError+Conveniences.swift delete mode 100644 Shared/Server Protocol/CodableServerError.swift delete mode 100644 Shared/Server Protocol/ServerProtocol.swift diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index f1d2c724..18477afa 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -22,8 +22,6 @@ 4879A95F2861046500FC1BBD /* AltSign in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A95E2861046500FC1BBD /* AltSign */; }; 4879A9622861049C00FC1BBD /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A9612861049C00FC1BBD /* OpenSSL */; }; 99C4EF4D2979132100CB538D /* SemanticVersion in Frameworks */ = {isa = PBXBuildFile; productRef = 99C4EF4C2979132100CB538D /* SemanticVersion */; }; - 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, ); }; }; 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 */; }; @@ -39,8 +37,15 @@ B343F883295F7C5D002B1159 /* thread.c in Sources */ = {isa = PBXBuildFile; fileRef = B343F879295F7C5D002B1159 /* thread.c */; }; B343F884295F7C5D002B1159 /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = B343F87A295F7C5D002B1159 /* utils.c */; }; B343F885295F7C5D002B1159 /* tlv.c in Sources */ = {isa = PBXBuildFile; fileRef = B343F87B295F7C5D002B1159 /* tlv.c */; }; + B34AFD0A29A9CEDD00E637B4 /* SideKit in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFD0929A9CEDD00E637B4 /* SideKit */; }; + B34AFD0D29A9CF4000E637B4 /* Roxas in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFD0C29A9CF4000E637B4 /* Roxas */; }; + B34AFD0F29A9CF4000E637B4 /* RoxasUI in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFD0E29A9CF4000E637B4 /* RoxasUI */; }; + B34AFD1129A9CF5C00E637B4 /* Roxas in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFD1029A9CF5C00E637B4 /* Roxas */; }; + B34AFD1429A9D31100E637B4 /* ServerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFD1229A9D2C100E637B4 /* ServerProtocol.swift */; }; + B34AFD1529A9D31200E637B4 /* ServerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFD1229A9D2C100E637B4 /* ServerProtocol.swift */; }; + B34AFD1729A9D9FC00E637B4 /* RoxasUI in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFD1629A9D9FC00E637B4 /* RoxasUI */; }; + B34AFD1929A9DB0200E637B4 /* SideKit in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFD1829A9DB0200E637B4 /* SideKit */; }; B376FE3E29258C8900E18883 /* OSLog+SideStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B376FE3D29258C8900E18883 /* OSLog+SideStore.swift */; }; - B39575F5284F29E20080B4FF /* Roxas.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B39575F4284F29E20080B4FF /* Roxas.framework */; }; B39F16132918D7C5002E9404 /* Consts.swift in Sources */ = {isa = PBXBuildFile; fileRef = B39F16122918D7C5002E9404 /* Consts.swift */; }; B39F16152918D7DA002E9404 /* Consts+Proxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B39F16142918D7DA002E9404 /* Consts+Proxy.swift */; }; B3C395F1284F2DE700DA9E2F /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = B3C395F0284F2DE700DA9E2F /* KeychainAccess */; }; @@ -54,8 +59,6 @@ BF0C4EBD22A1BD8B009A2DD7 /* AppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0C4EBC22A1BD8B009A2DD7 /* AppManager.swift */; }; BF0DCA662433BDF500E3A595 /* AnalyticsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0DCA652433BDF500E3A595 /* AnalyticsManager.swift */; }; BF10EB34248730750055E6DB /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF10EB33248730750055E6DB /* main.swift */; }; - BF1614F1250822F100767AEA /* Roxas.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFD247862284BB3B00981D42 /* Roxas.framework */; }; - BF1614F2250822F100767AEA /* Roxas.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BFD247862284BB3B00981D42 /* Roxas.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF18B0F122E25DF9005C4CF5 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF18B0F022E25DF9005C4CF5 /* ToastView.swift */; }; BF1FE358251A9FB000C3CE09 /* NSXPCConnection+MachServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1FE357251A9FB000C3CE09 /* NSXPCConnection+MachServices.swift */; }; BF1FE359251A9FB000C3CE09 /* NSXPCConnection+MachServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1FE357251A9FB000C3CE09 /* NSXPCConnection+MachServices.swift */; }; @@ -136,7 +139,6 @@ BF58048A246A28F9008AE704 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF580488246A28F9008AE704 /* LaunchScreen.storyboard */; }; BF580496246A3CB5008AE704 /* UIColor+AltBackup.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF580495246A3CB5008AE704 /* UIColor+AltBackup.swift */; }; BF580498246A3D19008AE704 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF580497246A3D19008AE704 /* UIKit.framework */; }; - BF58049B246A432D008AE704 /* NSError+AltStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF6C336124197D700034FD24 /* NSError+AltStore.swift */; }; BF663C4F2433ED8200DAA738 /* FileManager+DirectorySize.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF663C4E2433ED8200DAA738 /* FileManager+DirectorySize.swift */; }; BF66EE822501AE50007EE018 /* AltStoreCore.h in Headers */ = {isa = PBXBuildFile; fileRef = BF66EE802501AE50007EE018 /* AltStoreCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF66EE852501AE50007EE018 /* AltStoreCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF66EE7E2501AE50007EE018 /* AltStoreCore.framework */; }; @@ -182,7 +184,6 @@ BF66EEE92501AED0007EE018 /* JSONDecoder+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF66EEE52501AED0007EE018 /* JSONDecoder+Properties.swift */; }; BF66EEEA2501AED0007EE018 /* UIColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF66EEE62501AED0007EE018 /* UIColor+Hex.swift */; }; BF66EEEB2501AED0007EE018 /* UIApplication+AppExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF66EEE72501AED0007EE018 /* UIApplication+AppExtension.swift */; }; - BF6C336224197D700034FD24 /* NSError+AltStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF6C336124197D700034FD24 /* NSError+AltStore.swift */; }; BF6C8FAC242935ED00125131 /* NSAttributedString+Markdown.m in Sources */ = {isa = PBXBuildFile; fileRef = BF6C8FAA242935ED00125131 /* NSAttributedString+Markdown.m */; }; BF6C8FAE2429597900125131 /* BannerCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF6C8FAD2429597900125131 /* BannerCollectionViewCell.swift */; }; BF6C8FB02429599900125131 /* TextCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF6C8FAF2429599900125131 /* TextCollectionReusableView.swift */; }; @@ -213,21 +214,15 @@ BF9ABA4B22DD1380008935CF /* NavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF9ABA4A22DD137F008935CF /* NavigationBar.swift */; }; BF9ABA4D22DD16DE008935CF /* PillButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF9ABA4C22DD16DE008935CF /* PillButton.swift */; }; BFA8172B23C5633D001B5953 /* FetchAnisetteDataOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA8172A23C5633D001B5953 /* FetchAnisetteDataOperation.swift */; }; - BFAECC522501B0A400528F27 /* CodableServerError.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFD44605241188C300EAB90A /* CodableServerError.swift */; }; - BFAECC532501B0A400528F27 /* ServerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1E3128229F474900370A3C /* ServerProtocol.swift */; }; - BFAECC542501B0A400528F27 /* NSError+ALTServerError.m in Sources */ = {isa = PBXBuildFile; fileRef = BF1E314922A060F400370A3C /* NSError+ALTServerError.m */; }; BFAECC552501B0A400528F27 /* Connection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF18BFF624858BDE00DD5981 /* Connection.swift */; }; - BFAECC562501B0A400528F27 /* ALTServerError+Conveniences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF767CB2489AB5C0097E58C /* ALTServerError+Conveniences.swift */; }; BFAECC572501B0A400528F27 /* ConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF18BFF22485828200DD5981 /* ConnectionManager.swift */; }; BFAECC582501B0A400528F27 /* ALTConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = BF718BD723C93DB700A89F2D /* ALTConstants.m */; }; BFAECC592501B0A400528F27 /* Result+Conveniences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBAC8852295C90300587369 /* Result+Conveniences.swift */; }; BFAECC5A2501B0A400528F27 /* NetworkConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF767CD2489ABE90097E58C /* NetworkConnection.swift */; }; BFAECC5B2501B0A400528F27 /* Bundle+AltStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1E314122A05D4C00370A3C /* Bundle+AltStore.swift */; }; BFAECC5C2501B0A400528F27 /* CFNotificationName+AltStore.m in Sources */ = {isa = PBXBuildFile; fileRef = BF718BC823C919E300A89F2D /* CFNotificationName+AltStore.m */; }; - BFAECC5D2501B0BF00528F27 /* ALTConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = BF18BFFE2485A42800DD5981 /* ALTConnection.h */; settings = {ATTRIBUTES = (Public, ); }; }; BFAECC5E2501B0BF00528F27 /* CFNotificationName+AltStore.h in Headers */ = {isa = PBXBuildFile; fileRef = BF718BC723C919CC00A89F2D /* CFNotificationName+AltStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; BFAECC5F2501B0BF00528F27 /* ALTConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = BFD52BD222A06EFB000B7ED1 /* ALTConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BFAECC602501B0BF00528F27 /* NSError+ALTServerError.h in Headers */ = {isa = PBXBuildFile; fileRef = BF1E314822A060F400370A3C /* NSError+ALTServerError.h */; settings = {ATTRIBUTES = (Public, ); }; }; BFB39B5C252BC10E00D1BE50 /* Managed.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB39B5B252BC10E00D1BE50 /* Managed.swift */; }; BFB4323F22DE852000B7F8BC /* UpdateCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BFB4323E22DE852000B7F8BC /* UpdateCollectionViewCell.xib */; }; BFB6B21E231870160022A802 /* NewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB6B21D231870160022A802 /* NewsViewController.swift */; }; @@ -300,16 +295,12 @@ BFE60742231B07E6002B0E8E /* SettingsHeaderFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE60741231B07E6002B0E8E /* SettingsHeaderFooterView.swift */; }; BFE6325A22A83BEB00F30809 /* Authentication.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFE6325922A83BEB00F30809 /* Authentication.storyboard */; }; BFE6326C22A86FF300F30809 /* AuthenticationOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE6326B22A86FF300F30809 /* AuthenticationOperation.swift */; }; - BFECAC8824FD950E0077C41F /* CodableServerError.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFD44605241188C300EAB90A /* CodableServerError.swift */; }; BFECAC8924FD950E0077C41F /* ConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF18BFF22485828200DD5981 /* ConnectionManager.swift */; }; - BFECAC8A24FD950E0077C41F /* ALTServerError+Conveniences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF767CB2489AB5C0097E58C /* ALTServerError+Conveniences.swift */; }; - BFECAC8B24FD950E0077C41F /* ServerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1E3128229F474900370A3C /* ServerProtocol.swift */; }; BFECAC8D24FD950E0077C41F /* ALTConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = BF718BD723C93DB700A89F2D /* ALTConstants.m */; }; BFECAC8E24FD950E0077C41F /* Connection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF18BFF624858BDE00DD5981 /* Connection.swift */; }; BFECAC8F24FD950E0077C41F /* Result+Conveniences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBAC8852295C90300587369 /* Result+Conveniences.swift */; }; BFECAC9024FD950E0077C41F /* Bundle+AltStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1E314122A05D4C00370A3C /* Bundle+AltStore.swift */; }; BFECAC9524FD98BB0077C41F /* CFNotificationName+AltStore.m in Sources */ = {isa = PBXBuildFile; fileRef = BF718BC823C919E300A89F2D /* CFNotificationName+AltStore.m */; }; - BFECAC9624FD98BB0077C41F /* NSError+ALTServerError.m in Sources */ = {isa = PBXBuildFile; fileRef = BF1E314922A060F400370A3C /* NSError+ALTServerError.m */; }; BFF00D302501BD7D00746320 /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = BFF00D2F2501BD7D00746320 /* Intents.intentdefinition */; }; BFF00D322501BDA100746320 /* BackgroundRefreshAppsOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF00D312501BDA100746320 /* BackgroundRefreshAppsOperation.swift */; }; BFF00D342501BDCF00746320 /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF00D332501BDCF00746320 /* IntentHandler.swift */; }; @@ -366,27 +357,6 @@ remoteGlobalIDString = 191E5FAA290A5D92001A3B7C; remoteInfo = minimuxer; }; - B3146ECC284F580500BBC3FD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BFADAFF819AE7BB70050CF31; - remoteInfo = Roxas; - }; - B3146ECE284F580500BBC3FD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BF8624801BB742E700C12EEE; - remoteInfo = RoxasTV; - }; - B3146ED0284F580500BBC3FD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BFADB00319AE7BB80050CF31; - remoteInfo = RoxasTests; - }; B343F84B295F6321002B1159 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = B343F847295F6321002B1159 /* minimuxer.xcodeproj */; @@ -480,8 +450,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - B3146ED3284F581E00BBC3FD /* Roxas.framework in Embed Frameworks */, - BF1614F2250822F100767AEA /* Roxas.framework in Embed Frameworks */, BF66EE862501AE50007EE018 /* AltStoreCore.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -511,7 +479,6 @@ 191E5FD1290A651D001A3B7C /* jsmn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = jsmn.h; path = Dependencies/libplist/src/jsmn.h; sourceTree = SOURCE_ROOT; }; 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 = ""; }; 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; }; @@ -527,6 +494,7 @@ B343F87A295F7C5D002B1159 /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utils.c; sourceTree = ""; }; B343F87B295F7C5D002B1159 /* tlv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tlv.c; sourceTree = ""; }; B343F886295F7F9B002B1159 /* libfragmentzip.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libfragmentzip.xcodeproj; path = Dependencies/libfragmentzip/libfragmentzip.xcodeproj; sourceTree = ""; }; + B34AFD1229A9D2C100E637B4 /* ServerProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ServerProtocol.swift; path = ../../../../Downloads/ServerProtocol.swift; sourceTree = ""; }; B376FE3D29258C8900E18883 /* OSLog+SideStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OSLog+SideStore.swift"; sourceTree = ""; }; B39575F4284F29E20080B4FF /* Roxas.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Roxas.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B39F16122918D7C5002E9404 /* Consts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Consts.swift; sourceTree = ""; }; @@ -549,13 +517,9 @@ BF18BFE724857D7900DD5981 /* AltDaemon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = AltDaemon; sourceTree = BUILT_PRODUCTS_DIR; }; BF18BFF22485828200DD5981 /* ConnectionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionManager.swift; sourceTree = ""; }; BF18BFF624858BDE00DD5981 /* Connection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Connection.swift; sourceTree = ""; }; - BF18BFFE2485A42800DD5981 /* ALTConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALTConnection.h; sourceTree = ""; }; BF18C0032485B4DE00DD5981 /* AltDaemon-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AltDaemon-Bridging-Header.h"; sourceTree = ""; }; - BF1E3128229F474900370A3C /* ServerProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerProtocol.swift; sourceTree = ""; }; BF1E314122A05D4C00370A3C /* Bundle+AltStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+AltStore.swift"; sourceTree = ""; }; BF1E314722A060F300370A3C /* AltStore-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AltStore-Bridging-Header.h"; sourceTree = ""; }; - BF1E314822A060F400370A3C /* NSError+ALTServerError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSError+ALTServerError.h"; sourceTree = ""; }; - BF1E314922A060F400370A3C /* NSError+ALTServerError.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSError+ALTServerError.m"; sourceTree = ""; }; BF1FE357251A9FB000C3CE09 /* NSXPCConnection+MachServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSXPCConnection+MachServices.swift"; sourceTree = ""; }; BF219A7E22CAC431007676A6 /* AltStore.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AltStore.entitlements; sourceTree = ""; }; BF29012E2318F6B100D88A45 /* AppBannerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AppBannerView.xib; sourceTree = ""; }; @@ -691,7 +655,6 @@ BF66EEE62501AED0007EE018 /* UIColor+Hex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+Hex.swift"; sourceTree = ""; }; BF66EEE72501AED0007EE018 /* UIApplication+AppExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIApplication+AppExtension.swift"; sourceTree = ""; }; BF6A531F246DC1B0004F59C8 /* FileManager+SharedDirectories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileManager+SharedDirectories.swift"; sourceTree = ""; }; - BF6C336124197D700034FD24 /* NSError+AltStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSError+AltStore.swift"; sourceTree = ""; }; BF6C8FAA242935ED00125131 /* NSAttributedString+Markdown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSAttributedString+Markdown.m"; path = "Dependencies/MarkdownAttributedString/NSAttributedString+Markdown.m"; sourceTree = SOURCE_ROOT; }; BF6C8FAB242935ED00125131 /* NSAttributedString+Markdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSAttributedString+Markdown.h"; path = "Dependencies/MarkdownAttributedString/NSAttributedString+Markdown.h"; sourceTree = SOURCE_ROOT; }; BF6C8FAD2429597900125131 /* BannerCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BannerCollectionViewCell.swift; sourceTree = ""; }; @@ -755,7 +718,6 @@ BFD2478B2284C4C300981D42 /* AppIconImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIconImageView.swift; sourceTree = ""; }; BFD2478E2284C8F900981D42 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; BFD2479E2284FBD000981D42 /* UIColor+AltStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+AltStore.swift"; sourceTree = ""; }; - BFD44605241188C300EAB90A /* CodableServerError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableServerError.swift; sourceTree = ""; }; BFD52BD222A06EFB000B7ED1 /* ALTConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALTConstants.h; sourceTree = ""; }; BFD52BE522A1A9CA000B7ED1 /* ptrarray.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ptrarray.c; path = Dependencies/libplist/src/ptrarray.c; sourceTree = SOURCE_ROOT; }; BFD52BE622A1A9CA000B7ED1 /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = base64.c; path = Dependencies/libplist/src/base64.c; sourceTree = SOURCE_ROOT; }; @@ -817,7 +779,6 @@ BFF0B6972322CAB8007A79E1 /* InstructionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstructionsViewController.swift; sourceTree = ""; }; BFF0B6992322D7D0007A79E1 /* UIScreen+CompactHeight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScreen+CompactHeight.swift"; sourceTree = ""; }; BFF435D7255CBDAB00DD724F /* ALTApplication+AltStoreApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ALTApplication+AltStoreApp.swift"; sourceTree = ""; }; - BFF767CB2489AB5C0097E58C /* ALTServerError+Conveniences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ALTServerError+Conveniences.swift"; sourceTree = ""; }; BFF767CD2489ABE90097E58C /* NetworkConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkConnection.swift; sourceTree = ""; }; BFF7C906257844C900E55F36 /* AltXPCProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AltXPCProtocol.h; sourceTree = ""; }; BFF7EC4C25081E9300BDE521 /* AltStore 8.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "AltStore 8.xcdatamodel"; sourceTree = ""; }; @@ -894,10 +855,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B34AFD1929A9DB0200E637B4 /* SideKit in Frameworks */, B3C395F1284F2DE700DA9E2F /* KeychainAccess in Frameworks */, + B34AFD1729A9D9FC00E637B4 /* RoxasUI in Frameworks */, 99C4EF4D2979132100CB538D /* SemanticVersion in Frameworks */, + B34AFD1129A9CF5C00E637B4 /* Roxas in Frameworks */, 4879A95F2861046500FC1BBD /* AltSign in Frameworks */, - B39575F5284F29E20080B4FF /* Roxas.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -915,16 +878,17 @@ files = ( B33FFBA8295F8E98002259E6 /* libfragmentzip.a in Frameworks */, 191E6087290C7B50001A3B7C /* libminimuxer.a in Frameworks */, + B34AFD0F29A9CF4000E637B4 /* RoxasUI in Frameworks */, 191E5FB4290A5DA0001A3B7C /* libminimuxer.a in Frameworks */, 19104DBC2909C4E500C49C7B /* libEmotionalDamage.a in Frameworks */, 19104D952909BAEA00C49C7B /* libimobiledevice.a in Frameworks */, - B3146ED2284F581E00BBC3FD /* Roxas.framework in Frameworks */, D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */, B3C395F9284F362400DA9E2F /* AppCenterCrashes in Frameworks */, D533E8BE2727BBF800A9B5DD /* libcurl.a in Frameworks */, + B34AFD0A29A9CEDD00E637B4 /* SideKit in Frameworks */, 4879A9622861049C00FC1BBD /* OpenSSL in Frameworks */, B3C395F4284F35DD00DA9E2F /* Nuke in Frameworks */, - BF1614F1250822F100767AEA /* Roxas.framework in Frameworks */, + B34AFD0D29A9CF4000E637B4 /* Roxas in Frameworks */, B3C395F7284F362400DA9E2F /* AppCenterAnalytics in Frameworks */, BF66EE852501AE50007EE018 /* AltStoreCore.framework in Frameworks */, ); @@ -968,16 +932,6 @@ path = "libimobiledevice-glue/src"; sourceTree = ""; }; - B3146EC7284F580500BBC3FD /* Products */ = { - isa = PBXGroup; - children = ( - B3146ECD284F580500BBC3FD /* Roxas.framework */, - B3146ECF284F580500BBC3FD /* Roxas.framework */, - B3146ED1284F580500BBC3FD /* RoxasTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; B33FFB8F295F8CF2002259E6 /* Recovered References */ = { isa = PBXGroup; children = ( @@ -1044,21 +998,12 @@ path = AltDaemon; sourceTree = ""; }; - BF18BFFF2485A75F00DD5981 /* Server Protocol */ = { - isa = PBXGroup; - children = ( - BF1E3128229F474900370A3C /* ServerProtocol.swift */, - BFD44605241188C300EAB90A /* CodableServerError.swift */, - ); - path = "Server Protocol"; - sourceTree = ""; - }; BF1E315122A0616100370A3C /* Shared */ = { isa = PBXGroup; children = ( + B34AFD1229A9D2C100E637B4 /* ServerProtocol.swift */, BFD52BD222A06EFB000B7ED1 /* ALTConstants.h */, BF718BD723C93DB700A89F2D /* ALTConstants.m */, - BF18BFFF2485A75F00DD5981 /* Server Protocol */, BFF767CF2489AC240097E58C /* Connections */, BFF7C92D2578464D00E55F36 /* XPC */, BFF767C32489A6800097E58C /* Extensions */, @@ -1509,7 +1454,6 @@ 191E5FAC290A5D92001A3B7C /* minimuxer */, B343F886295F7F9B002B1159 /* libfragmentzip.xcodeproj */, BFD247852284BB3300981D42 /* Frameworks */, - B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */, BFD2476B2284B9A500981D42 /* Products */, B33FFB8F295F8CF2002259E6 /* Recovered References */, ); @@ -1715,10 +1659,8 @@ children = ( BFBAC8852295C90300587369 /* Result+Conveniences.swift */, BF1E314122A05D4C00370A3C /* Bundle+AltStore.swift */, - BFF767CB2489AB5C0097E58C /* ALTServerError+Conveniences.swift */, BF1FE357251A9FB000C3CE09 /* NSXPCConnection+MachServices.swift */, BFF435D7255CBDAB00DD724F /* ALTApplication+AltStoreApp.swift */, - BF6C336124197D700034FD24 /* NSError+AltStore.swift */, ); path = Extensions; sourceTree = ""; @@ -1726,8 +1668,6 @@ BFF767C42489A6980097E58C /* Categories */ = { isa = PBXGroup; children = ( - BF1E314822A060F400370A3C /* NSError+ALTServerError.h */, - BF1E314922A060F400370A3C /* NSError+ALTServerError.m */, BF718BC723C919CC00A89F2D /* CFNotificationName+AltStore.h */, BF718BC823C919E300A89F2D /* CFNotificationName+AltStore.m */, ); @@ -1738,7 +1678,6 @@ isa = PBXGroup; children = ( BF18BFF22485828200DD5981 /* ConnectionManager.swift */, - BF18BFFE2485A42800DD5981 /* ALTConnection.h */, BF18BFF624858BDE00DD5981 /* Connection.swift */, BFF767CD2489ABE90097E58C /* NetworkConnection.swift */, BFC712C12512D5F100AB5EBE /* XPCConnection.swift */, @@ -1822,9 +1761,7 @@ BF66EE952501AEBC007EE018 /* ALTSourceUserInfoKey.h in Headers */, BF66EE982501AEBC007EE018 /* ALTPatreonBenefitType.h in Headers */, BFAECC5F2501B0BF00528F27 /* ALTConstants.h in Headers */, - BFAECC5D2501B0BF00528F27 /* ALTConnection.h in Headers */, BF66EE942501AEBC007EE018 /* ALTAppPermission.h in Headers */, - BFAECC602501B0BF00528F27 /* NSError+ALTServerError.h in Headers */, BFAECC5E2501B0BF00528F27 /* CFNotificationName+AltStore.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1935,13 +1872,15 @@ buildRules = ( ); dependencies = ( - 99C4EF51297994E200CB538D /* PBXTargetDependency */, ); name = AltStoreCore; packageProductDependencies = ( B3C395F0284F2DE700DA9E2F /* KeychainAccess */, 4879A95E2861046500FC1BBD /* AltSign */, 99C4EF4C2979132100CB538D /* SemanticVersion */, + B34AFD1029A9CF5C00E637B4 /* Roxas */, + B34AFD1629A9D9FC00E637B4 /* RoxasUI */, + B34AFD1829A9DB0200E637B4 /* SideKit */, ); productName = AltStoreCore; productReference = BF66EE7E2501AE50007EE018 /* AltStoreCore.framework */; @@ -1990,6 +1929,9 @@ B3C395F6284F362400DA9E2F /* AppCenterAnalytics */, B3C395F8284F362400DA9E2F /* AppCenterCrashes */, 4879A9612861049C00FC1BBD /* OpenSSL */, + B34AFD0929A9CEDD00E637B4 /* SideKit */, + B34AFD0C29A9CF4000E637B4 /* Roxas */, + B34AFD0E29A9CF4000E637B4 /* RoxasUI */, ); productName = AltStore; productReference = BFD2476A2284B9A500981D42 /* SideStore.app */; @@ -2061,6 +2003,8 @@ 4879A95D2861046500FC1BBD /* XCRemoteSwiftPackageReference "AltSign" */, 4879A9602861049C00FC1BBD /* XCRemoteSwiftPackageReference "OpenSSL" */, 99C4EF472978D52400CB538D /* XCRemoteSwiftPackageReference "SemanticVersion" */, + B34AFD0829A9CEDD00E637B4 /* XCRemoteSwiftPackageReference "SideKit" */, + B34AFD0B29A9CF4000E637B4 /* XCRemoteSwiftPackageReference "Roxas" */, ); productRefGroup = BFD2476B2284B9A500981D42 /* Products */; projectDirPath = ""; @@ -2077,10 +2021,6 @@ ProductGroup = B343F848295F6321002B1159 /* Products */; ProjectRef = B343F847295F6321002B1159 /* minimuxer.xcodeproj */; }, - { - ProductGroup = B3146EC7284F580500BBC3FD /* Products */; - ProjectRef = B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */; - }, ); projectRoot = ""; targets = ( @@ -2097,27 +2037,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - B3146ECD284F580500BBC3FD /* Roxas.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Roxas.framework; - remoteRef = B3146ECC284F580500BBC3FD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - B3146ECF284F580500BBC3FD /* Roxas.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Roxas.framework; - remoteRef = B3146ECE284F580500BBC3FD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - B3146ED1284F580500BBC3FD /* RoxasTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RoxasTests.xctest; - remoteRef = B3146ED0284F580500BBC3FD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; B343F84C295F6321002B1159 /* libminimuxer_static.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -2245,16 +2164,13 @@ BF1FE358251A9FB000C3CE09 /* NSXPCConnection+MachServices.swift in Sources */, BFECAC8F24FD950E0077C41F /* Result+Conveniences.swift in Sources */, BF8CAE472489E772004D6CCE /* DaemonRequestHandler.swift in Sources */, - BFECAC8824FD950E0077C41F /* CodableServerError.swift in Sources */, + B34AFD1429A9D31100E637B4 /* ServerProtocol.swift in Sources */, BFC712C32512D5F100AB5EBE /* XPCConnection.swift in Sources */, BFC712C52512D5F100AB5EBE /* XPCConnectionHandler.swift in Sources */, - BFECAC8A24FD950E0077C41F /* ALTServerError+Conveniences.swift in Sources */, BFECAC8D24FD950E0077C41F /* ALTConstants.m in Sources */, BFECAC8924FD950E0077C41F /* ConnectionManager.swift in Sources */, BFECAC9524FD98BB0077C41F /* CFNotificationName+AltStore.m in Sources */, BFECAC8E24FD950E0077C41F /* Connection.swift in Sources */, - BFECAC8B24FD950E0077C41F /* ServerProtocol.swift in Sources */, - BFECAC9624FD98BB0077C41F /* NSError+ALTServerError.m in Sources */, BF10EB34248730750055E6DB /* main.swift in Sources */, BF8CAE462489E772004D6CCE /* AppManager.swift in Sources */, BFECAC9024FD950E0077C41F /* Bundle+AltStore.swift in Sources */, @@ -2339,7 +2255,6 @@ BF580482246A28F7008AE704 /* ViewController.swift in Sources */, BF44EEF0246B08BA002A52F2 /* BackupController.swift in Sources */, 03F06CD52942C27E001C4D68 /* Bundle+AltStore.swift in Sources */, - BF58049B246A432D008AE704 /* NSError+AltStore.swift in Sources */, BF58047E246A28F7008AE704 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2355,10 +2270,8 @@ BF66EECD2501AECA007EE018 /* StoreAppPolicy.swift in Sources */, BF66EEE82501AED0007EE018 /* UserDefaults+AltStore.swift in Sources */, BF340E9A250AD39500A192CB /* ViewApp.intentdefinition in Sources */, - BFAECC522501B0A400528F27 /* CodableServerError.swift in Sources */, BF66EE9E2501AEC1007EE018 /* Fetchable.swift in Sources */, BF66EEDF2501AECA007EE018 /* PatreonAccount.swift in Sources */, - BFAECC532501B0A400528F27 /* ServerProtocol.swift in Sources */, BFAECC572501B0A400528F27 /* ConnectionManager.swift in Sources */, BF66EE9D2501AEC1007EE018 /* AppProtocol.swift in Sources */, BFC712C42512D5F100AB5EBE /* XPCConnection.swift in Sources */, @@ -2366,6 +2279,7 @@ BF66EE8C2501AEB2007EE018 /* Keychain.swift in Sources */, BF66EED42501AECA007EE018 /* AltStore5ToAltStore6.xcmappingmodel in Sources */, BF66EE972501AEBC007EE018 /* ALTAppPermission.m in Sources */, + B34AFD1529A9D31200E637B4 /* ServerProtocol.swift in Sources */, BFAECC552501B0A400528F27 /* Connection.swift in Sources */, BF66EEDA2501AECA007EE018 /* RefreshAttempt.swift in Sources */, BF66EEA92501AEC5007EE018 /* Tier.swift in Sources */, @@ -2392,9 +2306,7 @@ BF66EED52501AECA007EE018 /* AltStore.xcdatamodeld in Sources */, BFAECC582501B0A400528F27 /* ALTConstants.m in Sources */, D5F99A1A28D12B1400476A16 /* StoreApp10ToStoreApp11Policy.swift in Sources */, - BFAECC562501B0A400528F27 /* ALTServerError+Conveniences.swift in Sources */, BFAECC592501B0A400528F27 /* Result+Conveniences.swift in Sources */, - BFAECC542501B0A400528F27 /* NSError+ALTServerError.m in Sources */, BF66EEE12501AECA007EE018 /* DatabaseManager.swift in Sources */, D52C08EE28AEC37A006C4AE5 /* AppVersion.swift in Sources */, BF66EEEA2501AED0007EE018 /* UIColor+Hex.swift in Sources */, @@ -2455,7 +2367,6 @@ BF8F69C422E662D300049BA1 /* AppViewController.swift in Sources */, BFF0B68E23219520007A79E1 /* PatreonViewController.swift in Sources */, BFF00D302501BD7D00746320 /* Intents.intentdefinition in Sources */, - BF6C336224197D700034FD24 /* NSError+AltStore.swift in Sources */, D5DAE0942804B0B80034D8D4 /* ScreenshotProcessor.swift in Sources */, BFD2476E2284B9A500981D42 /* AppDelegate.swift in Sources */, BF41B806233423AE00C593A3 /* TabBarController.swift in Sources */, @@ -2544,10 +2455,6 @@ isa = PBXTargetDependency; productRef = 191E5FD9290AFA49001A3B7C /* OpenSSL */; }; - 99C4EF51297994E200CB538D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - productRef = 99C4EF50297994E200CB538D /* SemanticVersion */; - }; B343F86F295F76FD002B1159 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "minimuxer-staticlib"; @@ -3351,6 +3258,22 @@ minimumVersion = 0.3.5; }; }; + B34AFD0829A9CEDD00E637B4 /* XCRemoteSwiftPackageReference "SideKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SideStore/SideKit.git"; + requirement = { + branch = feature/swiftall; + kind = branch; + }; + }; + B34AFD0B29A9CF4000E637B4 /* XCRemoteSwiftPackageReference "Roxas" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/JoeMatt/Roxas.git"; + requirement = { + branch = master; + kind = branch; + }; + }; B3C395EF284F2DE700DA9E2F /* XCRemoteSwiftPackageReference "KeychainAccess" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess.git"; @@ -3427,10 +3350,35 @@ package = 99C4EF472978D52400CB538D /* XCRemoteSwiftPackageReference "SemanticVersion" */; productName = SemanticVersion; }; - 99C4EF50297994E200CB538D /* SemanticVersion */ = { + B34AFD0929A9CEDD00E637B4 /* SideKit */ = { isa = XCSwiftPackageProductDependency; - package = 99C4EF472978D52400CB538D /* XCRemoteSwiftPackageReference "SemanticVersion" */; - productName = SemanticVersion; + package = B34AFD0829A9CEDD00E637B4 /* XCRemoteSwiftPackageReference "SideKit" */; + productName = SideKit; + }; + B34AFD0C29A9CF4000E637B4 /* Roxas */ = { + isa = XCSwiftPackageProductDependency; + package = B34AFD0B29A9CF4000E637B4 /* XCRemoteSwiftPackageReference "Roxas" */; + productName = Roxas; + }; + B34AFD0E29A9CF4000E637B4 /* RoxasUI */ = { + isa = XCSwiftPackageProductDependency; + package = B34AFD0B29A9CF4000E637B4 /* XCRemoteSwiftPackageReference "Roxas" */; + productName = RoxasUI; + }; + B34AFD1029A9CF5C00E637B4 /* Roxas */ = { + isa = XCSwiftPackageProductDependency; + package = B34AFD0B29A9CF4000E637B4 /* XCRemoteSwiftPackageReference "Roxas" */; + productName = Roxas; + }; + B34AFD1629A9D9FC00E637B4 /* RoxasUI */ = { + isa = XCSwiftPackageProductDependency; + package = B34AFD0B29A9CF4000E637B4 /* XCRemoteSwiftPackageReference "Roxas" */; + productName = RoxasUI; + }; + B34AFD1829A9DB0200E637B4 /* SideKit */ = { + isa = XCSwiftPackageProductDependency; + package = B34AFD0829A9CEDD00E637B4 /* XCRemoteSwiftPackageReference "SideKit" */; + productName = SideKit; }; B3C395F0284F2DE700DA9E2F /* KeychainAccess */ = { isa = XCSwiftPackageProductDependency; diff --git a/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 410b636e..6018bfbc 100644 --- a/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/microsoft/appcenter-sdk-apple.git", "state" : { - "revision" : "8354a50fe01a7e54e196d3b5493b5ab53dd5866a", - "version" : "4.4.2" + "revision" : "b2dc99cfedead0bad4e6573d86c5228c89cff332", + "version" : "4.4.3" } }, { @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/krzyzanowskim/OpenSSL", "state" : { - "revision" : "033fcb41dac96b1b6effa945ca1f9ade002370b2", - "version" : "1.1.1501" + "revision" : "87f41bf9488e7dd2b0de2ab97cb3eafc7304e0e6", + "version" : "1.1.2000" } }, { @@ -59,8 +59,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/microsoft/PLCrashReporter.git", "state" : { - "revision" : "6b27393cad517c067dceea85fadf050e70c4ceaa", - "version" : "1.10.1" + "revision" : "81cdec2b3827feb03286cb297f4c501a8eb98df1", + "version" : "1.10.2" + } + }, + { + "identity" : "roxas", + "kind" : "remoteSourceControl", + "location" : "https://github.com/JoeMatt/Roxas.git", + "state" : { + "branch" : "master", + "revision" : "17338c09ec0ffeea4c68135f17c1f801a3d6d10d" } }, { @@ -72,13 +81,22 @@ "version" : "0.3.5" } }, + { + "identity" : "sidekit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SideStore/SideKit.git", + "state" : { + "branch" : "feature/swiftall", + "revision" : "bf65f98dea41483544667de482ec6a866c7e84e6" + } + }, { "identity" : "sparkle", "kind" : "remoteSourceControl", "location" : "https://github.com/sparkle-project/Sparkle.git", "state" : { - "revision" : "286edd1fa22505a9e54d170e9fd07d775ea233f2", - "version" : "2.1.0" + "revision" : "dda155c7d3ef38c53d29f8584cb2aad2a1a54dba", + "version" : "2.3.2" } }, { diff --git a/AltStoreCore/AltStoreCore.h b/AltStoreCore/AltStoreCore.h index 73d95a9c..b9a1f388 100644 --- a/AltStoreCore/AltStoreCore.h +++ b/AltStoreCore/AltStoreCore.h @@ -22,6 +22,4 @@ FOUNDATION_EXPORT const unsigned char AltStoreCoreVersionString[]; // Shared #import -#import -#import #import diff --git a/AltWidget/AltWidget.swift b/AltWidget/AltWidget.swift index 62696399..29d6a526 100644 --- a/AltWidget/AltWidget.swift +++ b/AltWidget/AltWidget.swift @@ -14,6 +14,8 @@ import CoreData import AltStoreCore import AltSign +import RoxasUIKit + struct AppEntry: TimelineEntry { var date: Date diff --git a/Shared/Categories/NSError+ALTServerError.h b/Shared/Categories/NSError+ALTServerError.h deleted file mode 100644 index 4efa8105..00000000 --- a/Shared/Categories/NSError+ALTServerError.h +++ /dev/null @@ -1,72 +0,0 @@ -// -// NSError+ALTServerError.h -// AltStore -// -// Created by Riley Testut on 5/30/19. -// Copyright © 2019 Riley Testut. All rights reserved. -// - -#import - -extern NSErrorDomain const AltServerErrorDomain; -extern NSErrorDomain const AltServerInstallationErrorDomain; -extern NSErrorDomain const AltServerConnectionErrorDomain; - -extern NSErrorUserInfoKey const ALTUnderlyingErrorDomainErrorKey; -extern NSErrorUserInfoKey const ALTUnderlyingErrorCodeErrorKey; -extern NSErrorUserInfoKey const ALTProvisioningProfileBundleIDErrorKey; -extern NSErrorUserInfoKey const ALTAppNameErrorKey; -extern NSErrorUserInfoKey const ALTDeviceNameErrorKey; -extern NSErrorUserInfoKey const ALTOperatingSystemNameErrorKey; -extern NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey; - -typedef NS_ERROR_ENUM(AltServerErrorDomain, ALTServerError) -{ - ALTServerErrorUnderlyingError = -1, - - ALTServerErrorUnknown = 0, - ALTServerErrorConnectionFailed = 1, - ALTServerErrorLostConnection = 2, - - ALTServerErrorDeviceNotFound = 3, - ALTServerErrorDeviceWriteFailed = 4, - - ALTServerErrorInvalidRequest = 5, - ALTServerErrorInvalidResponse = 6, - - ALTServerErrorInvalidApp = 7, - ALTServerErrorInstallationFailed = 8, - ALTServerErrorMaximumFreeAppLimitReached = 9, - ALTServerErrorUnsupportediOSVersion = 10, - - ALTServerErrorUnknownRequest = 11, - ALTServerErrorUnknownResponse = 12, - - ALTServerErrorInvalidAnisetteData = 13, - ALTServerErrorPluginNotFound = 14, - - ALTServerErrorProfileNotFound = 15, - - ALTServerErrorAppDeletionFailed = 16, - - ALTServerErrorRequestedAppNotRunning = 100, - ALTServerErrorIncompatibleDeveloperDisk = 101 -}; - -typedef NS_ERROR_ENUM(AltServerConnectionErrorDomain, ALTServerConnectionError) -{ - ALTServerConnectionErrorUnknown, - ALTServerConnectionErrorDeviceLocked, - ALTServerConnectionErrorInvalidRequest, - ALTServerConnectionErrorInvalidResponse, - ALTServerConnectionErrorUsbmuxd, - ALTServerConnectionErrorSSL, - ALTServerConnectionErrorTimedOut, -}; - -NS_ASSUME_NONNULL_BEGIN - -@interface NSError (ALTServerError) -@end - -NS_ASSUME_NONNULL_END diff --git a/Shared/Categories/NSError+ALTServerError.m b/Shared/Categories/NSError+ALTServerError.m deleted file mode 100644 index 3f8c02cf..00000000 --- a/Shared/Categories/NSError+ALTServerError.m +++ /dev/null @@ -1,316 +0,0 @@ -// -// NSError+ALTServerError.m -// AltStore -// -// Created by Riley Testut on 5/30/19. -// Copyright © 2019 Riley Testut. All rights reserved. -// - -#import "NSError+ALTServerError.h" - -NSErrorDomain const AltServerErrorDomain = @"com.rileytestut.AltServer"; -NSErrorDomain const AltServerInstallationErrorDomain = @"com.rileytestut.AltServer.Installation"; -NSErrorDomain const AltServerConnectionErrorDomain = @"com.rileytestut.AltServer.Connection"; - -NSErrorUserInfoKey const ALTUnderlyingErrorDomainErrorKey = @"underlyingErrorDomain"; -NSErrorUserInfoKey const ALTUnderlyingErrorCodeErrorKey = @"underlyingErrorCode"; -NSErrorUserInfoKey const ALTProvisioningProfileBundleIDErrorKey = @"bundleIdentifier"; -NSErrorUserInfoKey const ALTAppNameErrorKey = @"appName"; -NSErrorUserInfoKey const ALTDeviceNameErrorKey = @"deviceName"; -NSErrorUserInfoKey const ALTOperatingSystemNameErrorKey = @"ALTOperatingSystemName"; -NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSystemVersion"; - -@implementation NSError (ALTServerError) - -+ (void)load -{ - [NSError setUserInfoValueProviderForDomain:AltServerErrorDomain provider:^id _Nullable(NSError * _Nonnull error, NSErrorUserInfoKey _Nonnull userInfoKey) { - if ([userInfoKey isEqualToString:NSLocalizedFailureReasonErrorKey]) - { - return [error altserver_localizedFailureReason]; - } - else if ([userInfoKey isEqualToString:NSLocalizedRecoverySuggestionErrorKey]) - { - return [error altserver_localizedRecoverySuggestion]; - } - else if ([userInfoKey isEqualToString:NSDebugDescriptionErrorKey]) - { - return [error altserver_localizedDebugDescription]; - } - - return nil; - }]; - - [NSError setUserInfoValueProviderForDomain:AltServerConnectionErrorDomain provider:^id _Nullable(NSError * _Nonnull error, NSErrorUserInfoKey _Nonnull userInfoKey) { - if ([userInfoKey isEqualToString:NSLocalizedDescriptionKey]) - { - return [error altserver_connection_localizedDescription]; - } - else if ([userInfoKey isEqualToString:NSLocalizedRecoverySuggestionErrorKey]) - { - return [error altserver_connection_localizedRecoverySuggestion]; - } - - return nil; - }]; -} - -- (nullable NSString *)altserver_localizedFailureReason -{ - switch ((ALTServerError)self.code) - { - case ALTServerErrorUnderlyingError: - { - NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey]; - if (underlyingError.localizedFailureReason != nil) - { - return underlyingError.localizedFailureReason; - } - - NSString *underlyingErrorCode = self.userInfo[ALTUnderlyingErrorCodeErrorKey]; - if (underlyingErrorCode != nil) - { - return [NSString stringWithFormat:NSLocalizedString(@"Error code: %@", @""), underlyingErrorCode]; - } - - return nil; - } - - case ALTServerErrorUnknown: - return NSLocalizedString(@"An unknown error occured.", @""); - - case ALTServerErrorConnectionFailed: -#if TARGET_OS_OSX - return NSLocalizedString(@"There was an error connecting to the device.", @""); -#else - return NSLocalizedString(@"Could not connect to SideStore.", @""); -#endif - - case ALTServerErrorLostConnection: - return NSLocalizedString(@"Lost connection to SideStore.", @""); - - case ALTServerErrorDeviceNotFound: - return NSLocalizedString(@"SideStore could not find this device.", @""); - - case ALTServerErrorDeviceWriteFailed: - return NSLocalizedString(@"Failed to write app data to device.", @""); - - case ALTServerErrorInvalidRequest: - return NSLocalizedString(@"SideStore received an invalid request.", @""); - - case ALTServerErrorInvalidResponse: - return NSLocalizedString(@"SideStore sent an invalid response.", @""); - - case ALTServerErrorInvalidApp: - return NSLocalizedString(@"The app is invalid.", @""); - - case ALTServerErrorInstallationFailed: - return NSLocalizedString(@"An error occured while installing the app.", @""); - - case ALTServerErrorMaximumFreeAppLimitReached: - return NSLocalizedString(@"Cannot activate more than 3 apps with a non-developer Apple ID.", @""); - - case ALTServerErrorUnsupportediOSVersion: - return NSLocalizedString(@"Your device must be running iOS 12.2 or later to install SideStore.", @""); - - case ALTServerErrorUnknownRequest: - return NSLocalizedString(@"SideStore does not support this request.", @""); - - case ALTServerErrorUnknownResponse: - return NSLocalizedString(@"Received an unknown response from SideStore.", @""); - - case ALTServerErrorInvalidAnisetteData: - return NSLocalizedString(@"The provided anisette data is invalid.", @""); - - case ALTServerErrorPluginNotFound: - return NSLocalizedString(@"AltServer could not connect to Mail plug-in.", @""); - - case ALTServerErrorProfileNotFound: - return [self profileErrorLocalizedDescriptionWithBaseDescription:NSLocalizedString(@"Could not find profile", "")]; - - case ALTServerErrorAppDeletionFailed: - return NSLocalizedString(@"An error occured while removing the app.", @""); - - case ALTServerErrorRequestedAppNotRunning: - { - NSString *appName = self.userInfo[ALTAppNameErrorKey] ?: NSLocalizedString(@"The requested app", @""); - NSString *deviceName = self.userInfo[ALTDeviceNameErrorKey] ?: NSLocalizedString(@"the device", @""); - return [NSString stringWithFormat:NSLocalizedString(@"%@ is not currently running on %@.", ""), appName, deviceName]; - } - - case ALTServerErrorIncompatibleDeveloperDisk: - { - NSString *osVersion = [self altserver_osVersion] ?: NSLocalizedString(@"this device's OS version", @""); - NSString *failureReason = [NSString stringWithFormat:NSLocalizedString(@"The disk is incompatible with %@.", @""), osVersion]; - return failureReason; - } - } - - return nil; -} - -- (nullable NSString *)altserver_localizedRecoverySuggestion -{ - switch ((ALTServerError)self.code) - { - case ALTServerErrorConnectionFailed: - case ALTServerErrorDeviceNotFound: - return NSLocalizedString(@"Make sure you have trusted this device with your computer and Wi-Fi sync is enabled.", @""); - - case ALTServerErrorPluginNotFound: - return NSLocalizedString(@"Mail has been automatically opened, try again in a moment. Otherwise, make sure plug-in is enabled in Mail's preferences.", @""); - - case ALTServerErrorMaximumFreeAppLimitReached: -#if TARGET_OS_OSX - return NSLocalizedString(@"Please deactivate a sideloaded app with SideStore in order to install another app.\n\nIf you're running iOS 13.5 or later, make sure 'Offload Unused Apps' is disabled in Settings > iTunes & App Stores, then install or delete all offloaded apps to prevent them from erroneously counting towards this limit.", @""); -#else - return NSLocalizedString(@"Please deactivate a sideloaded app in order to install another one.\n\nIf you're running iOS 13.5 or later, make sure “Offload Unused Apps” is disabled in Settings > iTunes & App Stores, then install or delete all offloaded apps.", @""); -#endif - - case ALTServerErrorRequestedAppNotRunning: - { - NSString *deviceName = self.userInfo[ALTDeviceNameErrorKey] ?: NSLocalizedString(@"your device", @""); - return [NSString stringWithFormat:NSLocalizedString(@"Make sure the app is running in the foreground on %@ then try again.", @""), deviceName]; - } - - default: - return nil; - } -} - -- (nullable NSString *)altserver_localizedDebugDescription -{ - switch ((ALTServerError)self.code) - { - case ALTServerErrorIncompatibleDeveloperDisk: - { - NSString *path = self.userInfo[NSFilePathErrorKey]; - if (path == nil) - { - return nil; - } - - NSString *osVersion = [self altserver_osVersion] ?: NSLocalizedString(@"this device's OS version", @""); - NSString *debugDescription = [NSString stringWithFormat:NSLocalizedString(@"The Developer disk located at\n\n%@\n\nis incompatible with %@.", @""), path, osVersion]; - return debugDescription; - } - - default: - return nil; - } -} - -- (NSString *)profileErrorLocalizedDescriptionWithBaseDescription:(NSString *)baseDescription -{ - NSString *localizedDescription = nil; - - NSString *bundleID = self.userInfo[ALTProvisioningProfileBundleIDErrorKey]; - if (bundleID) - { - localizedDescription = [NSString stringWithFormat:@"%@ “%@”", baseDescription, bundleID]; - } - else - { - localizedDescription = [NSString stringWithFormat:@"%@.", baseDescription]; - } - - return localizedDescription; -} - -- (nullable NSString *)altserver_osVersion -{ - NSString *osName = self.userInfo[ALTOperatingSystemNameErrorKey]; - NSString *versionString = self.userInfo[ALTOperatingSystemVersionErrorKey]; - if (osName == nil || versionString == nil) - { - return nil; - } - - NSString *osVersion = [NSString stringWithFormat:@"%@ %@", osName, versionString]; - return osVersion; -} - -#pragma mark - AltServerConnectionErrorDomain - - -- (nullable NSString *)altserver_connection_localizedDescription -{ - switch ((ALTServerConnectionError)self.code) - { - case ALTServerConnectionErrorUnknown: - { - NSString *underlyingErrorDomain = self.userInfo[ALTUnderlyingErrorDomainErrorKey]; - NSString *underlyingErrorCode = self.userInfo[ALTUnderlyingErrorCodeErrorKey]; - - if (underlyingErrorDomain != nil && underlyingErrorCode != nil) - { - return [NSString stringWithFormat:NSLocalizedString(@"%@ error %@.", @""), underlyingErrorDomain, underlyingErrorCode]; - } - else if (underlyingErrorCode != nil) - { - return [NSString stringWithFormat:NSLocalizedString(@"Connection error code: %@", @""), underlyingErrorCode]; - } - - return nil; - } - - case ALTServerConnectionErrorDeviceLocked: - { - NSString *deviceName = self.userInfo[ALTDeviceNameErrorKey] ?: NSLocalizedString(@"The device", @""); - return [NSString stringWithFormat:NSLocalizedString(@"%@ is currently locked.", @""), deviceName]; - } - - case ALTServerConnectionErrorInvalidRequest: - { - NSString *deviceName = self.userInfo[ALTDeviceNameErrorKey] ?: NSLocalizedString(@"The device", @""); - return [NSString stringWithFormat:NSLocalizedString(@"%@ received an invalid request from SideStore.", @""), deviceName]; - } - - case ALTServerConnectionErrorInvalidResponse: - { - NSString *deviceName = self.userInfo[ALTDeviceNameErrorKey] ?: NSLocalizedString(@"the device", @""); - return [NSString stringWithFormat:NSLocalizedString(@"SideStore received an invalid response from %@.", @""), deviceName]; - } - - case ALTServerConnectionErrorUsbmuxd: - { - return NSLocalizedString(@"There was an issue communicating with the usbmuxd daemon.", @""); - } - - case ALTServerConnectionErrorSSL: - { - NSString *deviceName = self.userInfo[ALTDeviceNameErrorKey] ?: NSLocalizedString(@"the device", @""); - return [NSString stringWithFormat:NSLocalizedString(@"SideStore could not establish a secure connection to %@.", @""), deviceName]; - } - - case ALTServerConnectionErrorTimedOut: - { - NSString *deviceName = self.userInfo[ALTDeviceNameErrorKey] ?: NSLocalizedString(@"the device", @""); - return [NSString stringWithFormat:NSLocalizedString(@"SideStore's connection to %@ timed out.", @""), deviceName]; - } - } - - return nil; -} - -- (nullable NSString *)altserver_connection_localizedRecoverySuggestion -{ - switch ((ALTServerConnectionError)self.code) - { - case ALTServerConnectionErrorDeviceLocked: - { - return NSLocalizedString(@"Please unlock the device with your passcode and try again.", @""); - } - - case ALTServerConnectionErrorUnknown: - case ALTServerConnectionErrorInvalidRequest: - case ALTServerConnectionErrorInvalidResponse: - case ALTServerConnectionErrorUsbmuxd: - case ALTServerConnectionErrorSSL: - case ALTServerConnectionErrorTimedOut: - { - return nil; - } - } -} - -@end diff --git a/Shared/Connections/ALTConnection.h b/Shared/Connections/ALTConnection.h deleted file mode 100644 index 348573d7..00000000 --- a/Shared/Connections/ALTConnection.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// ALTConnection.h -// AltKit -// -// Created by Riley Testut on 6/1/20. -// Copyright © 2020 Riley Testut. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -NS_SWIFT_NAME(Connection) -@protocol ALTConnection - -- (void)sendData:(NSData *)data completionHandler:(void (^)(BOOL, NSError * _Nullable))completionHandler NS_REFINED_FOR_SWIFT; -- (void)receiveDataWithExpectedSize:(NSInteger)expectedSize completionHandler:(void (^)(NSData * _Nullable, NSError * _Nullable))completionHandler NS_SWIFT_NAME(__receiveData(expectedSize:completionHandler:)); - -- (void)disconnect; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Shared/Connections/Connection.swift b/Shared/Connections/Connection.swift index 24388501..4fe7ba92 100644 --- a/Shared/Connections/Connection.swift +++ b/Shared/Connections/Connection.swift @@ -8,17 +8,19 @@ import Foundation import Network +import SideKit public extension Connection { func send(_ data: Data, completionHandler: @escaping (Result) -> Void) { self.__send(data) { (success, error) in - let result = Result(success, error).mapError { (error) -> ALTServerError in - guard let nwError = error as? NWError else { return ALTServerError(error) } - return ALTServerError(.lostConnection, underlyingError: nwError) + let result = Result(success, error).mapError { (failure :Error) -> ALTServerError in + guard let nwError = failure as? NWError else { return ALTServerError.init(failure) } + return ALTServerError.lostConnection(underlyingError: nwError) + } - + completionHandler(result) } } @@ -26,9 +28,9 @@ public extension Connection func receiveData(expectedSize: Int, completionHandler: @escaping (Result) -> Void) { self.__receiveData(expectedSize: expectedSize) { (data, error) in - let result = Result(data, error).mapError { (error) -> ALTServerError in - guard let nwError = error as? NWError else { return ALTServerError(error) } - return ALTServerError(.lostConnection, underlyingError: nwError) + let result = Result(data, error).mapError { (failure :Error) -> ALTServerError in + guard let nwError = failure as? NWError else { return ALTServerError.init(failure) } + return ALTServerError.lostConnection(underlyingError: nwError) } completionHandler(result) @@ -72,7 +74,7 @@ public extension Connection } catch { - finish(.failure(.init(.invalidResponse, underlyingError: error))) + finish(.failure(.invalidResponse(underlyingError: error))) } } diff --git a/Shared/Connections/ConnectionManager.swift b/Shared/Connections/ConnectionManager.swift index 7aacc9d2..ce18c155 100644 --- a/Shared/Connections/ConnectionManager.swift +++ b/Shared/Connections/ConnectionManager.swift @@ -8,6 +8,7 @@ import Foundation import Network +import SideKit public protocol RequestHandler { @@ -26,24 +27,25 @@ public protocol RequestHandler public protocol ConnectionHandler: AnyObject { - var connectionHandler: ((Connection) -> Void)? { get set } - var disconnectionHandler: ((Connection) -> Void)? { get set } + associatedtype ConnectionType = Connection + var connectionHandler: ((ConnectionType) -> Void)? { get set } + var disconnectionHandler: ((ConnectionType) -> Void)? { get set } func startListening() func stopListening() } -public class ConnectionManager +public class ConnectionManager where ConnectionHandlerType.ConnectionType == ConnectionType { public let requestHandler: RequestHandlerType - public let connectionHandlers: [ConnectionHandler] + public let connectionHandlers: [ConnectionHandlerType] public var isStarted = false - private var connections = [Connection]() + private var connections = [ConnectionType]() private let connectionsLock = NSLock() - public init(requestHandler: RequestHandlerType, connectionHandlers: [ConnectionHandler]) + public init(requestHandler: RequestHandlerType, connectionHandlers: [ConnectionHandlerType]) { self.requestHandler = requestHandler self.connectionHandlers = connectionHandlers @@ -87,7 +89,7 @@ public class ConnectionManager private extension ConnectionManager { - func prepare(_ connection: Connection) + func prepare(_ connection: ConnectionType) { self.connectionsLock.lock() defer { self.connectionsLock.unlock() } @@ -98,7 +100,7 @@ private extension ConnectionManager self.handleRequest(for: connection) } - func disconnect(_ connection: Connection) + func disconnect(_ connection: ConnectionType) { self.connectionsLock.lock() defer { self.connectionsLock.unlock() } @@ -107,7 +109,7 @@ private extension ConnectionManager self.connections.remove(at: index) } - func handleRequest(for connection: Connection) + func handleRequest(for connection: ConnectionType) { func finish(_ result: Result) { @@ -167,7 +169,7 @@ private extension ConnectionManager } case .success(.unknown): - finish(Result.failure(ALTServerError(.unknownRequest))) + finish(Result.failure(ALTServerError.unknownRequest)) } } } diff --git a/Shared/Connections/NetworkConnection.swift b/Shared/Connections/NetworkConnection.swift index 232b2a51..d4bb7a7c 100644 --- a/Shared/Connections/NetworkConnection.swift +++ b/Shared/Connections/NetworkConnection.swift @@ -8,6 +8,7 @@ import Foundation import Network +import SideKit public class NetworkConnection: NSObject, Connection { @@ -29,7 +30,7 @@ public class NetworkConnection: NSObject, Connection { self.nwConnection.receive(minimumIncompleteLength: expectedSize, maximumLength: expectedSize) { (data, context, isComplete, error) in guard data != nil || error != nil else { - return completionHandler(nil, ALTServerError(.lostConnection)) + return completionHandler(nil, ALTServerError.lostConnection(underlyingError: error)) } completionHandler(data, error) diff --git a/Shared/Connections/XPCConnection.swift b/Shared/Connections/XPCConnection.swift index 978cccb9..9463f09e 100644 --- a/Shared/Connections/XPCConnection.swift +++ b/Shared/Connections/XPCConnection.swift @@ -7,6 +7,7 @@ // import Foundation +import SideKit @objc private protocol XPCConnectionProxy { @@ -44,7 +45,7 @@ public class XPCConnection: NSObject, Connection super.init() xpcConnection.interruptionHandler = { - self.error = ALTServerError(.lostConnection) + self.error = ALTServerError.lostConnection(underlyingError: nil) } xpcConnection.exportedObject = self diff --git a/Shared/Extensions/ALTServerError+Conveniences.swift b/Shared/Extensions/ALTServerError+Conveniences.swift deleted file mode 100644 index 8ca47903..00000000 --- a/Shared/Extensions/ALTServerError+Conveniences.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// ALTServerError+Conveniences.swift -// AltKit -// -// Created by Riley Testut on 6/4/20. -// Copyright © 2020 Riley Testut. All rights reserved. -// - -import Foundation -import AltSign - -public extension ALTServerError -{ - init(_ error: E) - { - switch error - { - case let error as ALTServerError: self = error - case let error as ALTServerConnectionError: self = ALTServerError(.connectionFailed, underlyingError: error) - case let error as ALTAppleAPIError where error.code == .invalidAnisetteData: self = ALTServerError(.invalidAnisetteData, underlyingError: error) - case is DecodingError: self = ALTServerError(.invalidRequest, underlyingError: error) - case is EncodingError: self = ALTServerError(.invalidResponse, underlyingError: error) - case let error as NSError: - var userInfo = error.userInfo - if !userInfo.keys.contains(NSUnderlyingErrorKey) - { - // Assign underlying error (if there isn't already one). - userInfo[NSUnderlyingErrorKey] = error - } - - self = ALTServerError(.underlyingError, userInfo: userInfo) - } - } - - init(_ code: ALTServerError.Code, underlyingError: E) - { - self = ALTServerError(code, userInfo: [NSUnderlyingErrorKey: underlyingError]) - } -} diff --git a/Shared/Server Protocol/CodableServerError.swift b/Shared/Server Protocol/CodableServerError.swift deleted file mode 100644 index a9980dcb..00000000 --- a/Shared/Server Protocol/CodableServerError.swift +++ /dev/null @@ -1,126 +0,0 @@ -// -// CodableServerError.swift -// AltKit -// -// Created by Riley Testut on 3/5/20. -// Copyright © 2020 Riley Testut. All rights reserved. -// - -import Foundation - -// Can only automatically conform ALTServerError.Code to Codable, not ALTServerError itself -extension ALTServerError.Code: Codable {} - -extension CodableServerError -{ - enum UserInfoValue: Codable - { - case string(String) - case error(NSError) - - public init(from decoder: Decoder) throws - { - let container = try decoder.singleValueContainer() - - if - let data = try? container.decode(Data.self), - let error = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSError.self, from: data) - { - self = .error(error) - } - else if let string = try? container.decode(String.self) - { - self = .string(string) - } - else - { - throw DecodingError.dataCorruptedError(in: container, debugDescription: "UserInfoValue value cannot be decoded") - } - } - - func encode(to encoder: Encoder) throws - { - var container = encoder.singleValueContainer() - - switch self - { - case .string(let string): try container.encode(string) - case .error(let error): - guard let data = try? NSKeyedArchiver.archivedData(withRootObject: error, requiringSecureCoding: true) else { - let context = EncodingError.Context(codingPath: container.codingPath, debugDescription: "UserInfoValue value \(self) cannot be encoded") - throw EncodingError.invalidValue(self, context) - } - - try container.encode(data) - } - } - } -} - -struct CodableServerError: Codable -{ - var error: ALTServerError { - return ALTServerError(self.errorCode, userInfo: self.userInfo ?? [:]) - } - - private var errorCode: ALTServerError.Code - private var userInfo: [String: Any]? - - private enum CodingKeys: String, CodingKey - { - case errorCode - case userInfo - } - - init(error: ALTServerError) - { - self.errorCode = error.code - - var userInfo = error.userInfo - if let localizedRecoverySuggestion = (error as NSError).localizedRecoverySuggestion - { - userInfo[NSLocalizedRecoverySuggestionErrorKey] = localizedRecoverySuggestion - } - - if !userInfo.isEmpty - { - self.userInfo = userInfo - } - } - - init(from decoder: Decoder) throws - { - let container = try decoder.container(keyedBy: CodingKeys.self) - - let errorCode = try container.decode(Int.self, forKey: .errorCode) - self.errorCode = ALTServerError.Code(rawValue: errorCode) ?? .unknown - - let rawUserInfo = try container.decodeIfPresent([String: UserInfoValue].self, forKey: .userInfo) - - let userInfo = rawUserInfo?.mapValues { (value) -> Any in - switch value - { - case .string(let string): return string - case .error(let error): return error - } - } - self.userInfo = userInfo - } - - func encode(to encoder: Encoder) throws - { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self.error.code.rawValue, forKey: .errorCode) - - let rawUserInfo = self.userInfo?.compactMapValues { (value) -> UserInfoValue? in - switch value - { - case let string as String: return .string(string) - case let error as NSError: return .error(error) - default: return nil - } - } - try container.encodeIfPresent(rawUserInfo, forKey: .userInfo) - } -} - diff --git a/Shared/Server Protocol/ServerProtocol.swift b/Shared/Server Protocol/ServerProtocol.swift deleted file mode 100644 index cbe9d857..00000000 --- a/Shared/Server Protocol/ServerProtocol.swift +++ /dev/null @@ -1,472 +0,0 @@ -// -// ServerProtocol.swift -// AltServer -// -// Created by Riley Testut on 5/24/19. -// Copyright © 2019 Riley Testut. All rights reserved. -// - -import Foundation -import AltSign - -public let ALTServerServiceType = "_altserver._tcp" - -protocol ServerMessageProtocol: Codable -{ - var version: Int { get } - var identifier: String { get } -} - -public enum ServerRequest: Decodable -{ - case anisetteData(AnisetteDataRequest) - case prepareApp(PrepareAppRequest) - case beginInstallation(BeginInstallationRequest) - case installProvisioningProfiles(InstallProvisioningProfilesRequest) - case removeProvisioningProfiles(RemoveProvisioningProfilesRequest) - case removeApp(RemoveAppRequest) - case enableUnsignedCodeExecution(EnableUnsignedCodeExecutionRequest) - case unknown(identifier: String, version: Int) - - var identifier: String { - switch self - { - case .anisetteData(let request): return request.identifier - case .prepareApp(let request): return request.identifier - case .beginInstallation(let request): return request.identifier - case .installProvisioningProfiles(let request): return request.identifier - case .removeProvisioningProfiles(let request): return request.identifier - case .removeApp(let request): return request.identifier - case .enableUnsignedCodeExecution(let request): return request.identifier - case .unknown(let identifier, _): return identifier - } - } - - var version: Int { - switch self - { - case .anisetteData(let request): return request.version - case .prepareApp(let request): return request.version - case .beginInstallation(let request): return request.version - case .installProvisioningProfiles(let request): return request.version - case .removeProvisioningProfiles(let request): return request.version - case .removeApp(let request): return request.version - case .enableUnsignedCodeExecution(let request): return request.version - case .unknown(_, let version): return version - } - } - - private enum CodingKeys: String, CodingKey - { - case identifier - case version - } - - public init(from decoder: Decoder) throws - { - let container = try decoder.container(keyedBy: CodingKeys.self) - - let version = try container.decode(Int.self, forKey: .version) - - let identifier = try container.decode(String.self, forKey: .identifier) - switch identifier - { - case "AnisetteDataRequest": - let request = try AnisetteDataRequest(from: decoder) - self = .anisetteData(request) - - case "PrepareAppRequest": - let request = try PrepareAppRequest(from: decoder) - self = .prepareApp(request) - - case "BeginInstallationRequest": - let request = try BeginInstallationRequest(from: decoder) - self = .beginInstallation(request) - - case "InstallProvisioningProfilesRequest": - let request = try InstallProvisioningProfilesRequest(from: decoder) - self = .installProvisioningProfiles(request) - - case "RemoveProvisioningProfilesRequest": - let request = try RemoveProvisioningProfilesRequest(from: decoder) - self = .removeProvisioningProfiles(request) - - case "RemoveAppRequest": - let request = try RemoveAppRequest(from: decoder) - self = .removeApp(request) - - case "EnableUnsignedCodeExecutionRequest": - let request = try EnableUnsignedCodeExecutionRequest(from: decoder) - self = .enableUnsignedCodeExecution(request) - - default: - self = .unknown(identifier: identifier, version: version) - } - } -} - -public enum ServerResponse: Decodable -{ - case anisetteData(AnisetteDataResponse) - case installationProgress(InstallationProgressResponse) - case installProvisioningProfiles(InstallProvisioningProfilesResponse) - case removeProvisioningProfiles(RemoveProvisioningProfilesResponse) - case removeApp(RemoveAppResponse) - case enableUnsignedCodeExecution(EnableUnsignedCodeExecutionResponse) - case error(ErrorResponse) - case unknown(identifier: String, version: Int) - - var identifier: String { - switch self - { - case .anisetteData(let response): return response.identifier - case .installationProgress(let response): return response.identifier - case .installProvisioningProfiles(let response): return response.identifier - case .removeProvisioningProfiles(let response): return response.identifier - case .removeApp(let response): return response.identifier - case .enableUnsignedCodeExecution(let response): return response.identifier - case .error(let response): return response.identifier - case .unknown(let identifier, _): return identifier - } - } - - var version: Int { - switch self - { - case .anisetteData(let response): return response.version - case .installationProgress(let response): return response.version - case .installProvisioningProfiles(let response): return response.version - case .removeProvisioningProfiles(let response): return response.version - case .removeApp(let response): return response.version - case .enableUnsignedCodeExecution(let response): return response.version - case .error(let response): return response.version - case .unknown(_, let version): return version - } - } - - private enum CodingKeys: String, CodingKey - { - case identifier - case version - } - - public init(from decoder: Decoder) throws - { - let container = try decoder.container(keyedBy: CodingKeys.self) - - let version = try container.decode(Int.self, forKey: .version) - - let identifier = try container.decode(String.self, forKey: .identifier) - switch identifier - { - case "AnisetteDataResponse": - let response = try AnisetteDataResponse(from: decoder) - self = .anisetteData(response) - - case "InstallationProgressResponse": - let response = try InstallationProgressResponse(from: decoder) - self = .installationProgress(response) - - case "InstallProvisioningProfilesResponse": - let response = try InstallProvisioningProfilesResponse(from: decoder) - self = .installProvisioningProfiles(response) - - case "RemoveProvisioningProfilesResponse": - let response = try RemoveProvisioningProfilesResponse(from: decoder) - self = .removeProvisioningProfiles(response) - - case "RemoveAppResponse": - let response = try RemoveAppResponse(from: decoder) - self = .removeApp(response) - - case "EnableUnsignedCodeExecutionResponse": - let response = try EnableUnsignedCodeExecutionResponse(from: decoder) - self = .enableUnsignedCodeExecution(response) - - case "ErrorResponse": - let response = try ErrorResponse(from: decoder) - self = .error(response) - - default: - self = .unknown(identifier: identifier, version: version) - } - } -} - -// _Don't_ provide generic SuccessResponse, as that would prevent us -// from easily changing response format for a request in the future. -public struct ErrorResponse: ServerMessageProtocol -{ - public var version = 2 - public var identifier = "ErrorResponse" - - public var error: ALTServerError { - return self.serverError?.error ?? ALTServerError(self.errorCode) - } - private var serverError: CodableServerError? - - // Legacy (v1) - private var errorCode: ALTServerError.Code - - public init(error: ALTServerError) - { - self.serverError = CodableServerError(error: error) - self.errorCode = error.code - } -} - -public struct AnisetteDataRequest: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "AnisetteDataRequest" - - public init() - { - } -} - -public struct AnisetteDataResponse: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "AnisetteDataResponse" - - public var anisetteData: ALTAnisetteData - - private enum CodingKeys: String, CodingKey - { - case identifier - case version - case anisetteData - } - - public init(anisetteData: ALTAnisetteData) - { - self.anisetteData = anisetteData - } - - public init(from decoder: Decoder) throws - { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.version = try container.decode(Int.self, forKey: .version) - self.identifier = try container.decode(String.self, forKey: .identifier) - - let json = try container.decode([String: String].self, forKey: .anisetteData) - - if let anisetteData = ALTAnisetteData(json: json) - { - self.anisetteData = anisetteData - } - else - { - throw DecodingError.dataCorruptedError(forKey: CodingKeys.anisetteData, in: container, debugDescription: "Couuld not parse anisette data from JSON") - } - } - - public func encode(to encoder: Encoder) throws - { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self.version, forKey: .version) - try container.encode(self.identifier, forKey: .identifier) - - let json = self.anisetteData.json() - try container.encode(json, forKey: .anisetteData) - } -} - -public struct PrepareAppRequest: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "PrepareAppRequest" - - public var udid: String - public var contentSize: Int - - public var fileURL: URL? - - public init(udid: String, contentSize: Int, fileURL: URL? = nil) - { - self.udid = udid - self.contentSize = contentSize - self.fileURL = fileURL - } -} - -public struct BeginInstallationRequest: ServerMessageProtocol -{ - public var version = 3 - public var identifier = "BeginInstallationRequest" - - // If activeProfiles is non-nil, then AltServer should remove all profiles except active ones. - public var activeProfiles: Set? - - public var bundleIdentifier: String? - - public init(activeProfiles: Set?, bundleIdentifier: String?) - { - self.activeProfiles = activeProfiles - self.bundleIdentifier = bundleIdentifier - print("BeginInstallationRequest `activeProfiles`: \(String(describing: activeProfiles))") - print("BeginInstallationRequest `bundleIdentifier`: \(String(describing: bundleIdentifier))") - } -} - -public struct InstallationProgressResponse: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "InstallationProgressResponse" - - public var progress: Double - - public init(progress: Double) - { - self.progress = progress - } -} - -public struct InstallProvisioningProfilesRequest: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "InstallProvisioningProfilesRequest" - - public var udid: String - public var provisioningProfiles: Set - - // If activeProfiles is non-nil, then AltServer should remove all profiles except active ones. - public var activeProfiles: Set? - - private enum CodingKeys: String, CodingKey - { - case identifier - case version - case udid - case provisioningProfiles - case activeProfiles - } - - public init(udid: String, provisioningProfiles: Set, activeProfiles: Set?) - { - self.udid = udid - self.provisioningProfiles = provisioningProfiles - self.activeProfiles = activeProfiles - print("InstallProvisioningProfilesRequest `self.udid`: \(self.udid)") - print("InstallProvisioningProfilesRequest `self.provisioningProfiles`: \(self.provisioningProfiles)") - print("InstallProvisioningProfilesRequest `self.activeProfiles`: \(String(describing: self.activeProfiles))") - } - - public init(from decoder: Decoder) throws - { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.version = try container.decode(Int.self, forKey: .version) - self.identifier = try container.decode(String.self, forKey: .identifier) - self.udid = try container.decode(String.self, forKey: .udid) - - let rawProvisioningProfiles = try container.decode([Data].self, forKey: .provisioningProfiles) - let provisioningProfiles = try rawProvisioningProfiles.map { (data) -> ALTProvisioningProfile in - guard let profile = ALTProvisioningProfile(data: data) else { - throw DecodingError.dataCorruptedError(forKey: CodingKeys.provisioningProfiles, in: container, debugDescription: "Could not parse provisioning profile from data.") - } - return profile - } - - self.provisioningProfiles = Set(provisioningProfiles) - self.activeProfiles = try container.decodeIfPresent(Set.self, forKey: .activeProfiles) - } - - public func encode(to encoder: Encoder) throws - { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self.version, forKey: .version) - try container.encode(self.identifier, forKey: .identifier) - try container.encode(self.udid, forKey: .udid) - - try container.encode(self.provisioningProfiles.map { $0.data }, forKey: .provisioningProfiles) - try container.encodeIfPresent(self.activeProfiles, forKey: .activeProfiles) - } -} - -public struct InstallProvisioningProfilesResponse: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "InstallProvisioningProfilesResponse" - - public init() - { - } -} - -public struct RemoveProvisioningProfilesRequest: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "RemoveProvisioningProfilesRequest" - - public var udid: String - public var bundleIdentifiers: Set - - public init(udid: String, bundleIdentifiers: Set) - { - self.udid = udid - self.bundleIdentifiers = bundleIdentifiers - } -} - -public struct RemoveProvisioningProfilesResponse: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "RemoveProvisioningProfilesResponse" - - public init() - { - } -} - -public struct RemoveAppRequest: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "RemoveAppRequest" - - public var udid: String - public var bundleIdentifier: String - - public init(udid: String, bundleIdentifier: String) - { - self.udid = udid - self.bundleIdentifier = bundleIdentifier - } -} - -public struct RemoveAppResponse: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "RemoveAppResponse" - - public init() - { - } -} - -public struct EnableUnsignedCodeExecutionRequest: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "EnableUnsignedCodeExecutionRequest" - - public var udid: String - public var processID: Int? - public var processName: String? - - public init(udid: String, processID: Int? = nil, processName: String? = nil) - { - self.udid = udid - self.processID = processID - self.processName = processName - } -} - -public struct EnableUnsignedCodeExecutionResponse: ServerMessageProtocol -{ - public var version = 1 - public var identifier = "EnableUnsignedCodeExecutionResponse" - - public init() - { - } -}