diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index cd1773b9..c4cc79c5 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -52,7 +52,6 @@ CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES -CLANG_WARN_OBJC_RECEIVER_WEAK = YES CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES CLANG_WARN_UNREACHABLE_CODE = YES @@ -88,4 +87,4 @@ CLANG_ENABLE_MODULES[sdk=macosx10.8] = NO WARNING_CFLAGS_EXTRA = -Wno-custom-atomic-properties -Wno-implicit-atomic-properties // Turn on all warnings, then disable a few which are almost impossible to avoid -WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wno-auto-import $(WARNING_CFLAGS_EXTRA) +WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-arc-repeated-use-of-weak -Wno-auto-import $(WARNING_CFLAGS_EXTRA) diff --git a/Sparkle/SUAppcast.m b/Sparkle/SUAppcast.m index c7e8738c..d4f32fd9 100644 --- a/Sparkle/SUAppcast.m +++ b/Sparkle/SUAppcast.m @@ -128,7 +128,10 @@ if (!attrName) { continue; } - [dictionary setObject:[attribute stringValue] forKey:attrName]; + NSString *stringValue = [attribute stringValue]; + if (stringValue) { + [dictionary setObject:stringValue forKey:attrName]; + } } return dictionary; } diff --git a/Sparkle/SUOperatingSystem.m b/Sparkle/SUOperatingSystem.m index 2d528027..10993585 100644 --- a/Sparkle/SUOperatingSystem.m +++ b/Sparkle/SUOperatingSystem.m @@ -20,7 +20,9 @@ { NSOperatingSystemVersion version = { 0, 0, 0 }; NSURL *coreServices = [[NSFileManager defaultManager] URLForDirectory:NSCoreServiceDirectory inDomain:NSSystemDomainMask appropriateForURL:nil create:NO error:nil]; - NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:[coreServices URLByAppendingPathComponent:@"SystemVersion.plist"]]; + 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; diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 39698693..3589ffd3 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -260,7 +260,7 @@ { NSURL *requestURL = request.URL; NSString *scheme = requestURL.scheme; - BOOL whitelistedSafe = [@"http" isEqualToString:scheme] || [@"https" isEqualToString:scheme] || [@"about:blank" isEqualToString:requestURL.absoluteString]; + BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [requestURL.absoluteString isEqualToString:@"about:blank"]; // Do not allow redirects to dangerous protocols such as file:// if (!whitelistedSafe) { diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 83f61422..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:@"Insecure update error!" - informativeText:@"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information."]; + [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:@"Insecure update error!" - informativeText:@"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."]; + [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:@"Insecure update error!" - informativeText:@"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."]; + [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:@"Insecure feed URL is blocked in macOS 10.11" - informativeText:[NSString stringWithFormat:@"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/", [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); }