diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 19fec199..42bd4e65 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -265,10 +265,10 @@ 7267E5F81D3D91A800D1BF90 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5831D3D89B300D1BF90 /* SUPipedUnarchiver.m */; }; 7267E5F91D3D92DA00D1BF90 /* Autoupdate in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72B398D21D3D879300EE297F /* Autoupdate */; }; 7267E5FA1D3DAC3600D1BF90 /* StatusInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5A41D3D8A8A00D1BF90 /* StatusInfo.m */; }; - 7267E5FD1D3DD1B700D1BF90 /* SPUDownloadedUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5FB1D3DD1B700D1BF90 /* SPUDownloadedUpdate.h */; }; - 7267E5FE1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m */; }; - 7267E5FF1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m */; }; - 7267E6001D3DD1B700D1BF90 /* SPUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUDownloadedUpdate.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 +338,7 @@ 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 /* SPUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SPUDownloadedUpdate.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 */; }; @@ -1079,8 +1079,8 @@ 7267E5DD1D3D8F5A00D1BF90 /* SUStatusInfoProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUStatusInfoProtocol.h; path = Autoupdate/SUStatusInfoProtocol.h; sourceTree = SOURCE_ROOT; }; 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 /* SPUDownloadedUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUDownloadedUpdate.h; sourceTree = ""; }; - 7267E5FC1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUDownloadedUpdate.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; }; @@ -1737,8 +1737,8 @@ 72B767E11C9CE90A00A07552 /* SPUCoreBasedUpdateDriver.m */, 7229E1BB1C98EFF200CB50D0 /* SPUDownloadDriver.h */, 7229E1BC1C98EFF200CB50D0 /* SPUDownloadDriver.m */, - 7267E5FB1D3DD1B700D1BF90 /* SPUDownloadedUpdate.h */, - 7267E5FC1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m */, + 7267E5FB1D3DD1B700D1BF90 /* SPUResumableUpdate.h */, + 7267E5FC1D3DD1B700D1BF90 /* SPUResumableUpdate.m */, 72B767CC1C9B924900A07552 /* SPUInstallerDriver.h */, 72B767CD1C9B924900A07552 /* SPUInstallerDriver.m */, 728337A41C9E6FF40085AA99 /* SPUProbeInstallStatus.h */, @@ -2069,7 +2069,7 @@ 72B767E21C9CE90A00A07552 /* SPUCoreBasedUpdateDriver.h in Headers */, 72F9EC441D5E9ED8004AC8B6 /* SPUDownloadData.h in Headers */, 7229E1BD1C98EFF200CB50D0 /* SPUDownloadDriver.h in Headers */, - 7267E5FD1D3DD1B700D1BF90 /* SPUDownloadedUpdate.h in Headers */, + 7267E5FD1D3DD1B700D1BF90 /* SPUResumableUpdate.h in Headers */, 7267E5B61D3D8AEE00D1BF90 /* SPUInstallationInfo.h in Headers */, 72B767CE1C9B924900A07552 /* SPUInstallerDriver.h in Headers */, 721BC20E1D1CDE55002BC71E /* SPULocalCacheDirectory.h in Headers */, @@ -2899,7 +2899,7 @@ 5D06E8E90FD68CDB005AE3F6 /* bsdiff.c in Sources */, 14652F7E19A9728A00959E44 /* bspatch.c in Sources */, 7223E7631AD1AEFF008E3161 /* sais.c in Sources */, - 7267E6001D3DD1B700D1BF90 /* SPUDownloadedUpdate.m in Sources */, + 7267E6001D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */, 7267E5761D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */, 7267E5781D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */, 7267E57A1D3D895B00D1BF90 /* SUBinaryDeltaCreate.m in Sources */, @@ -2918,7 +2918,7 @@ 721CF1A71AD7643600D9AC09 /* bsdiff.c in Sources */, 721CF1A81AD7644100D9AC09 /* bspatch.c in Sources */, 721CF1A91AD7644C00D9AC09 /* sais.c in Sources */, - 7267E5FF1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m in Sources */, + 7267E5FF1D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */, 725F97771C8A62F500265BE4 /* SUAdHocCodeSigning.m in Sources */, 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */, 7267E5EE1D3D915900D1BF90 /* SUBinaryDeltaApply.m in Sources */, @@ -3096,7 +3096,7 @@ 72A5D5CD1D6929F80009E5AC /* SPUCoreBasedUpdateDriver.m in Sources */, 72A5D5BD1D6929F80009E5AC /* SPUDownloadData.m in Sources */, 72A5D5D01D6929F80009E5AC /* SPUDownloadDriver.m in Sources */, - 72A5D5D31D6929F80009E5AC /* SPUDownloadedUpdate.m in Sources */, + 72A5D5D31D6929F80009E5AC /* SPUResumableUpdate.m in Sources */, 72A5D5AF1D6929F80009E5AC /* SPUDownloader.m in Sources */, 72A5D5B71D6929F80009E5AC /* SPUInstallationInfo.m in Sources */, 72A5D5B41D6929F80009E5AC /* SPUInstallationInputData.m in Sources */, @@ -3201,7 +3201,7 @@ 72B767E31C9CE90A00A07552 /* SPUCoreBasedUpdateDriver.m in Sources */, 72F9EC451D5E9ED8004AC8B6 /* SPUDownloadData.m in Sources */, 7229E1BE1C98EFF200CB50D0 /* SPUDownloadDriver.m in Sources */, - 7267E5FE1D3DD1B700D1BF90 /* SPUDownloadedUpdate.m in Sources */, + 7267E5FE1D3DD1B700D1BF90 /* SPUResumableUpdate.m in Sources */, 723B5DAA1CF7AB6A00365F95 /* SPUDownloader.m in Sources */, 7267E5B71D3D8AEE00D1BF90 /* SPUInstallationInfo.m in Sources */, 7267E5DF1D3D8FFA00D1BF90 /* SPUInstallationInputData.m in Sources */, diff --git a/Sparkle/SPUAutomaticUpdateDriver.m b/Sparkle/SPUAutomaticUpdateDriver.m index 94991c5d..f5f212b5 100644 --- a/Sparkle/SPUAutomaticUpdateDriver.m +++ b/Sparkle/SPUAutomaticUpdateDriver.m @@ -73,7 +73,7 @@ abort(); } -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)__unused downloadedUpdate completion:(SPUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn)) +- (void)resumeUpdate:(SPUResumableUpdate *)__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 fa8f7447..8c59a200 100644 --- a/Sparkle/SPUBasicUpdateDriver.h +++ b/Sparkle/SPUBasicUpdateDriver.h @@ -36,11 +36,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; @property (nullable, nonatomic, readonly) SUAppcastItem *nonDeltaUpdateItem; -- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldSignalShowingUpdate downloadedUpdate:(SPUDownloadedUpdate * _Nullable)downloadedUpdate error:(nullable NSError *)error; +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldSignalShowingUpdate resumableUpdate:(SPUResumableUpdate * _Nullable)resumableUpdate error:(nullable NSError *)error; @end diff --git a/Sparkle/SPUBasicUpdateDriver.m b/Sparkle/SPUBasicUpdateDriver.m index 275f4035..a9d31c51 100644 --- a/Sparkle/SPUBasicUpdateDriver.m +++ b/Sparkle/SPUBasicUpdateDriver.m @@ -16,7 +16,7 @@ #import "SUAppcastItem.h" #import "SPUProbeInstallStatus.h" #import "SPUInstallationInfo.h" -#import "SPUDownloadedUpdate.h" +#import "SPUResumableUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -101,11 +101,11 @@ }]; } -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { self.completionBlock = completionBlock; - [self notifyResumableUpdateItem:downloadedUpdate.updateItem]; + [self notifyResumableUpdateItem:resumableUpdate.updateItem]; } - (SUAppcastItem *)nonDeltaUpdateItem @@ -173,7 +173,7 @@ } } -- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately downloadedUpdate:(SPUDownloadedUpdate * _Nullable)downloadedUpdate error:(nullable NSError *)error +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately resumableUpdate:(SPUResumableUpdate * _Nullable)resumableUpdate error:(nullable NSError *)error { self.aborted = YES; @@ -194,7 +194,7 @@ } if (self.completionBlock != nil) { - self.completionBlock(shouldShowUpdateImmediately, downloadedUpdate); + self.completionBlock(shouldShowUpdateImmediately, resumableUpdate); self.completionBlock = nil; } } diff --git a/Sparkle/SPUCoreBasedUpdateDriver.h b/Sparkle/SPUCoreBasedUpdateDriver.h index 94872f95..ac8b0f6a 100644 --- a/Sparkle/SPUCoreBasedUpdateDriver.h +++ b/Sparkle/SPUCoreBasedUpdateDriver.h @@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; - (void)downloadUpdateFromAppcastItem:(SUAppcastItem *)updateItem; diff --git a/Sparkle/SPUCoreBasedUpdateDriver.m b/Sparkle/SPUCoreBasedUpdateDriver.m index 3f897c4f..b8db2069 100644 --- a/Sparkle/SPUCoreBasedUpdateDriver.m +++ b/Sparkle/SPUCoreBasedUpdateDriver.m @@ -14,7 +14,7 @@ #import "SPUDownloadDriver.h" #import "SULog.h" #import "SUErrors.h" -#import "SPUDownloadedUpdate.h" +#import "SPUResumableUpdate.h" #import "SUAppcastItem.h" #import "SULocalizations.h" #import "SPUInstallationType.h" @@ -30,7 +30,7 @@ @property (nonatomic, readonly) SPUInstallerDriver *installerDriver; @property (nonatomic, weak, readonly) id delegate; @property (nonatomic) SUAppcastItem *updateItem; -@property (nonatomic) SPUDownloadedUpdate *downloadedUpdate; +@property (nonatomic) SPUResumableUpdate *resumableUpdate; @property (nonatomic, readonly) SUHost *host; @property (nonatomic) BOOL resumingInstallingUpdate; @@ -56,7 +56,7 @@ @synthesize updater = _updater; @synthesize updaterDelegate = _updaterDelegate; @synthesize userAgent = _userAgent; -@synthesize downloadedUpdate = _downloadedUpdate; +@synthesize resumableUpdate = _resumableUpdate; - (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id )updaterDelegate delegate:(id)delegate { @@ -122,15 +122,15 @@ [self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { - self.downloadedUpdate = downloadedUpdate; + self.resumableUpdate = resumableUpdate; self.silentInstall = NO; // Note if installer interaction isn't allowed, we shouldn't have downloaded the update, and shouldn't be able to get here // So no need to do a test if we can perform an update without authorization - [self.basicDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; + [self.basicDriver resumeUpdate:resumableUpdate completion:completionBlock]; } - (void)basicDriverDidFinishLoadingAppcast @@ -197,29 +197,29 @@ } } -- (void)downloadDriverDidDownloadUpdate:(SPUDownloadedUpdate *)downloadedUpdate +- (void)downloadDriverDidDownloadUpdate:(SPUResumableUpdate *)downloadedUpdate { - self.downloadedUpdate = downloadedUpdate; + self.resumableUpdate = downloadedUpdate; [self extractUpdate:downloadedUpdate]; } - (void)deferInformationalUpdate:(SUAppcastItem *)updateItem { - self.downloadedUpdate = [[SPUDownloadedUpdate alloc] initWithAppcastItem:updateItem]; + self.resumableUpdate = [[SPUResumableUpdate alloc] initWithAppcastItem:updateItem]; } - (void)extractDownloadedUpdate { - assert(self.downloadedUpdate != nil); - [self extractUpdate:self.downloadedUpdate]; + assert(self.resumableUpdate != nil); + [self extractUpdate:self.resumableUpdate]; } - (void)clearDownloadedUpdate { - self.downloadedUpdate = nil; + self.resumableUpdate = nil; } -- (void)extractUpdate:(SPUDownloadedUpdate *)downloadedUpdate +- (void)extractUpdate:(SPUResumableUpdate *)downloadedUpdate { // Now we have to extract the downloaded archive. if ([self.delegate respondsToSelector:@selector(coreDriverDidStartExtractingUpdate)]) { @@ -346,9 +346,9 @@ [self.installerDriver abortInstall]; [self.downloadDriver cleanup]; - SPUDownloadedUpdate *downloadedUpdate = (error == nil || error.code == SUInstallationAuthorizeLaterError) ? self.downloadedUpdate : nil; + SPUResumableUpdate *resumableUpdate = (error == nil || error.code == SUInstallationAuthorizeLaterError) ? self.resumableUpdate : nil; - [self.basicDriver abortUpdateAndShowNextUpdateImmediately:shouldShowUpdateImmediately downloadedUpdate:downloadedUpdate error:error]; + [self.basicDriver abortUpdateAndShowNextUpdateImmediately:shouldShowUpdateImmediately resumableUpdate:resumableUpdate error:error]; } @end diff --git a/Sparkle/SPUDownloadDriver.h b/Sparkle/SPUDownloadDriver.h index 2f9c9194..e5ec7e1c 100644 --- a/Sparkle/SPUDownloadDriver.h +++ b/Sparkle/SPUDownloadDriver.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN -@class SUAppcastItem, SUHost, SPUDownloadedUpdate; +@class SUAppcastItem, SUHost, SPUResumableUpdate; @protocol SPUDownloadDriverDelegate @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)downloadDriverDidReceiveDataOfLength:(uint64_t)length; -- (void)downloadDriverDidDownloadUpdate:(SPUDownloadedUpdate *)downloadedUpdate; +- (void)downloadDriverDidDownloadUpdate:(SPUResumableUpdate *)downloadedUpdate; - (void)downloadDriverDidFailToDownloadUpdateWithError:(NSError *)error; diff --git a/Sparkle/SPUDownloadDriver.m b/Sparkle/SPUDownloadDriver.m index 2755c94f..2ae62772 100644 --- a/Sparkle/SPUDownloadDriver.m +++ b/Sparkle/SPUDownloadDriver.m @@ -17,7 +17,7 @@ #import "SULog.h" #import "SUErrors.h" #import "SPUURLRequest.h" -#import "SPUDownloadedUpdate.h" +#import "SPUResumableUpdate.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); } - SPUDownloadedUpdate *downloadedUpdate = [[SPUDownloadedUpdate alloc] initWithAppcastItem:self.updateItem downloadName:self.downloadName temporaryDirectory:self.temporaryDirectory]; + SPUResumableUpdate *downloadedUpdate = [[SPUResumableUpdate alloc] initWithAppcastItem:self.updateItem downloadName:self.downloadName temporaryDirectory:self.temporaryDirectory]; [self.delegate downloadDriverDidDownloadUpdate:downloadedUpdate]; [self cleanup]; diff --git a/Sparkle/SPUInstallerDriver.h b/Sparkle/SPUInstallerDriver.h index 3819c8dc..de7db6f7 100644 --- a/Sparkle/SPUInstallerDriver.h +++ b/Sparkle/SPUInstallerDriver.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol SPUUpdaterDelegate; -@class SUHost, SUAppcastItem, SPUDownloadedUpdate; +@class SUHost, SUAppcastItem, SPUResumableUpdate; @protocol SPUInstallerDriverDelegate @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)checkIfApplicationInstallationRequiresAuthorizationWithReply:(void (^)(BOOL requiresAuthorization))reply; -- (void)extractDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently preventsInstallerInteraction:(BOOL)preventsInstallerInteraction completion:(void (^)(NSError * _Nullable))completionHandler; +- (void)extractDownloadedUpdate:(SPUResumableUpdate *)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 becac64f..9f85997a 100644 --- a/Sparkle/SPUInstallerDriver.m +++ b/Sparkle/SPUInstallerDriver.m @@ -23,7 +23,7 @@ #import "SUInstallerConnection.h" #import "SUInstallerConnectionProtocol.h" #import "SUXPCInstallerConnection.h" -#import "SPUDownloadedUpdate.h" +#import "SPUResumableUpdate.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:(SPUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently preventsInstallerInteraction:(BOOL)preventsInstallerInteraction completion:(void (^)(NSError * _Nullable))completionHandler +- (void)extractDownloadedUpdate:(SPUResumableUpdate *)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 53f5c8f4..f3e90505 100644 --- a/Sparkle/SPUProbingUpdateDriver.m +++ b/Sparkle/SPUProbingUpdateDriver.m @@ -16,14 +16,14 @@ @interface SPUProbingUpdateDriver () @property (nonatomic, readonly) SPUBasicUpdateDriver *basicDriver; -@property (nonatomic) SPUDownloadedUpdate *downloadedUpdate; +@property (nonatomic) SPUResumableUpdate *resumableUpdate; @end @implementation SPUProbingUpdateDriver @synthesize basicDriver = _basicDriver; -@synthesize downloadedUpdate = _downloadedUpdate; +@synthesize resumableUpdate = _resumableUpdate; - (instancetype)initWithHost:(SUHost *)host updater:(id)updater updaterDelegate:(id )updaterDelegate { @@ -48,11 +48,11 @@ [self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { - self.downloadedUpdate = downloadedUpdate; + self.resumableUpdate = resumableUpdate; - [self.basicDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; + [self.basicDriver resumeUpdate:resumableUpdate completion:completionBlock]; } - (void)basicDriverDidFindUpdateWithAppcastItem:(SUAppcastItem *)__unused appcastItem @@ -73,7 +73,7 @@ - (void)abortUpdateWithError:(nullable NSError *)error { - [self.basicDriver abortUpdateAndShowNextUpdateImmediately:NO downloadedUpdate:self.downloadedUpdate error:error]; + [self.basicDriver abortUpdateAndShowNextUpdateImmediately:NO resumableUpdate:self.resumableUpdate error:error]; } @end diff --git a/Sparkle/SPUDownloadedUpdate.h b/Sparkle/SPUResumableUpdate.h similarity index 92% rename from Sparkle/SPUDownloadedUpdate.h rename to Sparkle/SPUResumableUpdate.h index 7c542aa8..6a070b56 100644 --- a/Sparkle/SPUDownloadedUpdate.h +++ b/Sparkle/SPUResumableUpdate.h @@ -1,5 +1,5 @@ // -// SPUDownloadedUpdate.h +// SPUResumableUpdate.h // Sparkle // // Created by Mayur Pawashe on 7/18/16. @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @class SUAppcastItem; -@interface SPUDownloadedUpdate : NSObject +@interface SPUResumableUpdate : NSObject - (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem downloadName:(NSString *)downloadName temporaryDirectory:(NSString *)temporaryDirectory; diff --git a/Sparkle/SPUDownloadedUpdate.m b/Sparkle/SPUResumableUpdate.m similarity index 90% rename from Sparkle/SPUDownloadedUpdate.m rename to Sparkle/SPUResumableUpdate.m index 709cb17c..1ee5bfa8 100644 --- a/Sparkle/SPUDownloadedUpdate.m +++ b/Sparkle/SPUResumableUpdate.m @@ -1,18 +1,18 @@ // -// SPUDownloadedUpdate.m +// SPUResumableUpdate.m // Sparkle // // Created by Mayur Pawashe on 7/18/16. // Copyright © 2016 Sparkle Project. All rights reserved. // -#import "SPUDownloadedUpdate.h" +#import "SPUResumableUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit #endif -@implementation SPUDownloadedUpdate +@implementation SPUResumableUpdate @synthesize updateItem = _updateItem; @synthesize downloadName = _downloadName; diff --git a/Sparkle/SPUScheduledUpdateDriver.m b/Sparkle/SPUScheduledUpdateDriver.m index 6be0b400..0fa54e64 100644 --- a/Sparkle/SPUScheduledUpdateDriver.m +++ b/Sparkle/SPUScheduledUpdateDriver.m @@ -54,9 +54,9 @@ [self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { - [self.uiDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; + [self.uiDriver resumeUpdate:resumableUpdate completion:completionBlock]; } - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)__unused error diff --git a/Sparkle/SPUUIBasedUpdateDriver.h b/Sparkle/SPUUIBasedUpdateDriver.h index 4a47df98..ec779052 100644 --- a/Sparkle/SPUUIBasedUpdateDriver.h +++ b/Sparkle/SPUUIBasedUpdateDriver.h @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@class SUHost, SPUDownloadedUpdate; +@class SUHost, SPUResumableUpdate; @protocol SPUUserDriver, SPUUpdaterDelegate; @interface SPUUIBasedUpdateDriver : NSObject @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; - (void)abortUpdateWithError:(nullable NSError *)error; diff --git a/Sparkle/SPUUIBasedUpdateDriver.m b/Sparkle/SPUUIBasedUpdateDriver.m index 36923e8b..fbed1b9c 100644 --- a/Sparkle/SPUUIBasedUpdateDriver.m +++ b/Sparkle/SPUUIBasedUpdateDriver.m @@ -16,7 +16,7 @@ #import "SUErrors.h" #import "SPUURLDownload.h" #import "SPUDownloadData.h" -#import "SPUDownloadedUpdate.h" +#import "SPUResumableUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -89,13 +89,13 @@ [self.coreDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { // Informational downloads shouldn't be presented as updates to be downloaded - if (!downloadedUpdate.updateItem.isInformationOnlyUpdate) { + if (!resumableUpdate.updateItem.isInformationOnlyUpdate) { self.resumingDownloadedUpdate = YES; } - [self.coreDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; + [self.coreDriver resumeUpdate:resumableUpdate completion:completionBlock]; } - (void)basicDriverDidFinishLoadingAppcast diff --git a/Sparkle/SPUUpdateDriver.h b/Sparkle/SPUUpdateDriver.h index 5b32abed..4ff6912c 100644 --- a/Sparkle/SPUUpdateDriver.h +++ b/Sparkle/SPUUpdateDriver.h @@ -8,9 +8,9 @@ NS_ASSUME_NONNULL_BEGIN -@class SPUDownloadedUpdate; +@class SPUResumableUpdate; -typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SPUDownloadedUpdate * _Nullable resumableUpdate); +typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SPUResumableUpdate * _Nullable resumableUpdate); @protocol SPUUpdateDriver @@ -18,7 +18,7 @@ typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SPUD - (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock; -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock; +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock; - (void)abortUpdate; - (void)abortUpdateWithError:(NSError * _Nullable)error; diff --git a/Sparkle/SPUUpdater.m b/Sparkle/SPUUpdater.m index caecfbd0..4db49eff 100644 --- a/Sparkle/SPUUpdater.m +++ b/Sparkle/SPUUpdater.m @@ -28,7 +28,7 @@ #import "SPUXPCServiceInfo.h" #import "SPUUpdaterCycle.h" #import "SPUUpdaterTimer.h" -#import "SPUDownloadedUpdate.h" +#import "SPUResumableUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -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) SPUDownloadedUpdate *resumableUpdate; +@property (nonatomic, nullable) SPUResumableUpdate *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, SPUDownloadedUpdate * _Nullable resumableUpdate) { + SPUUpdateDriverCompletion completionBlock = ^(BOOL shouldShowUpdateImmediately, SPUResumableUpdate * _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 resumeDownloadedUpdate:(SPUDownloadedUpdate * _Nonnull)self.resumableUpdate completion:completionBlock]; + [self.driver resumeUpdate:(SPUResumableUpdate * _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 44419c4e..3912c796 100644 --- a/Sparkle/SPUUserInitiatedUpdateDriver.m +++ b/Sparkle/SPUUserInitiatedUpdateDriver.m @@ -76,9 +76,9 @@ [self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate completion:(SPUUpdateDriverCompletion)completionBlock +- (void)resumeUpdate:(SPUResumableUpdate *)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock { - [self.uiDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; + [self.uiDriver resumeUpdate:resumableUpdate completion:completionBlock]; } - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error