From bc833640e4f4ace0697a077bf2f89c6181111a27 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 14 Nov 2022 09:57:15 +0100 Subject: [PATCH 1/2] updated to current sparkle version --- Cartfile | 2 +- Cartfile.resolved | 2 +- MacPass/MPAppDelegate.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cartfile b/Cartfile index 9408ddd5..775309f4 100644 --- a/Cartfile +++ b/Cartfile @@ -1,4 +1,4 @@ -github "sparkle-project/Sparkle" ~> 1.22 +binary "https://sparkle-project.org/Carthage/Sparkle.json" github "MacPass/TransformerKit" "a8b5bb73cc327ec6798569b865c32fec5eb2289f" github "MacPass/KeePassKit" ~> 3.2.0 github "mstarke/HNHUi" ~> 6.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 8cb4dc2a..8527db1a 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,5 +1,5 @@ +binary "https://sparkle-project.org/Carthage/Sparkle.json" "2.3.0" github "MacPass/KeePassKit" "3.2.1" github "MacPass/KissXML" "933f04fe5ad95c2be07ec0c2f801e140007f20fa" github "MacPass/TransformerKit" "a8b5bb73cc327ec6798569b865c32fec5eb2289f" github "mstarke/HNHUi" "6.0" -github "sparkle-project/Sparkle" "1.27.1" diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 84d1e5a4..5ab89a6d 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -221,7 +221,7 @@ typedef NS_OPTIONS(NSInteger, MPAppStartupState) { #endif self.startupState |= MPAppStartupStateFinishedLaunch; // Here we just opt-in for allowing our bar to be customized throughout the app. - NSApplication.sharedApplication.automaticCustomizeTouchBarMenuItemEnabled = YES; + NSApplication.sharedApplication.automaticCustomizeTouchBarMenuItemEnabled = YES; } #pragma mark - From 45e2402e5f274cb9b15789bc55ed49fdfeac4960 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Thu, 17 Nov 2022 20:36:33 +0100 Subject: [PATCH 2/2] updated to Sparkle 2 --- MacPass/Base.lproj/UpdatePreferences.xib | 12 ++++++------ MacPass/MPAppDelegate.h | 2 ++ MacPass/MPAppDelegate.m | 7 +++++-- MacPass/MPUpdatePreferencesController.m | 11 ++++++++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/MacPass/Base.lproj/UpdatePreferences.xib b/MacPass/Base.lproj/UpdatePreferences.xib index 410ca3c6..9789b4ed 100644 --- a/MacPass/Base.lproj/UpdatePreferences.xib +++ b/MacPass/Base.lproj/UpdatePreferences.xib @@ -1,8 +1,8 @@ - + - + @@ -16,10 +16,10 @@ - + - + - + diff --git a/MacPass/MPAppDelegate.h b/MacPass/MPAppDelegate.h index caf9f770..bdf64b8d 100644 --- a/MacPass/MPAppDelegate.h +++ b/MacPass/MPAppDelegate.h @@ -25,6 +25,7 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings; @class MPEntryContextMenuDelegate; +@class SPUUpdater; @interface MPAppDelegate : NSObject @@ -36,6 +37,7 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings; @property (strong) IBOutlet NSMenu *exportMenu; @property (strong, readonly) MPEntryContextMenuDelegate *itemActionMenuDelegate; +@property (strong, readonly) SPUUpdater *updater; @property (readonly) BOOL isTerminating; @property (nonatomic) BOOL isAllowedToStoreKeyFile; diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 5ab89a6d..90bbf441 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -67,6 +67,7 @@ typedef NS_OPTIONS(NSInteger, MPAppStartupState) { } @property (strong) NSWindow *welcomeWindow; +@property (strong) SPUUpdater *updater; @property (strong) IBOutlet NSWindow *passwordCreatorWindow; @property (strong, nonatomic) MPPreferencesWindowController *preferencesController; @property (strong, nonatomic) MPPasswordCreatorViewController *passwordCreatorController; @@ -217,7 +218,9 @@ typedef NS_OPTIONS(NSInteger, MPAppStartupState) { [MPPluginHost sharedHost]; #if !defined(DEBUG) && !defined(NO_SPARKLE) /* Disable updates if in debug or nosparkle */ - [SUUpdater sharedUpdater]; + SPUStandardUserDriver *userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:NSBundle.mainBundle delegate:nil]; + self.updater = [[SPUUpdater alloc] initWithHostBundle:NSBundle.mainBundle applicationBundle:NSBundle.mainBundle userDriver:userDriver delegate:nil]; + [self.updater startUpdater:nil]; #endif self.startupState |= MPAppStartupStateFinishedLaunch; // Here we just opt-in for allowing our bar to be customized throughout the app. @@ -364,7 +367,7 @@ typedef NS_OPTIONS(NSInteger, MPAppStartupState) { [alert addButtonWithTitle:NSLocalizedString(@"OK", @"Ok Button to dismiss disabled updates alert")]; [alert runModal]; #else - [[SUUpdater sharedUpdater] checkForUpdates:sender]; + [self.updater checkForUpdates]; #endif } diff --git a/MacPass/MPUpdatePreferencesController.m b/MacPass/MPUpdatePreferencesController.m index 9a1c9c1e..180e4ba8 100644 --- a/MacPass/MPUpdatePreferencesController.m +++ b/MacPass/MPUpdatePreferencesController.m @@ -21,6 +21,10 @@ // #import "MPUpdatePreferencesController.h" +#import "MPAppDelegate.h" + +#import "NSApplication+MPAdditions.h" + #import @interface MPUpdatePreferencesController () @@ -53,9 +57,10 @@ self.checkIntervallPopupButton.enabled = NO; self.automaticallyCheckForUpdatesCheckButton.enabled = NO; #else - [self.checkIntervallPopupButton bind:NSSelectedTagBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(updateCheckInterval)) options:nil]; - [self.checkIntervallPopupButton bind:NSEnabledBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(automaticallyChecksForUpdates)) options:nil]; - [self.automaticallyCheckForUpdatesCheckButton bind:NSValueBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(automaticallyChecksForUpdates)) options:nil]; + SPUUpdater *updater = NSApplication.sharedApplication.mp_delegate.updater; + [self.checkIntervallPopupButton bind:NSSelectedTagBinding toObject:updater withKeyPath:NSStringFromSelector(@selector(updateCheckInterval)) options:nil]; + [self.checkIntervallPopupButton bind:NSEnabledBinding toObject:updater withKeyPath:NSStringFromSelector(@selector(automaticallyChecksForUpdates)) options:nil]; + [self.automaticallyCheckForUpdatesCheckButton bind:NSValueBinding toObject:updater withKeyPath:NSStringFromSelector(@selector(automaticallyChecksForUpdates)) options:nil]; #endif }