mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Bump minimum deployment target to 12.0 (#2883)
To support building Sparkle in Xcode 27 (beta 1), we need to bump the deployment target.
This commit is contained in:
17 files changed
+96
-234
No files matched your search
@@ -165,21 +165,9 @@ static NSUInteger fileCountForDirectory(NSFileManager *fileManager, NSString *it
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
if (@available(macOS 10.15, *)) {
|
||||
if (![inputPipe.fileHandleForWriting writeData:inputData error:&error]) {
|
||||
goto reportError;
|
||||
}
|
||||
if (![inputPipe.fileHandleForWriting writeData:inputData error:&error]) {
|
||||
goto reportError;
|
||||
}
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
||||
else
|
||||
{
|
||||
@try {
|
||||
[inputPipe.fileHandleForWriting writeData:inputData];
|
||||
} @catch (NSException *) {
|
||||
goto reportError;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[inputPipe.fileHandleForWriting closeFile];
|
||||
|
||||
|
||||
+24
-103
@@ -41,25 +41,12 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
||||
@".tar.lzma" : extractTXZ,
|
||||
} mutableCopy];
|
||||
|
||||
// At least the latest versions of 10.15 understand how to extract aar files
|
||||
// Versions before 10.15 do not understand extracting newly created aar files
|
||||
// Note encrypted aea files are supported in macOS 12 onwards, if we ever want to support those one day
|
||||
if (@available(macOS 10.15.7, *)) {
|
||||
NSString *appleArchiveCommand;
|
||||
if (@available(macOS 11, *)) {
|
||||
appleArchiveCommand = @"/usr/bin/aa";
|
||||
} else {
|
||||
// In 10.15 the utility was named yaa, which was later renamed to aar
|
||||
appleArchiveCommand = @"/usr/bin/yaa";
|
||||
}
|
||||
|
||||
NSArray <NSString *> *extractAppleArchive = @[appleArchiveCommand, @"extract", @"-d"];
|
||||
|
||||
[extractCommandDictionary addEntriesFromDictionary:@{
|
||||
@".aar" : extractAppleArchive,
|
||||
@".yaa" : extractAppleArchive,
|
||||
}];
|
||||
}
|
||||
NSArray <NSString *> *extractAppleArchive = @[@"/usr/bin/aa", @"extract", @"-d"];
|
||||
|
||||
[extractCommandDictionary addEntriesFromDictionary:@{
|
||||
@".aar" : extractAppleArchive,
|
||||
@".yaa" : extractAppleArchive,
|
||||
}];
|
||||
|
||||
NSString *lastPathComponent = [path lastPathComponent];
|
||||
for (NSString *currentType in extractCommandDictionary)
|
||||
@@ -234,38 +221,12 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
||||
|
||||
NSFileHandle *archiveOutput = [pipe fileHandleForWriting];
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
||||
BOOL hasIOErrorMethods;
|
||||
if (@available(macOS 10.15, *)) {
|
||||
hasIOErrorMethods = YES;
|
||||
} else {
|
||||
hasIOErrorMethods = NO;
|
||||
}
|
||||
#endif
|
||||
|
||||
do {
|
||||
NSData *data;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
||||
if (!hasIOErrorMethods) {
|
||||
@try {
|
||||
data = [archiveInput readDataOfLength:256*1024];
|
||||
} @catch (NSException *exception) {
|
||||
SULog(SULogLevelError, @"Failed to read data from archive with exception reason %@", exception.reason);
|
||||
data = nil;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
NSError *readError = nil;
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wpartial-availability"
|
||||
data = [archiveInput readDataUpToLength:256*1024 error:&readError];
|
||||
#pragma clang diagnostic pop
|
||||
if (data == nil) {
|
||||
SULog(SULogLevelError, @"Failed to read data from archive with error %@", readError);
|
||||
underlyingOutError = readError;
|
||||
}
|
||||
NSError *readError = nil;
|
||||
NSData *data = [archiveInput readDataUpToLength:256*1024 error:&readError];
|
||||
if (data == nil) {
|
||||
SULog(SULogLevelError, @"Failed to read data from archive with error %@", readError);
|
||||
underlyingOutError = readError;
|
||||
}
|
||||
|
||||
NSUInteger len = [data length];
|
||||
@@ -274,37 +235,13 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
||||
}
|
||||
|
||||
NSError *writeError = nil;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
||||
if (!hasIOErrorMethods) {
|
||||
@try {
|
||||
[archiveOutput writeData:data];
|
||||
} @catch (NSException *exception) {
|
||||
SULog(SULogLevelError, @"Failed to write data to pipe with exception reason %@", exception.reason);
|
||||
|
||||
if ([exception.name isEqualToString:NSFileHandleOperationException]) {
|
||||
NSError *underlyingFileHandleError = exception.userInfo[@"NSFileHandleOperationExceptionUnderlyingError"];
|
||||
NSError *underlyingPOSIXError = underlyingFileHandleError.userInfo[NSUnderlyingErrorKey];
|
||||
|
||||
underlyingOutError = underlyingPOSIXError;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wpartial-availability"
|
||||
if (![archiveOutput writeData:data error:&writeError]) {
|
||||
#pragma clang diagnostic pop
|
||||
SULog(SULogLevelError, @"Failed to write data to pipe with error %@", writeError);
|
||||
|
||||
NSError *underlyingPOSIXError = writeError.userInfo[NSUnderlyingErrorKey];
|
||||
|
||||
underlyingOutError = underlyingPOSIXError;
|
||||
break;
|
||||
}
|
||||
if (![archiveOutput writeData:data error:&writeError]) {
|
||||
SULog(SULogLevelError, @"Failed to write data to pipe with error %@", writeError);
|
||||
|
||||
NSError *underlyingPOSIXError = writeError.userInfo[NSUnderlyingErrorKey];
|
||||
|
||||
underlyingOutError = underlyingPOSIXError;
|
||||
break;
|
||||
}
|
||||
|
||||
bytesWritten += len;
|
||||
@@ -313,31 +250,15 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
||||
}
|
||||
while(bytesWritten < expectedLength);
|
||||
|
||||
if (@available(macOS 10.15, *)) {
|
||||
NSError *archiveOutputCloseError = nil;
|
||||
if (![archiveOutput closeAndReturnError:&archiveOutputCloseError]) {
|
||||
SULog(SULogLevelError, @"Failed to close pipe with error %@", archiveOutputCloseError);
|
||||
}
|
||||
NSError *archiveOutputCloseError = nil;
|
||||
if (![archiveOutput closeAndReturnError:&archiveOutputCloseError]) {
|
||||
SULog(SULogLevelError, @"Failed to close pipe with error %@", archiveOutputCloseError);
|
||||
}
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
||||
else
|
||||
{
|
||||
[archiveOutput closeFile];
|
||||
}
|
||||
#endif
|
||||
|
||||
if (@available(macOS 10.15, *)) {
|
||||
NSError *archiveInputCloseError = nil;
|
||||
if (![archiveInput closeAndReturnError:&archiveInputCloseError]) {
|
||||
SULog(SULogLevelError, @"Failed to close archive input with error %@", archiveInputCloseError);
|
||||
}
|
||||
NSError *archiveInputCloseError = nil;
|
||||
if (![archiveInput closeAndReturnError:&archiveInputCloseError]) {
|
||||
SULog(SULogLevelError, @"Failed to close archive input with error %@", archiveInputCloseError);
|
||||
}
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
||||
else
|
||||
{
|
||||
[archiveInput closeFile];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
[task waitUntilExit];
|
||||
|
||||
@@ -46,7 +46,7 @@ SPARKLE_COPY_LOCALIZATIONS = 1
|
||||
OTHER_SWIFT_FLAGS_COMMON = -DSPARKLE_BUILD_LEGACY_DSA_SUPPORT -DGENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT -DSPARKLE_BUILD_PACKAGE_SUPPORT
|
||||
|
||||
// Minimum supported macOS version
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0
|
||||
|
||||
// Archs to use for Sparkle
|
||||
// You can change this for example to add arm64e or remove x86_64
|
||||
|
||||
@@ -192,15 +192,7 @@
|
||||
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:iconBundlePath];
|
||||
|
||||
// Creating a bitmap representation at a specific size is much cheaper than asking for icon's TIFFRepresentation
|
||||
// On older OS's we must create a 32x32 image otherwise it won't be scaled correctly in the dialog
|
||||
// On newer OS's we can use a slightly higher resolution image
|
||||
NSInteger imageDimensions;
|
||||
if (@available(macOS 10.15, *)) {
|
||||
imageDimensions = 64;
|
||||
} else {
|
||||
imageDimensions = 32;
|
||||
}
|
||||
|
||||
const NSInteger imageDimensions = 64;
|
||||
NSBitmapImageRep *iconBitmapRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:imageDimensions pixelsHigh:imageDimensions bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:0 bitsPerPixel:0];
|
||||
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/S
|
||||
|
||||
let package = Package(
|
||||
name: "Sparkle",
|
||||
platforms: [.macOS(.v10_13)], // leaving "10.13" as a breadcrumb for searching
|
||||
platforms: [.macOS(.v12)], // leaving "12.0" as a breadcrumb for searching
|
||||
products: [
|
||||
.library(
|
||||
name: "Sparkle",
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ Please visit [Sparkle's website](http://sparkle-project.org) for up to date docu
|
||||
|
||||
## Requirements
|
||||
|
||||
* Runtime: macOS 10.13 or later.
|
||||
* Runtime: macOS 12.0 or later on `2.x`, macOS 10.13 or later on `2.9.3`.
|
||||
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less.
|
||||
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</sparkle:fullReleaseNotesLink>
|
||||
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%202.0.zip" length="1623481" type="application/octet-stream" sparkle:edSignature="WVyVJpOx+a5+vNWJVY79TRjFKveNk+VhGJf2iti4CZtJsJewIUGvh/1AKKEAFbH1qUwx+vro1ECuzOsMmumoBA==" />
|
||||
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
|
||||
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
@@ -31,7 +31,7 @@
|
||||
</sparkle:fullReleaseNotesLink>
|
||||
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%201.5.zip" length="1472893" type="application/octet-stream" sparkle:edSignature="pNFd7KbcQSu+Mq7UYrbQXTPq82luht2ACXm/r2utp1u/Uv/5hWqctdT2jwQgMejW7DRoeV/hVr6J4VdZYdwWDw==" />
|
||||
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
|
||||
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
|
||||
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
|
||||
@@ -48,7 +48,7 @@
|
||||
<sparkle:shortVersionString>1.4</sparkle:shortVersionString>
|
||||
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%201.4.zip" sparkle:edSignature="Ody3D/ybSMH4T+P/oNj3LN4F0SA8RJGLEr1TI4UemrBAiJ9aEcDnYV3u58P75AbcFjI13jPYmHDUHXMSTFQbDw==" length="1472349" type="application/octet-stream" />
|
||||
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
|
||||
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
+1
-1
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
|
||||
'Andy Matuschak' => 'andy@andymatuschak.org',
|
||||
}
|
||||
|
||||
s.platform = :osx, '10.13'
|
||||
s.platform = :osx, '12.0'
|
||||
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.xz" }
|
||||
s.source_files = 'Sparkle.framework/Versions/B/Headers/*.h'
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
|
||||
NSMutableArray<NSRunningApplication *> *potentialMatchingTranslocatedRunningApplications = [[NSMutableArray alloc] init];
|
||||
|
||||
BOOL needsToHandleImproperBundles;
|
||||
if (@available(macOS 16, *)) {
|
||||
if (@available(macOS 26, *)) {
|
||||
needsToHandleImproperBundles = NO;
|
||||
} else {
|
||||
needsToHandleImproperBundles = YES;
|
||||
|
||||
Vendored
+1
-1
@@ -188,7 +188,7 @@ SU_EXPORT NS_SWIFT_SENDABLE @interface SUAppcastItem : NSObject<NSSecureCoding>
|
||||
|
||||
This version string should contain three period-separated components.
|
||||
|
||||
Example: @c 10.13.0
|
||||
Example: @c 12.0.0
|
||||
|
||||
Use `minimumOperatingSystemVersionIsOK` property to test if the current running system passes this requirement.
|
||||
|
||||
|
||||
Vendored
+4
-6
@@ -22,12 +22,10 @@ static void SULogErrors(NSArray<NSError *> *errors, int recursionLimit)
|
||||
|
||||
NSDictionary<NSErrorUserInfoKey, id> *userInfo = error.userInfo;
|
||||
|
||||
if (@available(macOS 11.3, *)) {
|
||||
NSArray<NSError *> *underlyingErrors = userInfo[NSMultipleUnderlyingErrorsKey];
|
||||
if (underlyingErrors != nil) {
|
||||
SULogErrors(underlyingErrors, recursionLimit - 1);
|
||||
continue;
|
||||
}
|
||||
NSArray<NSError *> *underlyingErrors = userInfo[NSMultipleUnderlyingErrorsKey];
|
||||
if (underlyingErrors != nil) {
|
||||
SULogErrors(underlyingErrors, recursionLimit - 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
NSError *underlyingError = userInfo[NSUnderlyingErrorKey];
|
||||
|
||||
Vendored
+1
-1
@@ -88,7 +88,7 @@ static NSString *const SUStatusControllerTouchBarIdentifier = @"" SPARKLE_BUNDLE
|
||||
[_progressBar setUsesThreadedAnimation:YES];
|
||||
[_statusTextField setFont:[NSFont monospacedDigitSystemFontOfSize:0 weight:NSFontWeightRegular]];
|
||||
|
||||
if (@available(macOS 16, *)) {
|
||||
if (@available(macOS 26, *)) {
|
||||
_actionButton.controlSize = NSControlSizeLarge;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+26
-33
@@ -55,7 +55,7 @@
|
||||
// So even though macOS 12 supports TextKit 2 we do not use it there.
|
||||
// My development machines are currently on macOS 26 so I know TextKit 2 works well there.
|
||||
// macOS 13 - 15 requires more testing if we care to make the switch there.
|
||||
if (@available(macOS 16, *)) {
|
||||
if (@available(macOS 26, *)) {
|
||||
// Create NSTextView using TextKit 2
|
||||
// https://developer.apple.com/documentation/appkit/nstextview/1449347-initwithframe
|
||||
|
||||
@@ -363,45 +363,38 @@ static NSAttributedString *formatMarkdownAttributedString(NSAttributedString *or
|
||||
[_textView setContinuousSpellCheckingEnabled:NO];
|
||||
_textView.usesFontPanel = NO;
|
||||
_textView.editable = NO;
|
||||
|
||||
if (@available(macOS 10.14, *)) {
|
||||
_textView.usesAdaptiveColorMappingForDarkAppearance = YES;
|
||||
}
|
||||
_textView.usesAdaptiveColorMappingForDarkAppearance = YES;
|
||||
|
||||
[_scrollView setHasVerticalScroller:YES];
|
||||
[_scrollView setHasHorizontalScroller:NO];
|
||||
|
||||
if (_prefersMarkdown) {
|
||||
if (@available(macOS 12, *)) {
|
||||
dispatch_queue_attr_t queuePriority = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INITIATED, 0);
|
||||
dispatch_queue_attr_t queuePriority = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INITIATED, 0);
|
||||
|
||||
dispatch_queue_t markdownDispatchQueue = dispatch_queue_create("org.sparkle-project.markdown-loader", queuePriority);
|
||||
|
||||
dispatch_async(markdownDispatchQueue, ^{
|
||||
NSError *loadMarkdownError = nil;
|
||||
NSAttributedString *originalMarkdownAttributedString = [[NSAttributedString alloc] initWithMarkdownString:contents options:nil baseURL:baseURL error:&loadMarkdownError];
|
||||
|
||||
dispatch_queue_t markdownDispatchQueue = dispatch_queue_create("org.sparkle-project.markdown-loader", queuePriority);
|
||||
|
||||
dispatch_async(markdownDispatchQueue, ^{
|
||||
NSError *loadMarkdownError = nil;
|
||||
NSAttributedString *originalMarkdownAttributedString = [[NSAttributedString alloc] initWithMarkdownString:contents options:nil baseURL:baseURL error:&loadMarkdownError];
|
||||
if (originalMarkdownAttributedString == nil) {
|
||||
// Fallback to plain-text
|
||||
|
||||
if (originalMarkdownAttributedString == nil) {
|
||||
// Fallback to plain-text
|
||||
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:contents attributes:@{ NSFontAttributeName : [NSFont systemFontOfSize:(CGFloat)self->_fontPointSize] }];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self _loadAttributedString:attributedString completionHandler:completionHandler];
|
||||
});
|
||||
} else {
|
||||
NSAttributedString *formattedAttributedString = formatMarkdownAttributedString(originalMarkdownAttributedString, (CGFloat)self->_fontPointSize);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self _loadAttributedString:formattedAttributedString completionHandler:completionHandler];
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
} else {
|
||||
SULog(SULogLevelDefault, @"Warning: falling back to plain text because markdown support requires macOS 12 or newer");
|
||||
}
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:contents attributes:@{ NSFontAttributeName : [NSFont systemFontOfSize:(CGFloat)self->_fontPointSize] }];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self _loadAttributedString:attributedString completionHandler:completionHandler];
|
||||
});
|
||||
} else {
|
||||
NSAttributedString *formattedAttributedString = formatMarkdownAttributedString(originalMarkdownAttributedString, (CGFloat)self->_fontPointSize);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self _loadAttributedString:formattedAttributedString completionHandler:completionHandler];
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:contents attributes:@{ NSFontAttributeName : [NSFont systemFontOfSize:(CGFloat)_fontPointSize] }];
|
||||
|
||||
Vendored
+10
-20
@@ -299,14 +299,10 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
usedReleaseNotesFormat = preferredReleaseNotesFormat;
|
||||
break;
|
||||
case SUReleaseNotesFormatHTML:
|
||||
if (@available(macOS 10.15, *)) {
|
||||
if ([[NSProcessInfo processInfo] isMacCatalystApp]) {
|
||||
usedReleaseNotesFormat = SUReleaseNotesFormatPlainText;
|
||||
|
||||
SULog(SULogLevelError, @"Error: Showing HTML release notes for Catalyst apps is not supported. The release notes will be interpreted as plain text. Please serve a plain-text (.txt) or markdown (.md) release notes file. If you are using a <description> element then please specify the %@=\"plain-text\" or %@=\"markdown\" attribute in that element.", SUAppcastAttributeFormat, SUAppcastAttributeFormat);
|
||||
} else {
|
||||
usedReleaseNotesFormat = preferredReleaseNotesFormat;
|
||||
}
|
||||
if ([[NSProcessInfo processInfo] isMacCatalystApp]) {
|
||||
usedReleaseNotesFormat = SUReleaseNotesFormatPlainText;
|
||||
|
||||
SULog(SULogLevelError, @"Error: Showing HTML release notes for Catalyst apps is not supported. The release notes will be interpreted as plain text. Please serve a plain-text (.txt) or markdown (.md) release notes file. If you are using a <description> element then please specify the %@=\"plain-text\" or %@=\"markdown\" attribute in that element.", SUAppcastAttributeFormat, SUAppcastAttributeFormat);
|
||||
} else {
|
||||
usedReleaseNotesFormat = preferredReleaseNotesFormat;
|
||||
}
|
||||
@@ -377,12 +373,10 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
_releaseNotesView.view.frame = _releaseNotesContentView.bounds;
|
||||
_releaseNotesView.view.autoresizingMask = (NSAutoresizingMaskOptions)(NSViewWidthSizable | NSViewHeightSizable);
|
||||
|
||||
if (@available(macOS 10.14, *)) {
|
||||
// We need a transparent background
|
||||
// This avoids a "white flash" that may be present when the webview initially loads in dark mode
|
||||
// This also is necessary for macOS 10.14, otherwise the background may stay white on 10.14 (but not in later OS's)
|
||||
[_releaseNotesView setDrawsBackground:NO];
|
||||
}
|
||||
// We need a transparent background
|
||||
// This avoids a "white flash" that may be present when the webview initially loads in dark mode
|
||||
// This also is necessary for macOS 10.14, otherwise the background may stay white on 10.14 (but not in later OS's)
|
||||
[_releaseNotesView setDrawsBackground:NO];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
|
||||
@@ -413,11 +407,7 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
|
||||
_releaseNotesBoxView.boxType = NSBoxCustom;
|
||||
_releaseNotesBoxView.cornerRadius = boxCornerRadius;
|
||||
if (@available(macOS 10.14, *)) {
|
||||
_releaseNotesBoxView.borderColor = NSColor.separatorColor;
|
||||
} else {
|
||||
_releaseNotesBoxView.borderColor = [NSColor colorWithCalibratedWhite:0.84 alpha:1.0];
|
||||
}
|
||||
_releaseNotesBoxView.borderColor = NSColor.separatorColor;
|
||||
_releaseNotesBoxView.borderWidth = boxBorderWidth;
|
||||
_releaseNotesBoxView.fillColor = NSColor.textBackgroundColor;
|
||||
|
||||
@@ -436,7 +426,7 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
_installButton.title = SULocalizedStringFromTableInBundle(@"Install Update", SPARKLE_TABLE, sparkleBundle, @"");
|
||||
_automaticallyInstallUpdatesButton.title = SULocalizedStringFromTableInBundle(@"Automatically download and install updates in the future", SPARKLE_TABLE, sparkleBundle, @"");
|
||||
|
||||
if (@available(macOS 16, *)) {
|
||||
if (@available(macOS 26, *)) {
|
||||
_skipButton.controlSize = NSControlSizeLarge;
|
||||
_laterButton.controlSize = NSControlSizeLarge;
|
||||
_installButton.controlSize = NSControlSizeLarge;
|
||||
|
||||
Vendored
+1
-3
@@ -104,9 +104,7 @@
|
||||
}
|
||||
|
||||
if (underlyingErrors.count > 1) {
|
||||
if (@available(macOS 11.3, *)) {
|
||||
userInfo[NSMultipleUnderlyingErrorsKey] = [underlyingErrors copy];
|
||||
}
|
||||
userInfo[NSMultipleUnderlyingErrorsKey] = [underlyingErrors copy];
|
||||
}
|
||||
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:[userInfo copy]];
|
||||
|
||||
+11
-17
@@ -62,24 +62,18 @@ enum DecodeSecretStringError : LocalizedError {
|
||||
|
||||
// Reads secret base64 string from a file
|
||||
func decodeSecretString(filePath: String) throws -> String {
|
||||
let privateKeyString: String
|
||||
if #available(macOS 10.15.4, *) {
|
||||
// Prefer to use FileHandle which supports process substitution:
|
||||
// https://github.com/sparkle-project/Sparkle/issues/2605
|
||||
let fileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: filePath))
|
||||
|
||||
guard let data = try fileHandle.readToEnd() else {
|
||||
throw DecodeSecretStringError.unableToReadData
|
||||
}
|
||||
|
||||
guard let decodedPrivateKeyString = String(data: data, encoding: .utf8) else {
|
||||
throw DecodeSecretStringError.unableToDecodeDataAsUTF8String
|
||||
}
|
||||
|
||||
privateKeyString = decodedPrivateKeyString
|
||||
} else {
|
||||
privateKeyString = try String(contentsOf: URL(fileURLWithPath: filePath))
|
||||
// Use FileHandle because it supports process substitution:
|
||||
// https://github.com/sparkle-project/Sparkle/issues/2605
|
||||
let fileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: filePath))
|
||||
|
||||
guard let data = try fileHandle.readToEnd() else {
|
||||
throw DecodeSecretStringError.unableToReadData
|
||||
}
|
||||
|
||||
guard let decodedPrivateKeyString = String(data: data, encoding: .utf8) else {
|
||||
throw DecodeSecretStringError.unableToDecodeDataAsUTF8String
|
||||
}
|
||||
|
||||
let privateKeyString = decodedPrivateKeyString
|
||||
return privateKeyString.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
}
|
||||
@@ -89,7 +89,6 @@ class ArchiveItem: CustomStringConvertible {
|
||||
var releaseNotesURLPrefix: URL?
|
||||
var signingError: Error?
|
||||
|
||||
@available(macOS 10.15.4, *)
|
||||
private static func binaryContainsPreARMSlice(_ fileURL: URL) -> Bool? {
|
||||
guard let fileHandle = try? FileHandle(forReadingFrom: fileURL) else {
|
||||
return nil
|
||||
@@ -180,7 +179,7 @@ class ArchiveItem: CustomStringConvertible {
|
||||
self._shortVersion = shortVersion
|
||||
self.feedURL = feedURL
|
||||
self.requiresSignedAppcast = requiresSignedAppcast
|
||||
self.minimumSystemVersion = minimumSystemVersion ?? "10.13"
|
||||
self.minimumSystemVersion = minimumSystemVersion ?? "12.0"
|
||||
self.hardwareRequirements = hardwareRequirements
|
||||
self.frameworkVersion = frameworkVersion
|
||||
self.sparkleExecutableFileSize = sparkleExecutableFileSize
|
||||
@@ -199,21 +198,12 @@ class ArchiveItem: CustomStringConvertible {
|
||||
}
|
||||
|
||||
convenience init(fromArchive archivePath: URL, unarchivedDir: URL, validateBundle: Bool, disableNestedCodeCheck: Bool) throws {
|
||||
let resourceKeys: [URLResourceKey]
|
||||
if #available(macOS 11, *) {
|
||||
resourceKeys = [.contentTypeKey]
|
||||
} else {
|
||||
resourceKeys = [.typeIdentifierKey]
|
||||
}
|
||||
let resourceKeys: [URLResourceKey] = [.contentTypeKey]
|
||||
let items = try FileManager.default.contentsOfDirectory(at: unarchivedDir, includingPropertiesForKeys: resourceKeys, options: .skipsHiddenFiles)
|
||||
|
||||
let bundles = items.filter({
|
||||
if let resourceValues = try? $0.resourceValues(forKeys: Set(resourceKeys)) {
|
||||
if #available(macOS 11, *) {
|
||||
return resourceValues.contentType!.conforms(to: .bundle)
|
||||
} else {
|
||||
return UTTypeConformsTo(resourceValues.typeIdentifier! as CFString, kUTTypeBundle)
|
||||
}
|
||||
return resourceValues.contentType!.conforms(to: .bundle)
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
@@ -273,12 +263,10 @@ class ArchiveItem: CustomStringConvertible {
|
||||
|
||||
var hardwareRequirements: String? = nil
|
||||
if mayNeedHardwareRequirement {
|
||||
if #available(macOS 10.15.4, *) {
|
||||
if let executableName = infoPlist[kCFBundleExecutableKey as String] as? String {
|
||||
let executablePath = appPath.appendingPathComponent("Contents/MacOS/\(executableName)")
|
||||
if let containsPreARMSlice = Self.binaryContainsPreARMSlice(executablePath), !containsPreARMSlice {
|
||||
hardwareRequirements = SUAppcastElementHardwareRequirementARM64
|
||||
}
|
||||
if let executableName = infoPlist[kCFBundleExecutableKey as String] as? String {
|
||||
let executablePath = appPath.appendingPathComponent("Contents/MacOS/\(executableName)")
|
||||
if let containsPreARMSlice = Self.binaryContainsPreARMSlice(executablePath), !containsPreARMSlice {
|
||||
hardwareRequirements = SUAppcastElementHardwareRequirementARM64
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user