diff --git a/Shared/Constants.h b/Shared/Constants.h index dc44c43..592b7e6 100644 --- a/Shared/Constants.h +++ b/Shared/Constants.h @@ -25,5 +25,6 @@ #define SETTING_ESF @"KronosESFTamperingDetectionEnabled" #define SETTING_SENTRY @"KronosSentryTelemetryEnabled" +#define SETTING_PRERELEASE_UPDATES @"KronosSparklePreReleaseUpdates" #endif /* Constants_h */ diff --git a/TCCKronos/AppDelegate.m b/TCCKronos/AppDelegate.m index 9ad8ebf..15cfceb 100644 --- a/TCCKronos/AppDelegate.m +++ b/TCCKronos/AppDelegate.m @@ -32,7 +32,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Register a default set of values for UserDefaults NSDictionary *appDefaults = @{ SETTING_ESF: @YES, - SETTING_SENTRY: @YES + SETTING_SENTRY: @YES, + SETTING_PRERELEASE_UPDATES: @NO }; [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; @@ -132,7 +133,7 @@ - (void)checkLaunchdPlist { return; } - NSLog(@"Found existing plist at %@", targetPath); + NSLog(@"Found existing plist at %@ for a different version, replacing", targetPath); [[NSFileManager defaultManager] removeItemAtPath:targetPath error:&error]; @@ -278,6 +279,14 @@ -(void)setActivationPolicy return; } +- (NSSet *)allowedChannelsForUpdater:(SPUUpdater *)updater { + if ([[NSUserDefaults standardUserDefaults] boolForKey:SETTING_PRERELEASE_UPDATES]) { + return [NSSet setWithObject:@"prerelease"]; + } else { + return [NSSet set]; + } +} + - (BOOL)supportsGentleScheduledUpdateReminders { return YES; }