mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +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
+86
-224
No files matched your search
@@ -165,21 +165,9 @@ static NSUInteger fileCountForDirectory(NSFileManager *fileManager, NSString *it
|
|||||||
goto reportError;
|
goto reportError;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@available(macOS 10.15, *)) {
|
if (![inputPipe.fileHandleForWriting writeData:inputData error:&error]) {
|
||||||
if (![inputPipe.fileHandleForWriting writeData:inputData error:&error]) {
|
goto reportError;
|
||||||
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];
|
[inputPipe.fileHandleForWriting closeFile];
|
||||||
|
|
||||||
|
|||||||
+21
-100
@@ -41,25 +41,12 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
|||||||
@".tar.lzma" : extractTXZ,
|
@".tar.lzma" : extractTXZ,
|
||||||
} mutableCopy];
|
} mutableCopy];
|
||||||
|
|
||||||
// At least the latest versions of 10.15 understand how to extract aar files
|
NSArray <NSString *> *extractAppleArchive = @[@"/usr/bin/aa", @"extract", @"-d"];
|
||||||
// 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,
|
||||||
[extractCommandDictionary addEntriesFromDictionary:@{
|
@".yaa" : extractAppleArchive,
|
||||||
@".aar" : extractAppleArchive,
|
}];
|
||||||
@".yaa" : extractAppleArchive,
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString *lastPathComponent = [path lastPathComponent];
|
NSString *lastPathComponent = [path lastPathComponent];
|
||||||
for (NSString *currentType in extractCommandDictionary)
|
for (NSString *currentType in extractCommandDictionary)
|
||||||
@@ -234,38 +221,12 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
|||||||
|
|
||||||
NSFileHandle *archiveOutput = [pipe fileHandleForWriting];
|
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 {
|
do {
|
||||||
NSData *data;
|
NSError *readError = nil;
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
NSData *data = [archiveInput readDataUpToLength:256*1024 error:&readError];
|
||||||
if (!hasIOErrorMethods) {
|
if (data == nil) {
|
||||||
@try {
|
SULog(SULogLevelError, @"Failed to read data from archive with error %@", readError);
|
||||||
data = [archiveInput readDataOfLength:256*1024];
|
underlyingOutError = readError;
|
||||||
} @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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSUInteger len = [data length];
|
NSUInteger len = [data length];
|
||||||
@@ -274,37 +235,13 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSError *writeError = nil;
|
NSError *writeError = nil;
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
|
if (![archiveOutput writeData:data error:&writeError]) {
|
||||||
if (!hasIOErrorMethods) {
|
SULog(SULogLevelError, @"Failed to write data to pipe with error %@", writeError);
|
||||||
@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 *underlyingPOSIXError = writeError.userInfo[NSUnderlyingErrorKey];
|
||||||
NSError *underlyingFileHandleError = exception.userInfo[@"NSFileHandleOperationExceptionUnderlyingError"];
|
|
||||||
NSError *underlyingPOSIXError = underlyingFileHandleError.userInfo[NSUnderlyingErrorKey];
|
|
||||||
|
|
||||||
underlyingOutError = underlyingPOSIXError;
|
underlyingOutError = underlyingPOSIXError;
|
||||||
}
|
break;
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bytesWritten += len;
|
bytesWritten += len;
|
||||||
@@ -313,31 +250,15 @@ static NSArray<NSString *> * _Nullable argumentsConformingToTypeOfPath(NSString
|
|||||||
}
|
}
|
||||||
while(bytesWritten < expectedLength);
|
while(bytesWritten < expectedLength);
|
||||||
|
|
||||||
if (@available(macOS 10.15, *)) {
|
NSError *archiveOutputCloseError = nil;
|
||||||
NSError *archiveOutputCloseError = nil;
|
if (![archiveOutput closeAndReturnError:&archiveOutputCloseError]) {
|
||||||
if (![archiveOutput closeAndReturnError:&archiveOutputCloseError]) {
|
SULog(SULogLevelError, @"Failed to close pipe with error %@", 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;
|
||||||
NSError *archiveInputCloseError = nil;
|
if (![archiveInput closeAndReturnError:&archiveInputCloseError]) {
|
||||||
if (![archiveInput closeAndReturnError:&archiveInputCloseError]) {
|
SULog(SULogLevelError, @"Failed to close archive input with error %@", 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];
|
[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
|
OTHER_SWIFT_FLAGS_COMMON = -DSPARKLE_BUILD_LEGACY_DSA_SUPPORT -DGENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT -DSPARKLE_BUILD_PACKAGE_SUPPORT
|
||||||
|
|
||||||
// Minimum supported macOS version
|
// Minimum supported macOS version
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13
|
MACOSX_DEPLOYMENT_TARGET = 12.0
|
||||||
|
|
||||||
// Archs to use for Sparkle
|
// Archs to use for Sparkle
|
||||||
// You can change this for example to add arm64e or remove x86_64
|
// You can change this for example to add arm64e or remove x86_64
|
||||||
|
|||||||
@@ -192,15 +192,7 @@
|
|||||||
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:iconBundlePath];
|
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:iconBundlePath];
|
||||||
|
|
||||||
// Creating a bitmap representation at a specific size is much cheaper than asking for icon's TIFFRepresentation
|
// 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
|
const NSInteger imageDimensions = 64;
|
||||||
// On newer OS's we can use a slightly higher resolution image
|
|
||||||
NSInteger imageDimensions;
|
|
||||||
if (@available(macOS 10.15, *)) {
|
|
||||||
imageDimensions = 64;
|
|
||||||
} else {
|
|
||||||
imageDimensions = 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
NSBitmapImageRep *iconBitmapRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:imageDimensions pixelsHigh:imageDimensions bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:0 bitsPerPixel:0];
|
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];
|
[NSGraphicsContext saveGraphicsState];
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/S
|
|||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
name: "Sparkle",
|
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: [
|
products: [
|
||||||
.library(
|
.library(
|
||||||
name: "Sparkle",
|
name: "Sparkle",
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ Please visit [Sparkle's website](http://sparkle-project.org) for up to date docu
|
|||||||
|
|
||||||
## Requirements
|
## 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.
|
* 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/))
|
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</sparkle:fullReleaseNotesLink>
|
</sparkle:fullReleaseNotesLink>
|
||||||
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
|
<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==" />
|
<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>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</sparkle:fullReleaseNotesLink>
|
</sparkle:fullReleaseNotesLink>
|
||||||
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
|
<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==" />
|
<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>
|
</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. -->
|
<!-- 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>
|
<sparkle:shortVersionString>1.4</sparkle:shortVersionString>
|
||||||
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
|
<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" />
|
<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>
|
</item>
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
+1
-1
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
|
|||||||
'Andy Matuschak' => 'andy@andymatuschak.org',
|
'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 = { :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'
|
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];
|
NSMutableArray<NSRunningApplication *> *potentialMatchingTranslocatedRunningApplications = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
BOOL needsToHandleImproperBundles;
|
BOOL needsToHandleImproperBundles;
|
||||||
if (@available(macOS 16, *)) {
|
if (@available(macOS 26, *)) {
|
||||||
needsToHandleImproperBundles = NO;
|
needsToHandleImproperBundles = NO;
|
||||||
} else {
|
} else {
|
||||||
needsToHandleImproperBundles = YES;
|
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.
|
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.
|
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;
|
NSDictionary<NSErrorUserInfoKey, id> *userInfo = error.userInfo;
|
||||||
|
|
||||||
if (@available(macOS 11.3, *)) {
|
NSArray<NSError *> *underlyingErrors = userInfo[NSMultipleUnderlyingErrorsKey];
|
||||||
NSArray<NSError *> *underlyingErrors = userInfo[NSMultipleUnderlyingErrorsKey];
|
if (underlyingErrors != nil) {
|
||||||
if (underlyingErrors != nil) {
|
SULogErrors(underlyingErrors, recursionLimit - 1);
|
||||||
SULogErrors(underlyingErrors, recursionLimit - 1);
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSError *underlyingError = userInfo[NSUnderlyingErrorKey];
|
NSError *underlyingError = userInfo[NSUnderlyingErrorKey];
|
||||||
|
|||||||
Vendored
+1
-1
@@ -88,7 +88,7 @@ static NSString *const SUStatusControllerTouchBarIdentifier = @"" SPARKLE_BUNDLE
|
|||||||
[_progressBar setUsesThreadedAnimation:YES];
|
[_progressBar setUsesThreadedAnimation:YES];
|
||||||
[_statusTextField setFont:[NSFont monospacedDigitSystemFontOfSize:0 weight:NSFontWeightRegular]];
|
[_statusTextField setFont:[NSFont monospacedDigitSystemFontOfSize:0 weight:NSFontWeightRegular]];
|
||||||
|
|
||||||
if (@available(macOS 16, *)) {
|
if (@available(macOS 26, *)) {
|
||||||
_actionButton.controlSize = NSControlSizeLarge;
|
_actionButton.controlSize = NSControlSizeLarge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+21
-28
@@ -55,7 +55,7 @@
|
|||||||
// So even though macOS 12 supports TextKit 2 we do not use it there.
|
// 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.
|
// 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.
|
// 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
|
// Create NSTextView using TextKit 2
|
||||||
// https://developer.apple.com/documentation/appkit/nstextview/1449347-initwithframe
|
// https://developer.apple.com/documentation/appkit/nstextview/1449347-initwithframe
|
||||||
|
|
||||||
@@ -363,45 +363,38 @@ static NSAttributedString *formatMarkdownAttributedString(NSAttributedString *or
|
|||||||
[_textView setContinuousSpellCheckingEnabled:NO];
|
[_textView setContinuousSpellCheckingEnabled:NO];
|
||||||
_textView.usesFontPanel = NO;
|
_textView.usesFontPanel = NO;
|
||||||
_textView.editable = NO;
|
_textView.editable = NO;
|
||||||
|
_textView.usesAdaptiveColorMappingForDarkAppearance = YES;
|
||||||
if (@available(macOS 10.14, *)) {
|
|
||||||
_textView.usesAdaptiveColorMappingForDarkAppearance = YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
[_scrollView setHasVerticalScroller:YES];
|
[_scrollView setHasVerticalScroller:YES];
|
||||||
[_scrollView setHasHorizontalScroller:NO];
|
[_scrollView setHasHorizontalScroller:NO];
|
||||||
|
|
||||||
if (_prefersMarkdown) {
|
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_queue_t markdownDispatchQueue = dispatch_queue_create("org.sparkle-project.markdown-loader", queuePriority);
|
||||||
|
|
||||||
dispatch_async(markdownDispatchQueue, ^{
|
dispatch_async(markdownDispatchQueue, ^{
|
||||||
NSError *loadMarkdownError = nil;
|
NSError *loadMarkdownError = nil;
|
||||||
NSAttributedString *originalMarkdownAttributedString = [[NSAttributedString alloc] initWithMarkdownString:contents options:nil baseURL:baseURL error:&loadMarkdownError];
|
NSAttributedString *originalMarkdownAttributedString = [[NSAttributedString alloc] initWithMarkdownString:contents options:nil baseURL:baseURL error:&loadMarkdownError];
|
||||||
|
|
||||||
if (originalMarkdownAttributedString == nil) {
|
if (originalMarkdownAttributedString == nil) {
|
||||||
// Fallback to plain-text
|
// Fallback to plain-text
|
||||||
|
|
||||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:contents attributes:@{ NSFontAttributeName : [NSFont systemFontOfSize:(CGFloat)self->_fontPointSize] }];
|
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:contents attributes:@{ NSFontAttributeName : [NSFont systemFontOfSize:(CGFloat)self->_fontPointSize] }];
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self _loadAttributedString:attributedString completionHandler:completionHandler];
|
[self _loadAttributedString:attributedString completionHandler:completionHandler];
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
NSAttributedString *formattedAttributedString = formatMarkdownAttributedString(originalMarkdownAttributedString, (CGFloat)self->_fontPointSize);
|
NSAttributedString *formattedAttributedString = formatMarkdownAttributedString(originalMarkdownAttributedString, (CGFloat)self->_fontPointSize);
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self _loadAttributedString:formattedAttributedString completionHandler:completionHandler];
|
[self _loadAttributedString:formattedAttributedString completionHandler:completionHandler];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
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)_fontPointSize] }];
|
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:contents attributes:@{ NSFontAttributeName : [NSFont systemFontOfSize:(CGFloat)_fontPointSize] }];
|
||||||
|
|||||||
Vendored
+9
-19
@@ -299,14 +299,10 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
|||||||
usedReleaseNotesFormat = preferredReleaseNotesFormat;
|
usedReleaseNotesFormat = preferredReleaseNotesFormat;
|
||||||
break;
|
break;
|
||||||
case SUReleaseNotesFormatHTML:
|
case SUReleaseNotesFormatHTML:
|
||||||
if (@available(macOS 10.15, *)) {
|
if ([[NSProcessInfo processInfo] isMacCatalystApp]) {
|
||||||
if ([[NSProcessInfo processInfo] isMacCatalystApp]) {
|
usedReleaseNotesFormat = SUReleaseNotesFormatPlainText;
|
||||||
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);
|
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;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
usedReleaseNotesFormat = preferredReleaseNotesFormat;
|
usedReleaseNotesFormat = preferredReleaseNotesFormat;
|
||||||
}
|
}
|
||||||
@@ -377,12 +373,10 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
|||||||
_releaseNotesView.view.frame = _releaseNotesContentView.bounds;
|
_releaseNotesView.view.frame = _releaseNotesContentView.bounds;
|
||||||
_releaseNotesView.view.autoresizingMask = (NSAutoresizingMaskOptions)(NSViewWidthSizable | NSViewHeightSizable);
|
_releaseNotesView.view.autoresizingMask = (NSAutoresizingMaskOptions)(NSViewWidthSizable | NSViewHeightSizable);
|
||||||
|
|
||||||
if (@available(macOS 10.14, *)) {
|
// We need a transparent background
|
||||||
// We need a transparent background
|
// This avoids a "white flash" that may be present when the webview initially loads in dark mode
|
||||||
// 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)
|
||||||
// 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];
|
||||||
[_releaseNotesView setDrawsBackground:NO];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
|
- (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.boxType = NSBoxCustom;
|
||||||
_releaseNotesBoxView.cornerRadius = boxCornerRadius;
|
_releaseNotesBoxView.cornerRadius = boxCornerRadius;
|
||||||
if (@available(macOS 10.14, *)) {
|
_releaseNotesBoxView.borderColor = NSColor.separatorColor;
|
||||||
_releaseNotesBoxView.borderColor = NSColor.separatorColor;
|
|
||||||
} else {
|
|
||||||
_releaseNotesBoxView.borderColor = [NSColor colorWithCalibratedWhite:0.84 alpha:1.0];
|
|
||||||
}
|
|
||||||
_releaseNotesBoxView.borderWidth = boxBorderWidth;
|
_releaseNotesBoxView.borderWidth = boxBorderWidth;
|
||||||
_releaseNotesBoxView.fillColor = NSColor.textBackgroundColor;
|
_releaseNotesBoxView.fillColor = NSColor.textBackgroundColor;
|
||||||
|
|
||||||
@@ -436,7 +426,7 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
|||||||
_installButton.title = SULocalizedStringFromTableInBundle(@"Install Update", SPARKLE_TABLE, sparkleBundle, @"");
|
_installButton.title = SULocalizedStringFromTableInBundle(@"Install Update", SPARKLE_TABLE, sparkleBundle, @"");
|
||||||
_automaticallyInstallUpdatesButton.title = SULocalizedStringFromTableInBundle(@"Automatically download and install updates in the future", 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;
|
_skipButton.controlSize = NSControlSizeLarge;
|
||||||
_laterButton.controlSize = NSControlSizeLarge;
|
_laterButton.controlSize = NSControlSizeLarge;
|
||||||
_installButton.controlSize = NSControlSizeLarge;
|
_installButton.controlSize = NSControlSizeLarge;
|
||||||
|
|||||||
Vendored
+1
-3
@@ -104,9 +104,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (underlyingErrors.count > 1) {
|
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]];
|
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:[userInfo copy]];
|
||||||
|
|||||||
+10
-16
@@ -62,24 +62,18 @@ enum DecodeSecretStringError : LocalizedError {
|
|||||||
|
|
||||||
// Reads secret base64 string from a file
|
// Reads secret base64 string from a file
|
||||||
func decodeSecretString(filePath: String) throws -> String {
|
func decodeSecretString(filePath: String) throws -> String {
|
||||||
let privateKeyString: String
|
// Use FileHandle because it supports process substitution:
|
||||||
if #available(macOS 10.15.4, *) {
|
// https://github.com/sparkle-project/Sparkle/issues/2605
|
||||||
// Prefer to use FileHandle which supports process substitution:
|
let fileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: filePath))
|
||||||
// https://github.com/sparkle-project/Sparkle/issues/2605
|
|
||||||
let fileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: filePath))
|
|
||||||
|
|
||||||
guard let data = try fileHandle.readToEnd() else {
|
guard let data = try fileHandle.readToEnd() else {
|
||||||
throw DecodeSecretStringError.unableToReadData
|
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))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
guard let decodedPrivateKeyString = String(data: data, encoding: .utf8) else {
|
||||||
|
throw DecodeSecretStringError.unableToDecodeDataAsUTF8String
|
||||||
|
}
|
||||||
|
|
||||||
|
let privateKeyString = decodedPrivateKeyString
|
||||||
return privateKeyString.trimmingCharacters(in: .whitespacesAndNewlines)
|
return privateKeyString.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,6 @@ class ArchiveItem: CustomStringConvertible {
|
|||||||
var releaseNotesURLPrefix: URL?
|
var releaseNotesURLPrefix: URL?
|
||||||
var signingError: Error?
|
var signingError: Error?
|
||||||
|
|
||||||
@available(macOS 10.15.4, *)
|
|
||||||
private static func binaryContainsPreARMSlice(_ fileURL: URL) -> Bool? {
|
private static func binaryContainsPreARMSlice(_ fileURL: URL) -> Bool? {
|
||||||
guard let fileHandle = try? FileHandle(forReadingFrom: fileURL) else {
|
guard let fileHandle = try? FileHandle(forReadingFrom: fileURL) else {
|
||||||
return nil
|
return nil
|
||||||
@@ -180,7 +179,7 @@ class ArchiveItem: CustomStringConvertible {
|
|||||||
self._shortVersion = shortVersion
|
self._shortVersion = shortVersion
|
||||||
self.feedURL = feedURL
|
self.feedURL = feedURL
|
||||||
self.requiresSignedAppcast = requiresSignedAppcast
|
self.requiresSignedAppcast = requiresSignedAppcast
|
||||||
self.minimumSystemVersion = minimumSystemVersion ?? "10.13"
|
self.minimumSystemVersion = minimumSystemVersion ?? "12.0"
|
||||||
self.hardwareRequirements = hardwareRequirements
|
self.hardwareRequirements = hardwareRequirements
|
||||||
self.frameworkVersion = frameworkVersion
|
self.frameworkVersion = frameworkVersion
|
||||||
self.sparkleExecutableFileSize = sparkleExecutableFileSize
|
self.sparkleExecutableFileSize = sparkleExecutableFileSize
|
||||||
@@ -199,21 +198,12 @@ class ArchiveItem: CustomStringConvertible {
|
|||||||
}
|
}
|
||||||
|
|
||||||
convenience init(fromArchive archivePath: URL, unarchivedDir: URL, validateBundle: Bool, disableNestedCodeCheck: Bool) throws {
|
convenience init(fromArchive archivePath: URL, unarchivedDir: URL, validateBundle: Bool, disableNestedCodeCheck: Bool) throws {
|
||||||
let resourceKeys: [URLResourceKey]
|
let resourceKeys: [URLResourceKey] = [.contentTypeKey]
|
||||||
if #available(macOS 11, *) {
|
|
||||||
resourceKeys = [.contentTypeKey]
|
|
||||||
} else {
|
|
||||||
resourceKeys = [.typeIdentifierKey]
|
|
||||||
}
|
|
||||||
let items = try FileManager.default.contentsOfDirectory(at: unarchivedDir, includingPropertiesForKeys: resourceKeys, options: .skipsHiddenFiles)
|
let items = try FileManager.default.contentsOfDirectory(at: unarchivedDir, includingPropertiesForKeys: resourceKeys, options: .skipsHiddenFiles)
|
||||||
|
|
||||||
let bundles = items.filter({
|
let bundles = items.filter({
|
||||||
if let resourceValues = try? $0.resourceValues(forKeys: Set(resourceKeys)) {
|
if let resourceValues = try? $0.resourceValues(forKeys: Set(resourceKeys)) {
|
||||||
if #available(macOS 11, *) {
|
return resourceValues.contentType!.conforms(to: .bundle)
|
||||||
return resourceValues.contentType!.conforms(to: .bundle)
|
|
||||||
} else {
|
|
||||||
return UTTypeConformsTo(resourceValues.typeIdentifier! as CFString, kUTTypeBundle)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -273,12 +263,10 @@ class ArchiveItem: CustomStringConvertible {
|
|||||||
|
|
||||||
var hardwareRequirements: String? = nil
|
var hardwareRequirements: String? = nil
|
||||||
if mayNeedHardwareRequirement {
|
if mayNeedHardwareRequirement {
|
||||||
if #available(macOS 10.15.4, *) {
|
if let executableName = infoPlist[kCFBundleExecutableKey as String] as? String {
|
||||||
if let executableName = infoPlist[kCFBundleExecutableKey as String] as? String {
|
let executablePath = appPath.appendingPathComponent("Contents/MacOS/\(executableName)")
|
||||||
let executablePath = appPath.appendingPathComponent("Contents/MacOS/\(executableName)")
|
if let containsPreARMSlice = Self.binaryContainsPreARMSlice(executablePath), !containsPreARMSlice {
|
||||||
if let containsPreARMSlice = Self.binaryContainsPreARMSlice(executablePath), !containsPreARMSlice {
|
hardwareRequirements = SUAppcastElementHardwareRequirementARM64
|
||||||
hardwareRequirements = SUAppcastElementHardwareRequirementARM64
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user