diff --git a/App/AppDelegate.m b/App/AppDelegate.m index 5e646b2a6..9b93b3377 100644 --- a/App/AppDelegate.m +++ b/App/AppDelegate.m @@ -22,6 +22,7 @@ #import "AppTranslocationManager.h" #import "MessagePort_App.h" #import +#import "SparkleUpdaterController.h" @interface AppDelegate () @@ -187,13 +188,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification { NSString *feedURLString; - if (checkForPrereleases) { - feedURLString = fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSubBeta); - } else { - feedURLString = fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSub); - } - - up.feedURL = [NSURL URLWithString:feedURLString]; + [SparkleUpdaterController enablePrereleaseChannel:checkForPrereleases]; [up checkForUpdatesInBackground]; } diff --git a/App/Base.lproj/MouseFix.xib b/App/Base.lproj/MouseFix.xib index eb860439c..0d29ef0ab 100644 --- a/App/Base.lproj/MouseFix.xib +++ b/App/Base.lproj/MouseFix.xib @@ -1,7 +1,6 @@ - @@ -62,7 +61,7 @@ - + @@ -179,14 +178,14 @@ - + - + @@ -357,7 +356,7 @@ Tips: - + diff --git a/App/MoreSheet/MoreSheet.m b/App/MoreSheet/MoreSheet.m index b8e4cbbf5..cf4a054cf 100644 --- a/App/MoreSheet/MoreSheet.m +++ b/App/MoreSheet/MoreSheet.m @@ -13,6 +13,7 @@ #import "AppDelegate.h" #import "Utility_App.h" #import +#import "SparkleUpdaterController.h" @interface MoreSheet () @@ -50,7 +51,8 @@ - (IBAction)checkForUpdateCheckBox:(NSButton *)sender { } - (IBAction)prereleaseCheckBox:(NSButton *)sender { [self updateConfigFileToUIState]; - if (sender.state == 1) { + [SparkleUpdaterController enablePrereleaseChannel:sender.state]; + if (sender.state == 1) { [SUUpdater.sharedUpdater checkForUpdatesInBackground]; } } diff --git a/App/SupportFiles/Info.plist b/App/SupportFiles/Info.plist index 2c1a0d6db..8479bbf4a 100644 --- a/App/SupportFiles/Info.plist +++ b/App/SupportFiles/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 306 + $(CURRENT_PROJECT_VERSION) LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright diff --git a/App/Update/SparkleUpdaterDelegate.h b/App/Update/SparkleUpdaterController.h similarity index 79% rename from App/Update/SparkleUpdaterDelegate.h rename to App/Update/SparkleUpdaterController.h index fc52bfd0e..910c2d0c0 100644 --- a/App/Update/SparkleUpdaterDelegate.h +++ b/App/Update/SparkleUpdaterController.h @@ -12,7 +12,10 @@ NS_ASSUME_NONNULL_BEGIN -@interface SparkleUpdaterDelegate : NSObject +@interface SparkleUpdaterController : NSObject + ++ (void)enablePrereleaseChannel:(BOOL)pre; + @end NS_ASSUME_NONNULL_END diff --git a/App/Update/SparkleUpdaterDelegate.m b/App/Update/SparkleUpdaterController.m similarity index 66% rename from App/Update/SparkleUpdaterDelegate.m rename to App/Update/SparkleUpdaterController.m index cf46686d6..a9accfa46 100644 --- a/App/Update/SparkleUpdaterDelegate.m +++ b/App/Update/SparkleUpdaterController.m @@ -7,13 +7,21 @@ // -------------------------------------------------------------------------- // -#import "SparkleUpdaterDelegate.h" +#import "SparkleUpdaterController.h" #import "AppDelegate.h" +#import "SharedUtility.h" // See https://sparkle-project.org/documentation/customization/ -@implementation SparkleUpdaterDelegate +@implementation SparkleUpdaterController ++ (void)enablePrereleaseChannel:(BOOL)pre { + if (pre) { + SUUpdater.sharedUpdater.feedURL = [NSURL URLWithString:fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSubBeta)]; + } else { + SUUpdater.sharedUpdater.feedURL = [NSURL URLWithString:fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSub)]; + } +} - (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)updater { return NO; diff --git a/Mouse Fix.xcodeproj/project.pbxproj b/Mouse Fix.xcodeproj/project.pbxproj index 909a8e93a..ba642a785 100644 --- a/Mouse Fix.xcodeproj/project.pbxproj +++ b/Mouse Fix.xcodeproj/project.pbxproj @@ -19,7 +19,7 @@ 4F37FAD825FDFDC5004C34C4 /* MFScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F37FAD725FDFDC4004C34C4 /* MFScrollView.m */; }; 4F39BC26263AC31600FDF692 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F39BC24263AC2E800FDF692 /* Sparkle.framework */; }; 4F39BC27263AC31600FDF692 /* Sparkle.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4F39BC24263AC2E800FDF692 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4F39BC3B263AF2B000FDF692 /* SparkleUpdaterDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterDelegate.m */; }; + 4F39BC3B263AF2B000FDF692 /* SparkleUpdaterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterController.m */; }; 4F39BC4A263B179200FDF692 /* AppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F39BC49263B179200FDF692 /* AppState.m */; }; 4F44FEF82606A5C100926A5E /* default_config.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4F44FEF72606A5C100926A5E /* default_config.plist */; }; 4F44FF042606D73D00926A5E /* SharedMessagePort.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F44FF032606D73D00926A5E /* SharedMessagePort.m */; }; @@ -213,8 +213,8 @@ 4F37FAD625FDFDC4004C34C4 /* MFScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFScrollView.h; sourceTree = ""; }; 4F37FAD725FDFDC4004C34C4 /* MFScrollView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFScrollView.m; sourceTree = ""; }; 4F39BC24263AC2E800FDF692 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = ""; }; - 4F39BC39263AF2B000FDF692 /* SparkleUpdaterDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SparkleUpdaterDelegate.h; sourceTree = ""; }; - 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SparkleUpdaterDelegate.m; sourceTree = ""; }; + 4F39BC39263AF2B000FDF692 /* SparkleUpdaterController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SparkleUpdaterController.h; sourceTree = ""; }; + 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SparkleUpdaterController.m; sourceTree = ""; }; 4F39BC48263B179200FDF692 /* AppState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppState.h; sourceTree = ""; }; 4F39BC49263B179200FDF692 /* AppState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppState.m; sourceTree = ""; }; 4F39BC5C263B401E00FDF692 /* generate_appcasts.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = generate_appcasts.sh; sourceTree = ""; }; @@ -811,8 +811,8 @@ 4FF665C625F2C92700689B77 /* Update */ = { isa = PBXGroup; children = ( - 4F39BC39263AF2B000FDF692 /* SparkleUpdaterDelegate.h */, - 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterDelegate.m */, + 4F39BC39263AF2B000FDF692 /* SparkleUpdaterController.h */, + 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterController.m */, ); path = Update; sourceTree = ""; @@ -1458,7 +1458,7 @@ 4FF665ED25F2C92700689B77 /* MFSegmentedControl.m in Sources */, 4FF6660225F2C92700689B77 /* ClickableImageView.m in Sources */, 4F79A81C2604317200076A7E /* MFNotificationController.m in Sources */, - 4F39BC3B263AF2B000FDF692 /* SparkleUpdaterDelegate.m in Sources */, + 4F39BC3B263AF2B000FDF692 /* SparkleUpdaterController.m in Sources */, 4F1C51DA260543DD007F4930 /* NSTextField+Additions.m in Sources */, 4F2F5DA825FB6FFD0037660A /* AddWindowController.m in Sources */, 4FF6655025F2C7B000689B77 /* NSArray+Additions.m in Sources */, @@ -1640,6 +1640,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 320; DEVELOPMENT_TEAM = H6Z6W2F7ZZ; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -1668,6 +1669,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 320; DEVELOPMENT_TEAM = H6Z6W2F7ZZ; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = (