diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 42bd4e65..0fdccf52 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -266,9 +266,6 @@ 7267E5F91D3D92DA00D1BF90 /* Autoupdate in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72B398D21D3D879300EE297F /* Autoupdate */; }; 7267E5FA1D3DAC3600D1BF90 /* StatusInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5A41D3D8A8A00D1BF90 /* StatusInfo.m */; }; 7267E5FD1D3DD1B700D1BF90 /* SPUResumableUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5FB1D3DD1B700D1BF90 /* SPUResumableUpdate.h */; }; - 7267E5FE1D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUResumableUpdate.m */; }; - 7267E5FF1D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUResumableUpdate.m */; }; - 7267E6001D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUResumableUpdate.m */; }; 726DF88E1C84277600188804 /* SPUStatusCompletionResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88D1C84277500188804 /* SPUStatusCompletionResults.h */; settings = {ATTRIBUTES = (Public, ); }; }; 726E075C1CA3A6D6001A286B /* SPUSecureCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E075A1CA3A6D6001A286B /* SPUSecureCoding.h */; }; 726E075D1CA3A6D6001A286B /* SPUSecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075B1CA3A6D6001A286B /* SPUSecureCoding.m */; }; @@ -338,7 +335,6 @@ 72A5D5D01D6929F80009E5AC /* SPUDownloadDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7229E1BC1C98EFF200CB50D0 /* SPUDownloadDriver.m */; }; 72A5D5D11D6929F80009E5AC /* SUAppcastDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B767C91C9B707000A07552 /* SUAppcastDriver.m */; }; 72A5D5D21D6929F80009E5AC /* SPUProbeInstallStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 728337A51C9E6FF40085AA99 /* SPUProbeInstallStatus.m */; }; - 72A5D5D31D6929F80009E5AC /* SPUResumableUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUResumableUpdate.m */; }; 72A5D5D41D6929F80009E5AC /* SPUUpdater.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E409C4CE3C00B25A18 /* SPUUpdater.m */; }; 72A5D5D51D6929F80009E5AC /* SPUUpdaterSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E078C1CA891E9001A286B /* SPUUpdaterSettings.m */; }; 72A5D5D61D6929F80009E5AC /* SPUUpdatePermissionRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 72DBA37C1D60CC34002594A8 /* SPUUpdatePermissionRequest.m */; }; @@ -377,6 +373,13 @@ 72B09CE71CE6BCBD0052EF9E /* SPUURLDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B09CE51CE6BCBD0052EF9E /* SPUURLDownload.h */; }; 72B09CE81CE6BCBD0052EF9E /* SPUURLDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B09CE61CE6BCBD0052EF9E /* SPUURLDownload.m */; }; 72B09CEC1CEA18900052EF9E /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 72B09CE91CEA18900052EF9E /* bscommon.c */; }; + 72B3DEC91E23472200457642 /* SPUDownloadedUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B3DEC71E23472200457642 /* SPUDownloadedUpdate.h */; }; + 72B3DECA1E23472200457642 /* SPUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B3DEC81E23472200457642 /* SPUDownloadedUpdate.m */; }; + 72B3DECD1E23479000457642 /* SPUInformationalUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B3DECB1E23479000457642 /* SPUInformationalUpdate.h */; }; + 72B3DECE1E23479000457642 /* SPUInformationalUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B3DECB1E23479000457642 /* SPUInformationalUpdate.h */; }; + 72B3DECF1E23479000457642 /* SPUInformationalUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B3DECC1E23479000457642 /* SPUInformationalUpdate.m */; }; + 72B3DED01E23479000457642 /* SPUInformationalUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B3DECC1E23479000457642 /* SPUInformationalUpdate.m */; }; + 72B3DED11E23479D00457642 /* SPUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B3DEC81E23472200457642 /* SPUDownloadedUpdate.m */; }; 72B4BF091D69805900F5B92D /* Sparkle.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8220A321A7F00D8810D /* Sparkle.strings */; }; 72B767CA1C9B707000A07552 /* SUAppcastDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B767C81C9B707000A07552 /* SUAppcastDriver.h */; }; 72B767CB1C9B707000A07552 /* SUAppcastDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B767C91C9B707000A07552 /* SUAppcastDriver.m */; }; @@ -1080,7 +1083,6 @@ 7267E5E31D3D90AA00D1BF90 /* SUFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileManager.h; sourceTree = ""; }; 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUFileManager.m; sourceTree = ""; }; 7267E5FB1D3DD1B700D1BF90 /* SPUResumableUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUResumableUpdate.h; sourceTree = ""; }; - 7267E5FC1D3DD1B700D1BF90 /* SPUResumableUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUResumableUpdate.m; sourceTree = ""; }; 726B2B5D1C645FC900388755 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 726DF88D1C84277500188804 /* SPUStatusCompletionResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUStatusCompletionResults.h; sourceTree = ""; }; 726E075A1CA3A6D6001A286B /* SPUSecureCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SPUSecureCoding.h; path = Sparkle/SPUSecureCoding.h; sourceTree = SOURCE_ROOT; }; @@ -1137,6 +1139,10 @@ 72B09CE91CEA18900052EF9E /* bscommon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bscommon.c; sourceTree = ""; }; 72B09CEA1CEA18900052EF9E /* bscommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bscommon.h; sourceTree = ""; }; 72B398D21D3D879300EE297F /* Autoupdate */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Autoupdate; sourceTree = BUILT_PRODUCTS_DIR; }; + 72B3DEC71E23472200457642 /* SPUDownloadedUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUDownloadedUpdate.h; sourceTree = ""; }; + 72B3DEC81E23472200457642 /* SPUDownloadedUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUDownloadedUpdate.m; sourceTree = ""; }; + 72B3DECB1E23479000457642 /* SPUInformationalUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUInformationalUpdate.h; sourceTree = ""; }; + 72B3DECC1E23479000457642 /* SPUInformationalUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUInformationalUpdate.m; sourceTree = ""; }; 72B767C81C9B707000A07552 /* SUAppcastDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAppcastDriver.h; sourceTree = ""; }; 72B767C91C9B707000A07552 /* SUAppcastDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAppcastDriver.m; sourceTree = ""; }; 72B767CC1C9B924900A07552 /* SPUInstallerDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUInstallerDriver.h; sourceTree = ""; }; @@ -1738,7 +1744,10 @@ 7229E1BB1C98EFF200CB50D0 /* SPUDownloadDriver.h */, 7229E1BC1C98EFF200CB50D0 /* SPUDownloadDriver.m */, 7267E5FB1D3DD1B700D1BF90 /* SPUResumableUpdate.h */, - 7267E5FC1D3DD1B700D1BF90 /* SPUResumableUpdate.m */, + 72B3DEC71E23472200457642 /* SPUDownloadedUpdate.h */, + 72B3DEC81E23472200457642 /* SPUDownloadedUpdate.m */, + 72B3DECB1E23479000457642 /* SPUInformationalUpdate.h */, + 72B3DECC1E23479000457642 /* SPUInformationalUpdate.m */, 72B767CC1C9B924900A07552 /* SPUInstallerDriver.h */, 72B767CD1C9B924900A07552 /* SPUInstallerDriver.m */, 728337A41C9E6FF40085AA99 /* SPUProbeInstallStatus.h */, @@ -2041,6 +2050,7 @@ buildActionMask = 2147483647; files = ( 72A5D5DE1D692ACC0009E5AC /* SparkleCore.h in Headers */, + 72B3DECE1E23479000457642 /* SPUInformationalUpdate.h in Headers */, 72A5D5EB1D692BD40009E5AC /* SPUDownloadData.h in Headers */, 72A5D5F91D692F4C0009E5AC /* SPUStatusCompletionResults.h in Headers */, 72A5D5E71D692BB00009E5AC /* SPUUpdatePermissionRequest.h in Headers */, @@ -2106,9 +2116,11 @@ 55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */, 14652F8419A978C200959E44 /* SUExport.h in Headers */, 7267E5E51D3D90AA00D1BF90 /* SUFileManager.h in Headers */, + 72B3DEC91E23472200457642 /* SPUDownloadedUpdate.h in Headers */, 61EF67590E25C5B400F754E0 /* SUHost.h in Headers */, 72162B081C82C9600013C1C5 /* SULocalizations.h in Headers */, 55C14F06136EF6DB00649790 /* SULog.h in Headers */, + 72B3DECD1E23479000457642 /* SPUInformationalUpdate.h in Headers */, 726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */, 61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */, 6196CFF909C72148000DC222 /* SUStatusController.h in Headers */, @@ -2899,7 +2911,6 @@ 5D06E8E90FD68CDB005AE3F6 /* bsdiff.c in Sources */, 14652F7E19A9728A00959E44 /* bspatch.c in Sources */, 7223E7631AD1AEFF008E3161 /* sais.c in Sources */, - 7267E6001D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */, 7267E5761D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */, 7267E5781D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */, 7267E57A1D3D895B00D1BF90 /* SUBinaryDeltaCreate.m in Sources */, @@ -2918,7 +2929,6 @@ 721CF1A71AD7643600D9AC09 /* bsdiff.c in Sources */, 721CF1A81AD7644100D9AC09 /* bspatch.c in Sources */, 721CF1A91AD7644C00D9AC09 /* sais.c in Sources */, - 7267E5FF1D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */, 725F97771C8A62F500265BE4 /* SUAdHocCodeSigning.m in Sources */, 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */, 7267E5EE1D3D915900D1BF90 /* SUBinaryDeltaApply.m in Sources */, @@ -3091,12 +3101,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 72B3DED11E23479D00457642 /* SPUDownloadedUpdate.m in Sources */, 72A5D5CB1D6929F80009E5AC /* SPUAutomaticUpdateDriver.m in Sources */, 72A5D5CE1D6929F80009E5AC /* SPUBasicUpdateDriver.m in Sources */, 72A5D5CD1D6929F80009E5AC /* SPUCoreBasedUpdateDriver.m in Sources */, 72A5D5BD1D6929F80009E5AC /* SPUDownloadData.m in Sources */, 72A5D5D01D6929F80009E5AC /* SPUDownloadDriver.m in Sources */, - 72A5D5D31D6929F80009E5AC /* SPUResumableUpdate.m in Sources */, 72A5D5AF1D6929F80009E5AC /* SPUDownloader.m in Sources */, 72A5D5B71D6929F80009E5AC /* SPUInstallationInfo.m in Sources */, 72A5D5B41D6929F80009E5AC /* SPUInstallationInputData.m in Sources */, @@ -3129,6 +3139,7 @@ 72A5D5C11D6929F80009E5AC /* SUHost.m in Sources */, 72A5D5B01D6929F80009E5AC /* SUInstallerConnection.m in Sources */, 72A5D5AE1D6929F80009E5AC /* SUInstallerLauncher.m in Sources */, + 72B3DED01E23479000457642 /* SPUInformationalUpdate.m in Sources */, 72A5D5B21D6929F80009E5AC /* SUInstallerStatus.m in Sources */, 72A5D5C51D6929F80009E5AC /* SULog.m in Sources */, 72A5D5C61D6929F80009E5AC /* SUOperatingSystem.m in Sources */, @@ -3201,13 +3212,13 @@ 72B767E31C9CE90A00A07552 /* SPUCoreBasedUpdateDriver.m in Sources */, 72F9EC451D5E9ED8004AC8B6 /* SPUDownloadData.m in Sources */, 7229E1BE1C98EFF200CB50D0 /* SPUDownloadDriver.m in Sources */, - 7267E5FE1D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */, 723B5DAA1CF7AB6A00365F95 /* SPUDownloader.m in Sources */, 7267E5B71D3D8AEE00D1BF90 /* SPUInstallationInfo.m in Sources */, 7267E5DF1D3D8FFA00D1BF90 /* SPUInstallationInputData.m in Sources */, 72B767CF1C9B924900A07552 /* SPUInstallerDriver.m in Sources */, 721BC20F1D1CDE55002BC71E /* SPULocalCacheDirectory.m in Sources */, 7267E5B21D3D8AD500D1BF90 /* SPUMessageTypes.m in Sources */, + 72B3DECF1E23479000457642 /* SPUInformationalUpdate.m in Sources */, 728337A71C9E6FF40085AA99 /* SPUProbeInstallStatus.m in Sources */, 72B767D31C9C7B9300A07552 /* SPUProbingUpdateDriver.m in Sources */, 7229E1BA1C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m in Sources */, @@ -3242,6 +3253,7 @@ 726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */, 61A225A50D1C4AC000430CCD /* SUStandardVersionComparator.m in Sources */, 6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */, + 72B3DECA1E23472200457642 /* SPUDownloadedUpdate.m in Sources */, 61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */, 61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */, 612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */, diff --git a/Sparkle/SPUAutomaticUpdateDriver.m b/Sparkle/SPUAutomaticUpdateDriver.m index f5f212b5..907828c4 100644 --- a/Sparkle/SPUAutomaticUpdateDriver.m +++ b/Sparkle/SPUAutomaticUpdateDriver.m @@ -73,7 +73,7 @@ abort(); } -- (void)resumeUpdate:(SPUResumableUpdate *)__unused resumableUpdate completion:(SPUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn)) +- (void)resumeUpdate:(id)__unused resumableUpdate completion:(SPUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn)) { // Nothing really to do here.. this shouldn't be called. SULog(SULogLevelError, @"Error: resumeDownloadedUpdate:completion: called on SPUAutomaticUpdateDriver"); diff --git a/Sparkle/SPUBasicUpdateDriver.h b/Sparkle/SPUBasicUpdateDriver.h index 8c59a200..a592773d 100644 --- a/Sparkle/SPUBasicUpdateDriver.h +++ b/Sparkle/SPUBasicUpdateDriver.h @@ -36,11 +36,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; @property (nullable, nonatomic, readonly) SUAppcastItem *nonDeltaUpdateItem; -- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldSignalShowingUpdate resumableUpdate:(SPUResumableUpdate * _Nullable)resumableUpdate error:(nullable NSError *)error; +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldSignalShowingUpdate resumableUpdate:(id _Nullable)resumableUpdate error:(nullable NSError *)error; @end diff --git a/Sparkle/SPUBasicUpdateDriver.m b/Sparkle/SPUBasicUpdateDriver.m index a9d31c51..3a7a25d9 100644 --- a/Sparkle/SPUBasicUpdateDriver.m +++ b/Sparkle/SPUBasicUpdateDriver.m @@ -101,7 +101,7 @@ }]; } -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { self.completionBlock = completionBlock; @@ -173,7 +173,7 @@ } } -- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately resumableUpdate:(SPUResumableUpdate * _Nullable)resumableUpdate error:(nullable NSError *)error +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately resumableUpdate:(id _Nullable)resumableUpdate error:(nullable NSError *)error { self.aborted = YES; diff --git a/Sparkle/SPUCoreBasedUpdateDriver.h b/Sparkle/SPUCoreBasedUpdateDriver.h index ac8b0f6a..01d52320 100644 --- a/Sparkle/SPUCoreBasedUpdateDriver.h +++ b/Sparkle/SPUCoreBasedUpdateDriver.h @@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; - (void)downloadUpdateFromAppcastItem:(SUAppcastItem *)updateItem; diff --git a/Sparkle/SPUCoreBasedUpdateDriver.m b/Sparkle/SPUCoreBasedUpdateDriver.m index b8db2069..6e9407c8 100644 --- a/Sparkle/SPUCoreBasedUpdateDriver.m +++ b/Sparkle/SPUCoreBasedUpdateDriver.m @@ -15,6 +15,8 @@ #import "SULog.h" #import "SUErrors.h" #import "SPUResumableUpdate.h" +#import "SPUDownloadedUpdate.h" +#import "SPUInformationalUpdate.h" #import "SUAppcastItem.h" #import "SULocalizations.h" #import "SPUInstallationType.h" @@ -30,7 +32,7 @@ @property (nonatomic, readonly) SPUInstallerDriver *installerDriver; @property (nonatomic, weak, readonly) id delegate; @property (nonatomic) SUAppcastItem *updateItem; -@property (nonatomic) SPUResumableUpdate *resumableUpdate; +@property (nonatomic) id resumableUpdate; @property (nonatomic, readonly) SUHost *host; @property (nonatomic) BOOL resumingInstallingUpdate; @@ -122,7 +124,7 @@ [self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { self.resumableUpdate = resumableUpdate; self.silentInstall = NO; @@ -197,7 +199,7 @@ } } -- (void)downloadDriverDidDownloadUpdate:(SPUResumableUpdate *)downloadedUpdate +- (void)downloadDriverDidDownloadUpdate:(SPUDownloadedUpdate *)downloadedUpdate { self.resumableUpdate = downloadedUpdate; [self extractUpdate:downloadedUpdate]; @@ -205,7 +207,7 @@ - (void)deferInformationalUpdate:(SUAppcastItem *)updateItem { - self.resumableUpdate = [[SPUResumableUpdate alloc] initWithAppcastItem:updateItem]; + self.resumableUpdate = [[SPUInformationalUpdate alloc] initWithAppcastItem:updateItem]; } - (void)extractDownloadedUpdate @@ -219,7 +221,7 @@ self.resumableUpdate = nil; } -- (void)extractUpdate:(SPUResumableUpdate *)downloadedUpdate +- (void)extractUpdate:(SPUDownloadedUpdate *)downloadedUpdate { // Now we have to extract the downloaded archive. if ([self.delegate respondsToSelector:@selector(coreDriverDidStartExtractingUpdate)]) { @@ -346,7 +348,7 @@ [self.installerDriver abortInstall]; [self.downloadDriver cleanup]; - SPUResumableUpdate *resumableUpdate = (error == nil || error.code == SUInstallationAuthorizeLaterError) ? self.resumableUpdate : nil; + id resumableUpdate = (error == nil || error.code == SUInstallationAuthorizeLaterError) ? self.resumableUpdate : nil; [self.basicDriver abortUpdateAndShowNextUpdateImmediately:shouldShowUpdateImmediately resumableUpdate:resumableUpdate error:error]; } diff --git a/Sparkle/SPUDownloadDriver.h b/Sparkle/SPUDownloadDriver.h index e5ec7e1c..2f9c9194 100644 --- a/Sparkle/SPUDownloadDriver.h +++ b/Sparkle/SPUDownloadDriver.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN -@class SUAppcastItem, SUHost, SPUResumableUpdate; +@class SUAppcastItem, SUHost, SPUDownloadedUpdate; @protocol SPUDownloadDriverDelegate @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)downloadDriverDidReceiveDataOfLength:(uint64_t)length; -- (void)downloadDriverDidDownloadUpdate:(SPUResumableUpdate *)downloadedUpdate; +- (void)downloadDriverDidDownloadUpdate:(SPUDownloadedUpdate *)downloadedUpdate; - (void)downloadDriverDidFailToDownloadUpdateWithError:(NSError *)error; diff --git a/Sparkle/SPUDownloadDriver.m b/Sparkle/SPUDownloadDriver.m index 2ae62772..2755c94f 100644 --- a/Sparkle/SPUDownloadDriver.m +++ b/Sparkle/SPUDownloadDriver.m @@ -17,7 +17,7 @@ #import "SULog.h" #import "SUErrors.h" #import "SPUURLRequest.h" -#import "SPUResumableUpdate.h" +#import "SPUDownloadedUpdate.h" #import "SPUDownloadData.h" #ifdef _APPKITDEFINES_H @@ -141,7 +141,7 @@ SULog(SULogLevelError, @"Warning: Downloader's expected content length (%llu) != Appcast item's length (%llu)", self.expectedContentLength, self.updateItem.contentLength); } - SPUResumableUpdate *downloadedUpdate = [[SPUResumableUpdate alloc] initWithAppcastItem:self.updateItem downloadName:self.downloadName temporaryDirectory:self.temporaryDirectory]; + SPUDownloadedUpdate *downloadedUpdate = [[SPUDownloadedUpdate alloc] initWithAppcastItem:self.updateItem downloadName:self.downloadName temporaryDirectory:self.temporaryDirectory]; [self.delegate downloadDriverDidDownloadUpdate:downloadedUpdate]; [self cleanup]; diff --git a/Sparkle/SPUDownloadedUpdate.h b/Sparkle/SPUDownloadedUpdate.h new file mode 100644 index 00000000..349d03a4 --- /dev/null +++ b/Sparkle/SPUDownloadedUpdate.h @@ -0,0 +1,23 @@ +// +// SPUDownloadedUpdate.h +// Sparkle +// +// Created by Mayur Pawashe on 1/8/17. +// Copyright © 2017 Sparkle Project. All rights reserved. +// + +#import +#import "SPUResumableUpdate.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SPUDownloadedUpdate : NSObject + +- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem downloadName:(NSString *)downloadName temporaryDirectory:(NSString *)temporaryDirectory; + +@property (nonatomic, copy, readonly) NSString *downloadName; +@property (nonatomic, copy, readonly) NSString *temporaryDirectory; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sparkle/SPUResumableUpdate.m b/Sparkle/SPUDownloadedUpdate.m similarity index 62% rename from Sparkle/SPUResumableUpdate.m rename to Sparkle/SPUDownloadedUpdate.m index 1ee5bfa8..2ecc8003 100644 --- a/Sparkle/SPUResumableUpdate.m +++ b/Sparkle/SPUDownloadedUpdate.m @@ -1,20 +1,23 @@ // -// SPUResumableUpdate.m +// SPUDownloadedUpdate.m // Sparkle // -// Created by Mayur Pawashe on 7/18/16. -// Copyright © 2016 Sparkle Project. All rights reserved. +// Created by Mayur Pawashe on 1/8/17. +// Copyright © 2017 Sparkle Project. All rights reserved. // -#import "SPUResumableUpdate.h" +#import "SPUDownloadedUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit #endif -@implementation SPUResumableUpdate +@implementation SPUDownloadedUpdate +// If we ever enable auto-synthesize in the future, we'll still need this synthesize +// because the property is declared in a protocol @synthesize updateItem = _updateItem; + @synthesize downloadName = _downloadName; @synthesize temporaryDirectory = _temporaryDirectory; @@ -29,13 +32,4 @@ return self; } -- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem -{ - self = [super init]; - if (self != nil) { - _updateItem = updateItem; - } - return self; -} - @end diff --git a/Sparkle/SPUInformationalUpdate.h b/Sparkle/SPUInformationalUpdate.h new file mode 100644 index 00000000..2302d5a4 --- /dev/null +++ b/Sparkle/SPUInformationalUpdate.h @@ -0,0 +1,20 @@ +// +// SPUInformationalUpdate.h +// Sparkle +// +// Created by Mayur Pawashe on 1/8/17. +// Copyright © 2017 Sparkle Project. All rights reserved. +// + +#import +#import "SPUResumableUpdate.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SPUInformationalUpdate : NSObject + +- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sparkle/SPUInformationalUpdate.m b/Sparkle/SPUInformationalUpdate.m new file mode 100644 index 00000000..6f8e29bc --- /dev/null +++ b/Sparkle/SPUInformationalUpdate.m @@ -0,0 +1,30 @@ +// +// SPUInformationalUpdate.m +// Sparkle +// +// Created by Mayur Pawashe on 1/8/17. +// Copyright © 2017 Sparkle Project. All rights reserved. +// + +#import "SPUInformationalUpdate.h" + +#ifdef _APPKITDEFINES_H +#error This is a "core" class and should NOT import AppKit +#endif + +@implementation SPUInformationalUpdate + +// If we ever enable auto-synthesize in the future, we'll still need this synthesize +// because the property is declared in a protocol +@synthesize updateItem = _updateItem; + +- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem +{ + self = [super init]; + if (self != nil) { + _updateItem = updateItem; + } + return self; +} + +@end diff --git a/Sparkle/SPUInstallerDriver.h b/Sparkle/SPUInstallerDriver.h index de7db6f7..3819c8dc 100644 --- a/Sparkle/SPUInstallerDriver.h +++ b/Sparkle/SPUInstallerDriver.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol SPUUpdaterDelegate; -@class SUHost, SUAppcastItem, SPUResumableUpdate; +@class SUHost, SUAppcastItem, SPUDownloadedUpdate; @protocol SPUInstallerDriverDelegate @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)checkIfApplicationInstallationRequiresAuthorizationWithReply:(void (^)(BOOL requiresAuthorization))reply; -- (void)extractDownloadedUpdate:(SPUResumableUpdate *)downloadedUpdate silently:(BOOL)silently preventsInstallerInteraction:(BOOL)preventsInstallerInteraction completion:(void (^)(NSError * _Nullable))completionHandler; +- (void)extractDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently preventsInstallerInteraction:(BOOL)preventsInstallerInteraction completion:(void (^)(NSError * _Nullable))completionHandler; - (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI; diff --git a/Sparkle/SPUInstallerDriver.m b/Sparkle/SPUInstallerDriver.m index 9f85997a..becac64f 100644 --- a/Sparkle/SPUInstallerDriver.m +++ b/Sparkle/SPUInstallerDriver.m @@ -23,7 +23,7 @@ #import "SUInstallerConnection.h" #import "SUInstallerConnectionProtocol.h" #import "SUXPCInstallerConnection.h" -#import "SPUResumableUpdate.h" +#import "SPUDownloadedUpdate.h" #import "SPUInstallationType.h" #ifdef _APPKITDEFINES_H @@ -140,7 +140,7 @@ } // This can be called multiple times (eg: if a delta update fails, this may be called again with a regular update item) -- (void)extractDownloadedUpdate:(SPUResumableUpdate *)downloadedUpdate silently:(BOOL)silently preventsInstallerInteraction:(BOOL)preventsInstallerInteraction completion:(void (^)(NSError * _Nullable))completionHandler +- (void)extractDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently preventsInstallerInteraction:(BOOL)preventsInstallerInteraction completion:(void (^)(NSError * _Nullable))completionHandler { self.updateItem = downloadedUpdate.updateItem; self.temporaryDirectory = downloadedUpdate.temporaryDirectory; diff --git a/Sparkle/SPUProbingUpdateDriver.m b/Sparkle/SPUProbingUpdateDriver.m index f3e90505..478a13d0 100644 --- a/Sparkle/SPUProbingUpdateDriver.m +++ b/Sparkle/SPUProbingUpdateDriver.m @@ -16,7 +16,7 @@ @interface SPUProbingUpdateDriver () @property (nonatomic, readonly) SPUBasicUpdateDriver *basicDriver; -@property (nonatomic) SPUResumableUpdate *resumableUpdate; +@property (nonatomic) id resumableUpdate; @end @@ -48,7 +48,7 @@ [self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { self.resumableUpdate = resumableUpdate; diff --git a/Sparkle/SPUResumableUpdate.h b/Sparkle/SPUResumableUpdate.h index 6a070b56..31956ca7 100644 --- a/Sparkle/SPUResumableUpdate.h +++ b/Sparkle/SPUResumableUpdate.h @@ -12,19 +12,10 @@ NS_ASSUME_NONNULL_BEGIN @class SUAppcastItem; -@interface SPUResumableUpdate : NSObject - -- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem downloadName:(NSString *)downloadName temporaryDirectory:(NSString *)temporaryDirectory; - -// For information only updates -- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem; +@protocol SPUResumableUpdate @property (nonatomic, readonly) SUAppcastItem *updateItem; -// These are nil when the update item is just informational and no download is linked -@property (nonatomic, copy, nullable, readonly) NSString *downloadName; -@property (nonatomic, copy, nullable, readonly) NSString *temporaryDirectory; - @end NS_ASSUME_NONNULL_END diff --git a/Sparkle/SPUScheduledUpdateDriver.m b/Sparkle/SPUScheduledUpdateDriver.m index 0fa54e64..2a97d508 100644 --- a/Sparkle/SPUScheduledUpdateDriver.m +++ b/Sparkle/SPUScheduledUpdateDriver.m @@ -54,7 +54,7 @@ [self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { [self.uiDriver resumeUpdate:resumableUpdate completion:completionBlock]; } diff --git a/Sparkle/SPUUIBasedUpdateDriver.h b/Sparkle/SPUUIBasedUpdateDriver.h index ec779052..8bad5ef7 100644 --- a/Sparkle/SPUUIBasedUpdateDriver.h +++ b/Sparkle/SPUUIBasedUpdateDriver.h @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@class SUHost, SPUResumableUpdate; +@class SUHost; @protocol SPUUserDriver, SPUUpdaterDelegate; @interface SPUUIBasedUpdateDriver : NSObject @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; - (void)abortUpdateWithError:(nullable NSError *)error; diff --git a/Sparkle/SPUUIBasedUpdateDriver.m b/Sparkle/SPUUIBasedUpdateDriver.m index fbed1b9c..ab1445eb 100644 --- a/Sparkle/SPUUIBasedUpdateDriver.m +++ b/Sparkle/SPUUIBasedUpdateDriver.m @@ -89,7 +89,7 @@ [self.coreDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { // Informational downloads shouldn't be presented as updates to be downloaded if (!resumableUpdate.updateItem.isInformationOnlyUpdate) { diff --git a/Sparkle/SPUUpdateDriver.h b/Sparkle/SPUUpdateDriver.h index 4ff6912c..b12fae85 100644 --- a/Sparkle/SPUUpdateDriver.h +++ b/Sparkle/SPUUpdateDriver.h @@ -8,9 +8,9 @@ NS_ASSUME_NONNULL_BEGIN -@class SPUResumableUpdate; +@protocol SPUResumableUpdate; -typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SPUResumableUpdate * _Nullable resumableUpdate); +typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, id _Nullable resumableUpdate); @protocol SPUUpdateDriver @@ -18,7 +18,7 @@ typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SPUR - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; - (void)abortUpdate; - (void)abortUpdateWithError:(NSError * _Nullable)error; diff --git a/Sparkle/SPUUpdater.m b/Sparkle/SPUUpdater.m index 4db49eff..2444315d 100644 --- a/Sparkle/SPUUpdater.m +++ b/Sparkle/SPUUpdater.m @@ -55,7 +55,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification @property (nonatomic, readonly) SPUUpdaterTimer *updaterTimer; @property (nonatomic) BOOL startedUpdater; @property (nonatomic, copy) void (^preStartedScheduledUpdateBlock)(void); -@property (nonatomic, nullable) SPUResumableUpdate *resumableUpdate; +@property (nonatomic, nullable) id resumableUpdate; @property (nonatomic) BOOL loggedATSWarning; @property (nonatomic) BOOL loggedDSAWarning; @@ -544,7 +544,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification NSURL *theFeedURL = [self parameterizedFeedURL]; if (theFeedURL) { __weak SPUUpdater *weakSelf = self; - SPUUpdateDriverCompletion completionBlock = ^(BOOL shouldShowUpdateImmediately, SPUResumableUpdate * _Nullable resumableUpdate) { + SPUUpdateDriverCompletion completionBlock = ^(BOOL shouldShowUpdateImmediately, id _Nullable resumableUpdate) { SPUUpdater *strongSelf = weakSelf; if (strongSelf != nil) { strongSelf.resumableUpdate = resumableUpdate; @@ -559,7 +559,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification if (installerInProgress) { [self.driver resumeInstallingUpdateWithCompletion:completionBlock]; } else if (self.resumableUpdate != nil) { - [self.driver resumeUpdate:(SPUResumableUpdate * _Nonnull)self.resumableUpdate completion:completionBlock]; + [self.driver resumeUpdate:(id _Nonnull)self.resumableUpdate completion:completionBlock]; } else { [self.driver checkForUpdatesAtAppcastURL:theFeedURL withUserAgent:[self userAgentString] httpHeaders:[self httpHeaders] preventingInstallerInteraction:preventsInstallerInteraction completion:completionBlock]; } diff --git a/Sparkle/SPUUserInitiatedUpdateDriver.m b/Sparkle/SPUUserInitiatedUpdateDriver.m index 3912c796..e5dad0d5 100644 --- a/Sparkle/SPUUserInitiatedUpdateDriver.m +++ b/Sparkle/SPUUserInitiatedUpdateDriver.m @@ -76,7 +76,7 @@ [self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(id)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { [self.uiDriver resumeUpdate:resumableUpdate completion:completionBlock]; }