Skip to content

Commit

Permalink
Merge pull request #8 from PhorionTech/prerelease
Browse files Browse the repository at this point in the history
Adds prerelease functionality
  • Loading branch information
calhall authored Nov 20, 2023
2 parents 24bf1a1 + c8432c5 commit f4b2808
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions Shared/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@

#define SETTING_ESF @"KronosESFTamperingDetectionEnabled"
#define SETTING_SENTRY @"KronosSentryTelemetryEnabled"
#define SETTING_PRERELEASE_UPDATES @"KronosSparklePreReleaseUpdates"

#endif /* Constants_h */
13 changes: 11 additions & 2 deletions TCCKronos/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -278,6 +279,14 @@ -(void)setActivationPolicy
return;
}

- (NSSet<NSString *> *)allowedChannelsForUpdater:(SPUUpdater *)updater {
if ([[NSUserDefaults standardUserDefaults] boolForKey:SETTING_PRERELEASE_UPDATES]) {
return [NSSet setWithObject:@"prerelease"];
} else {
return [NSSet set];
}
}

- (BOOL)supportsGentleScheduledUpdateReminders {
return YES;
}
Expand Down

0 comments on commit f4b2808

Please sign in to comment.