diff --git a/Sparkle/SUOperatingSystem.m b/Sparkle/SUOperatingSystem.m index ada6259b..10993585 100644 --- a/Sparkle/SUOperatingSystem.m +++ b/Sparkle/SUOperatingSystem.m @@ -20,14 +20,13 @@ { NSOperatingSystemVersion version = { 0, 0, 0 }; NSURL *coreServices = [[NSFileManager defaultManager] URLForDirectory:NSCoreServiceDirectory inDomain:NSSystemDomainMask appropriateForURL:nil create:NO error:nil]; - NSURL *url = [coreServices URLByAppendingPathComponent:@"SystemVersion.plist"] ; - if (url) { - NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:url]; - NSArray *components = [ [dictionary objectForKey: @"ProductVersion"] componentsSeparatedByString:@"."]; - version.majorVersion = components.count > 0 ? [ [components objectAtIndex:0] integerValue] : 0; - version.minorVersion = components.count > 1 ? [ [components objectAtIndex:1] integerValue] : 0; - version.patchVersion = components.count > 2 ? [ [components objectAtIndex:2] integerValue] : 0; - } + NSURL *url = [coreServices URLByAppendingPathComponent:@"SystemVersion.plist"]; + assert(url != nil); + NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:url]; + NSArray *components = [ [dictionary objectForKey: @"ProductVersion"] componentsSeparatedByString:@"."]; + version.majorVersion = components.count > 0 ? [ [components objectAtIndex:0] integerValue] : 0; + version.minorVersion = components.count > 1 ? [ [components objectAtIndex:1] integerValue] : 0; + version.patchVersion = components.count > 2 ? [ [components objectAtIndex:2] integerValue] : 0; return version; } #endif diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 255b2da5..22a71bec 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -128,15 +128,15 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if (!hasPublicDSAKey) { if (!isMainBundle) { - [self showAlertText:NSLocalizedString(@"Insecure update error!", nil) - informativeText:NSLocalizedString(@"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.", nil)]; + [self showAlertText:SULocalizedString(@"Insecure update error!", nil) + informativeText:SULocalizedString(@"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.", nil)]; } else { if (!hostIsCodeSigned) { - [self showAlertText:NSLocalizedString(@"Insecure update error!", nil) - informativeText:NSLocalizedString(@"For security reasons, you need to code sign your application or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information.", nil)]; + [self showAlertText:SULocalizedString(@"Insecure update error!", nil) + informativeText:SULocalizedString(@"For security reasons, you need to code sign your application or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information.", nil)]; } else if (!servingOverHttps) { - [self showAlertText:NSLocalizedString(@"Insecure update error!", nil) - informativeText:NSLocalizedString(@"For security reasons, you need to serve your updates over HTTPS and/or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information.", nil)]; + [self showAlertText:SULocalizedString(@"Insecure update error!", nil) + informativeText:SULocalizedString(@"For security reasons, you need to serve your updates over HTTPS and/or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information.", nil)]; } } } @@ -145,8 +145,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if (!servingOverHttps) { BOOL atsExceptionsExist = nil != [self.host objectForInfoDictionaryKey:@"NSAppTransportSecurity"]; if (isMainBundle && !atsExceptionsExist) { - [self showAlertText:NSLocalizedString(@"Insecure feed URL is blocked in macOS 10.11", nil) - informativeText:[NSString stringWithFormat:NSLocalizedString(@"You must change the feed URL (%@) to use HTTPS or disable App Transport Security.\n\nFor more information:\nhttps://sparkle-project.org/documentation/app-transport-security/", nil), [feedURL absoluteString]]]; + [self showAlertText:SULocalizedString(@"Insecure feed URL is blocked in macOS 10.11", nil) + informativeText:[NSString stringWithFormat:SULocalizedString(@"You must change the feed URL (%@) to use HTTPS or disable App Transport Security.\n\nFor more information:\nhttps://sparkle-project.org/documentation/app-transport-security/", nil), [feedURL absoluteString]]]; } else if (!isMainBundle) { SULog(@"WARNING: Serving updates over HTTP may be blocked in macOS 10.11. Please change the feed URL (%@) to use HTTPS. For more information:\nhttps://sparkle-project.org/documentation/app-transport-security/", feedURL); }