Compare commits

..
33 Commits
Author SHA1 Message Date
Zorg 0066846648 Don't clean up update directory when Autoupdate receives SIGTERM
Under rare circumstances, if Autoupdate receives SIGTERM while the installer queue is installing an update this could cause potential corruption.

This is a port of #2479 to 2.2.x branch.
2024-05-12 17:17:43 -07:00
Zorg 47fb37e55d Merge branch 'extraction-update-2.2.x' into 2.2.x 2024-05-12 17:15:59 -07:00
Zorg c0bb61cc8f Revert unarchiver code to how it used to work in generate_appcast 2024-05-12 17:15:28 -07:00
Zorg 80c8c1ff3d Extract archives in a separate directory from the input archive (2.2.x) (#2553) 2024-05-05 21:49:56 -07:00
Zorg 464e269922 Change CI branch to 2.2.x 2024-05-02 23:15:29 +02:00
Zorg bb1e4d0907 Extract archives in a separate directory from the input archive
This is ported from top of 2.x.
2024-05-02 16:13:23 +02:00
Sparkle-Bot 8e27997de0 Update Package management files for version 2.2.2 2022-08-29 05:46:13 +00:00
Zorg ff6418d3cd Update CHANGELOG for 2.2.2 2022-08-28 22:36:14 -07:00
Sparkle-Bot c263b969c0 Update Package management files for version 2.2.2 2022-08-29 05:12:58 +00:00
Zorg 3c0ebbf570 Update 2.2.2-dev branch name 2022-08-28 22:03:41 -07:00
Zorg 743e15cce8 Add 2.2.2 to test on CI 2022-08-28 16:00:35 -07:00
Chiahong 77bf6ad890 Update zh_TW localization (#2246) 2022-08-28 15:35:01 -07:00
Kent Sutherland f6b7693b75 Update Portuguese localization (#2224) 2022-08-28 15:30:02 -07:00
Zorg f410960ac0 Wait for a threshold amount of time before replying with status info data (#2230)
Without this, critical update alerts may not show up as promptly as they should when automatically installing them.

This fixes a potential race issue where sometimes the automatic update driver on completion would sometimes not trigger to prompt an update alert immediately for critical updates. Note in this case, the update would still be installed on app termination and would still be scheduled to alert the user on the regular update check interval, so this issue is not severe.
2022-08-28 15:26:48 -07:00
Zorg 0b0a751d82 Remove module imports from framework headers (#2217)
Framework headers should not be using them. The warning these aim to suppress (-Wauto-import) is also going away.
2022-08-28 15:23:48 -07:00
Sparkle-Bot 059ce91287 Update Package management files for version 2.2.1 2022-07-16 13:34:05 +00:00
Zorg cc0007de3a Update CHANGELOG 2022-07-16 06:25:46 -07:00
VinBoiSoft fe69cab530 Update Italian localization (#2192) 2022-07-09 12:43:10 -07:00
Zorg 14e511f901 Fix memory leaks when using generate_appcast (#2193)
We fix one memory leak when calculating sha's, one memory leak in the xar delta applying path, and avoid creating Bundles for reading the Sparkle framework version.

There are some other small leaks with the xar delta creation/applying code but since it's a legacy implementation and the APIs are undocumented I don't want to touch it too much.

The biggest culprit here is the leak when calculating sha's I believe, if you have many archive items.
2022-07-09 12:22:36 -07:00
Pavel Moiseenko 80e60279ee Make dark scroll bar in dark theme (#2187) 2022-07-04 09:40:44 -07:00
Sparkle-Bot c1bf68f91f Update Package management files for version 2.2.0 2022-07-02 18:55:40 +00:00
Zorg 4622061d8f Add deprecation of -s flag in CHANGELOG 2022-07-02 09:45:00 -07:00
Zorg a7e5320d6a Update CHANGELOG 2022-07-01 21:58:58 -07:00
basilTandaONe 90221e7a0f Update Greek localizations (#2185)
Co-authored-by: aONe
2022-07-01 21:47:16 -07:00
aONe 7c1cc5627b Updated Greek translation (#2184)
Fixes #2175, from @seitsme
2022-07-01 19:08:13 -07:00
Zorg bececc3738 Reset opportune time for showing new updates after preference changes (#2183)
Reset opportune time for showing update notice when updater starts as well.

Also update updater header API documentation and add private protocol for gentle scheduled reminder APIs that the updater uses.
2022-07-01 19:06:27 -07:00
1024jp a6984d3c02 Update Japanese localization (#2182)
* Add unlocalized strings to Japanese localization

* Remove unwanted spaces in Japanese localization
2022-06-30 21:54:01 -07:00
Zorg 102c4a4009 Fix Greek translation in "You are currently running version" string (#2181) 2022-06-28 22:26:20 -07:00
Zorg d2fd9a50e0 Use recovery suggestion key for update permission error (#2180) 2022-06-26 18:41:55 -07:00
Zorg d544d456e0 Synchronize usage of XPC connections to main queue (#2178) 2022-06-25 21:29:44 -07:00
Zorg b1f6c161d1 Use snprintf instead of sprintf to fix compile warning (#2179) 2022-06-25 16:41:32 -07:00
Zorg 06daa03196 Fix installer status xpc service bundle ID (#2177)
The bundle ID name broke after I was renaming the XPC Services for 2.2.
2022-06-25 15:00:33 -07:00
Zorg e64b7649f2 Deprecate -s flag and add --ed-key-file option to generate_appcast (#2170) 2022-06-24 21:19:10 -07:00
75 changed files with 633 additions and 399 deletions

No files matched your search

+2 -2
View File
@@ -2,9 +2,9 @@ name: Build & Tests
on:
push:
branches: [ 2.x, master ]
branches: [ 2.x, 2.2.x, master ]
pull_request:
branches: [ 2.x, master ]
branches: [ 2.x, 2.2.x, master ]
jobs:
build:
+3 -1
View File
@@ -78,7 +78,9 @@
__weak AgentConnection *weakSelf = self;
newConnection.interruptionHandler = ^{
[weakSelf.activeConnection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.activeConnection invalidate];
});
};
newConnection.invalidationHandler = ^{
+17 -4
View File
@@ -59,6 +59,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
@property (nonatomic, readonly) NSString *userName;
@property (nonatomic) SUHost *host;
@property (nonatomic, copy) NSString *updateDirectoryPath;
@property (nonatomic, copy) NSString *extractionDirectory;
@property (nonatomic, copy) NSString *downloadName;
@property (nonatomic, copy) NSString *decryptionPassword;
@property (nonatomic, strong) SUSignatures *signatures;
@@ -94,6 +95,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
@synthesize updateValidator = _updateValidator;
@synthesize host = _host;
@synthesize updateDirectoryPath = _updateDirectoryPath;
@synthesize extractionDirectory = _extractionDirectory;
@synthesize downloadName = _downloadName;
@synthesize decryptionPassword = _decryptionPassword;
@synthesize signatures = _signatures;
@@ -147,7 +149,9 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
__weak AppInstaller *weakSelf = self;
newConnection.interruptionHandler = ^{
[weakSelf.activeConnection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.activeConnection invalidate];
});
};
newConnection.invalidationHandler = ^{
@@ -191,7 +195,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
[self.communicator handleMessageWithIdentifier:SPUExtractionStarted data:[NSData data]];
NSString *archivePath = [self.updateDirectoryPath stringByAppendingPathComponent:self.downloadName];
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath updatingHostBundlePath:self.host.bundlePath decryptionPassword:self.decryptionPassword expectingInstallationType:self.installationType];
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath extractionDirectory:self.extractionDirectory updatingHostBundlePath:self.host.bundlePath decryptionPassword:self.decryptionPassword expectingInstallationType:self.installationType];
NSError *unarchiverError = nil;
BOOL success = NO;
@@ -224,7 +228,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
[self.communicator handleMessageWithIdentifier:SPUValidationStarted data:[NSData data]];
NSError *validationError = nil;
BOOL validationSuccess = [self.updateValidator validateWithUpdateDirectory:self.updateDirectoryPath error:&validationError];
BOOL validationSuccess = [self.updateValidator validateWithUpdateDirectory:self.extractionDirectory error:&validationError];
if (!validationSuccess) {
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Update validation was a failure", NSUnderlyingErrorKey: validationError }]];
@@ -274,6 +278,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
// but may as well set other fields to nil too
[self clearUpdateDirectory];
self.downloadName = nil;
self.extractionDirectory = nil;
self.decryptionPassword = nil;
self.signatures = nil;
self.relaunchPath = nil;
@@ -405,6 +410,13 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
return;
}
NSString *extractionDirectory = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:cacheInstallationPath];
if (extractionDirectory == nil) {
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Failed to create installation extraction directory in %@", cacheInstallationPath] }]];
return;
}
// Carry these properities separately rather than using the SUInstallationInputData object
// Some of our properties may slightly differ than our input and we don't want to make the mistake of using one of those
self.installationType = installationType;
@@ -412,6 +424,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
self.downloadName = installationData.downloadName;
self.signatures = installationData.signatures;
self.updateDirectoryPath = cacheInstallationPath;
self.extractionDirectory = extractionDirectory;
self.host = [[SUHost alloc] initWithBundle:hostBundle];
[self extractAndInstallUpdate];
@@ -461,7 +474,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
dispatch_async(self.installerQueue, ^{
NSError *installerError = nil;
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self.host expectedInstallationType:self.installationType updateDirectory:self.updateDirectoryPath homeDirectory:self.homeDirectory userName:self.userName error:&installerError];
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self.host expectedInstallationType:self.installationType updateDirectory:self.extractionDirectory homeDirectory:self.homeDirectory userName:self.userName error:&installerError];
if (installer == nil) {
dispatch_async(dispatch_get_main_queue(), ^{
+5 -1
View File
@@ -348,7 +348,11 @@ static xar_file_t _xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTa
continue;
}
NSString *relativePath = @(pathCString);
NSString *relativePath = [[NSString alloc] initWithBytesNoCopy:pathCString length:strlen(pathCString) encoding:NSUTF8StringEncoding freeWhenDone:YES];
if (relativePath == nil) {
free(pathCString);
continue;
}
SPUDeltaItemCommands commands = 0;
{
+1 -1
View File
@@ -329,7 +329,7 @@ NSString *displayHashFromRawHash(const unsigned char *hash)
{
char hexHash[CC_SHA1_DIGEST_LENGTH * 2 + 1] = {0};
for (size_t i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) {
sprintf(hexHash + i * 2, "%02x", hash[i]);
snprintf(hexHash + i * 2, 3, "%02x", hash[i]);
}
return @(hexHash);
}
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath;
@end
+5 -2
View File
@@ -20,6 +20,7 @@
@property (nonatomic, copy, readonly) NSString *archivePath;
@property (nonatomic, copy, readonly) NSString *updateHostBundlePath;
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
@end
@@ -27,6 +28,7 @@
@synthesize archivePath = _archivePath;
@synthesize updateHostBundlePath = _updateHostBundlePath;
@synthesize extractionDirectory = _extractionDirectory;
+ (BOOL)canUnarchivePath:(NSString *)path
{
@@ -73,12 +75,13 @@
}
}
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_updateHostBundlePath = [updateHostBundlePath copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -96,7 +99,7 @@
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
{
NSString *sourcePath = self.updateHostBundlePath;
NSString *targetPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
NSString *targetPath = [self.extractionDirectory stringByAppendingPathComponent:[sourcePath lastPathComponent]];
NSError *applyDiffError = nil;
BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, ^(double progress){
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUDiskImageUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword;
@end
+5 -2
View File
@@ -17,6 +17,7 @@
@property (nonatomic, copy, readonly) NSString *archivePath;
@property (nullable, nonatomic, copy, readonly) NSString *decryptionPassword;
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
@end
@@ -24,6 +25,7 @@
@synthesize archivePath = _archivePath;
@synthesize decryptionPassword = _decryptionPassword;
@synthesize extractionDirectory = _extractionDirectory;
+ (BOOL)canUnarchivePath:(NSString *)path
{
@@ -35,12 +37,13 @@
return NO;
}
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_decryptionPassword = [decryptionPassword copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -189,7 +192,7 @@
for (NSString *item in contents)
{
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
NSString *toPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
NSString *toPath = [self.extractionDirectory stringByAppendingPathComponent:item];
itemsCopied += 1.0;
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
+1 -1
View File
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
// An unarchiver for flat packages that doesn't really do any unarchiving
@interface SUFlatPackageUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType;
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType;
@end
+18 -3
View File
@@ -18,6 +18,7 @@
@property (nonatomic, readonly) NSString *flatPackagePath;
@property (nonatomic, readonly) NSString *expectedInstallationType;
@property (nonatomic, readonly) NSString *extractionDirectory;
@end
@@ -25,6 +26,7 @@
@synthesize flatPackagePath = _flatPackagePath;
@synthesize expectedInstallationType = _expectedInstallationType;
@synthesize extractionDirectory = _extractionDirectory;
+ (BOOL)canUnarchivePath:(NSString *)path
{
@@ -36,12 +38,13 @@
return YES;
}
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType
{
self = [super init];
if (self != nil) {
_flatPackagePath = [flatPackagePath copy];
_expectedInstallationType = [installationType copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -57,8 +60,20 @@
} else if (![[NSFileManager defaultManager] fileExistsAtPath:self.flatPackagePath isDirectory:&isDirectory] || isDirectory) {
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package does not exist at %@", self.flatPackagePath]}]];
} else {
[notifier notifyProgress:1.0];
[notifier notifySuccess];
// Copying the flat package should be very fast, especially on APFS
NSError *copyError = nil;
if (![[NSFileManager defaultManager] copyItemAtPath:self.flatPackagePath toPath:[self.extractionDirectory stringByAppendingPathComponent:self.flatPackagePath.lastPathComponent] error:&copyError]) {
NSMutableDictionary *userInfoDictionary = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package (%@) cannot be copied to extraction directory (%@)", self.flatPackagePath, self.extractionDirectory]}];
if (copyError != nil) {
userInfoDictionary[NSUnderlyingErrorKey] = copyError;
}
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:userInfoDictionary]];
} else {
[notifier notifyProgress:1.0];
[notifier notifySuccess];
}
}
}
+28 -13
View File
@@ -22,15 +22,6 @@
@implementation SUInstaller
+ (BOOL)isAliasFolderAtPath:(NSString *)path
{
NSNumber *aliasFlag = nil;
[[NSURL fileURLWithPath:path] getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:nil];
NSNumber *directoryFlag = nil;
[[NSURL fileURLWithPath:path] getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:nil];
return aliasFlag.boolValue && directoryFlag.boolValue;
}
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr
{
NSParameterAssert(inUpdateFolder);
@@ -49,6 +40,34 @@
while ((currentFile = [dirEnum nextObject])) {
NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
// Ignore all symbolic links and aliases
{
NSURL *currentPathURL = [NSURL fileURLWithPath:currentPath];
NSNumber *symbolicLinkFlag = nil;
[currentPathURL getResourceValue:&symbolicLinkFlag forKey:NSURLIsSymbolicLinkKey error:NULL];
if (symbolicLinkFlag.boolValue) {
// NSDirectoryEnumerator won't recurse into symlinked directories
continue;
}
NSNumber *aliasFlag = nil;
[currentPathURL getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:NULL];
if (aliasFlag.boolValue) {
NSNumber *directoryFlag = nil;
[currentPathURL getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:NULL];
// Some DMGs have symlinks into /Applications! That's no good!
if (directoryFlag.boolValue) {
[dirEnum skipDescendents];
}
continue;
}
}
NSString *currentFilename = [currentFile lastPathComponent];
NSString *currentExtension = [currentFile pathExtension];
NSString *currentFilenameNoExtension = [currentFilename stringByDeletingPathExtension];
@@ -78,10 +97,6 @@
break;
}
}
// Some DMGs have symlinks into /Applications! That's no good!
if ([self isAliasFolderAtPath:currentPath])
[dirEnum skipDescendents];
}
// We don't have a valid path. Try to use the fallback package.
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUPipedUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory;
@end
+5 -2
View File
@@ -17,12 +17,14 @@
@interface SUPipedUnarchiver ()
@property (nonatomic, copy, readonly) NSString *archivePath;
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
@end
@implementation SUPipedUnarchiver
@synthesize archivePath = _archivePath;
@synthesize extractionDirectory = _extractionDirectory;
+ (nullable NSArray <NSString *> *)commandAndArgumentsConformingToTypeOfPath:(NSString *)path
{
@@ -63,11 +65,12 @@
return NO;
}
- (instancetype)initWithArchivePath:(NSString *)archivePath
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -93,7 +96,7 @@
{
// *** GETS CALLED ON NON-MAIN THREAD!!!
@autoreleasepool {
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
NSString *destination = self.extractionDirectory;
SULog(SULogLevelDefault, @"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], self.archivePath, destination);
+1 -1
View File
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUUnarchiver : NSObject
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
@end
+5 -5
View File
@@ -18,21 +18,21 @@
@implementation SUUnarchiver
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
{
if ([SUPipedUnarchiver canUnarchivePath:path]) {
return [[SUPipedUnarchiver alloc] initWithArchivePath:path];
return [[SUPipedUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory];
} else if ([SUDiskImageUnarchiver canUnarchivePath:path]) {
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path decryptionPassword:decryptionPassword];
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory decryptionPassword:decryptionPassword];
} else if ([SUBinaryDeltaUnarchiver canUnarchivePath:path]) {
assert(hostPath != nil);
NSString *nonNullHostPath = hostPath;
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory updateHostBundlePath:nonNullHostPath];
} else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
// Flat packages are only supported for guided packaage installs
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path expectingInstallationType:installationType];
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path extractionDirectory:extractionDirectory expectingInstallationType:installationType];
}
return nil;
}
+43 -8
View File
@@ -12,15 +12,18 @@
#include "AppKitPrevention.h"
#define REPLY_STATUS_INFO_TIMEOUT 2
@interface StatusInfo () <NSXPCListenerDelegate>
@property (nonatomic) NSXPCListener *xpcListener;
@end
@implementation StatusInfo
{
NSXPCListener *_xpcListener;
NSMutableDictionary *_pendingReplies;
NSUInteger _pendingReplyCounter;
}
@synthesize xpcListener = _xpcListener;
@synthesize installationInfoData = _installationInfoData;
- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier
@@ -29,19 +32,20 @@
if (self != nil) {
_xpcListener = [[NSXPCListener alloc] initWithMachServiceName:SPUStatusInfoServiceNameForBundleIdentifier(bundleIdentifier)];
_xpcListener.delegate = self;
_pendingReplies = [NSMutableDictionary dictionary];
}
return self;
}
- (void)startListener
{
[self.xpcListener resume];
[_xpcListener resume];
}
- (void)invalidate
{
[self.xpcListener invalidate];
self.xpcListener = nil;
[_xpcListener invalidate];
_xpcListener = nil;
}
- (BOOL)listener:(NSXPCListener *)__unused listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection
@@ -54,10 +58,41 @@
return YES;
}
- (void)setInstallationInfoData:(NSData *)installationInfoData
{
_installationInfoData = installationInfoData;
// Respond to all of our pending replies
for (NSNumber *replyKey in _pendingReplies) {
void (^replyBlock)(NSData * _Nullable) = self->_pendingReplies[replyKey];
replyBlock(_installationInfoData);
}
[_pendingReplies removeAllObjects];
}
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable))reply
{
dispatch_async(dispatch_get_main_queue(), ^{
reply(self.installationInfoData);
if (self->_installationInfoData != nil) {
reply(self->_installationInfoData);
} else {
// If we don't have the installation info data currently, we may receive it in a very short window afterwards
// In this case wait a bit for the reply. If we receive the data it will be in -setInstallationInfoData:
NSUInteger currentReplyCounter = self->_pendingReplyCounter;
self->_pendingReplyCounter++;
NSNumber *currentReplyCounterKey = @(currentReplyCounter);
self->_pendingReplies[currentReplyCounterKey] = [reply copy];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(REPLY_STATUS_INFO_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
void (^replyBlock)(NSData * _Nullable) = self->_pendingReplies[currentReplyCounterKey];
if (replyBlock != nil) {
replyBlock(self->_installationInfoData);
[self->_pendingReplies removeObjectForKey:currentReplyCounterKey];
}
});
}
});
}
+5 -1
View File
@@ -28,7 +28,11 @@ int main(int __unused argc, const char __unused *argv[])
dispatch_source_t sigtermSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue());
dispatch_source_set_event_handler(sigtermSource, ^{
[appInstaller cleanupAndExitWithStatus:SIGTERM error:nil];
// Don't clear the update directory because the installer may be in middle of installing an update
// We still need to set an event handler for receiving SIGTERM though, otherwise our job may not terminate
// (This is also recommended from the developer documentation).
// Simply exit with SIGTERM if we recieve this signal
exit(SIGTERM);
});
dispatch_resume(sigtermSource);
+20 -1
View File
@@ -1,3 +1,16 @@
# 2.2.2
* Critical update alerts may not show up as promptly as they should when they are being automatically installed (#2230) (Zorg)
* Remove module imports from framework headers (#2217) (Zorg)
* Update Portuguese localization (#2224) (Kent Sutherland)
* Update zh_TW localization (#2246) (Chiahong)
# 2.2.1
* Make scroll bar dark in dark theme for Release Notes by default (#2187) (Pavel Moiseenko)
* Fix memory leaks when using generate_appcast (#2193) (Zorg)
* Update Italian localization (#2192) (VinBoiSoft)
# 2.2.0
* Update Focus Improvements (#924)
@@ -13,6 +26,7 @@
* Rename XPC Service filenames for Sandboxing to show more friendly human-readable name in authorization dialog (Zorg) (#2096)
* Add support for running the framework and sparkle-cli as root (Zorg) (#2119)
* Fix issue where update cycle may not complete in unusual configuration if automatic checks are disabled + automatic downloading is enabled + install requires user interaction (Zorg) (#2133)
* Synchronize usage of XPC connections to main queue to fix potential race conditions (Zorg) (#2178)
* Update last update check time when choosing to install an update & relaunch (Zorg) (#2136)
* Improve error reporting in the framework and sparkle-cli when installation fails with no write permission (Zorg) (#2157)
* Use displayVersionString instead of versionString for OS version mismatch error message (samschott) (#2138)
@@ -23,15 +37,20 @@
* Bump initial installer message timeouts and declare daemon/agents processes as Interactive (Zorg) (#2162)
* Add and improve translation strings and update pt-BR (BR Lingo) (#2094)
* Update localisations (Eitot) (#2113)
* Update Greek localizations (seitsme) (#2184, #2185)
* Update Japanese localization (1024jp) (#2182)
* Replace deprecated code with newer APIs (Eitot) (#2112)
* Remove obsolete fallbacks for older OS versions (Eitot) (#2110)
* Remove SPUURLRequest (Zorg) (#2124)
* Silence ivar deprecation warnings (Zorg) (#2099)
* Fix Xcode 14 project warnings (Zorg) (#2147)
* Fix Xcode 14 project warnings (Zorg) (#2147, #2179)
* Deprecate -s flag and add --ed-key-file option to generate_appcast (Zorg) (#2170)
* Update text for external licenses (Zorg) (#2164)
This update renames the bundled XPC Services, brings improvements to notifying users of new updates without disrupting their focus, and adds [gentle update reminder APIs](https://sparkle-project.org/documentation/gentle-reminders/) to further customize how Sparkle's standard user interface delivers new update alerts.
The `-s` flag for passing a raw private EdDSA key to sign_update and generate_appcast is now deprecated. If you were using this option previously, please see the help pages of these tools for more information.
# 2.1.0
* New Binary Delta format (version 3)
+1 -1
View File
@@ -1 +1 @@
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz"}
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz"}
+3 -3
View File
@@ -43,12 +43,12 @@ SPARKLE_ICON_NAME = AppIcon
// These variables must have a space after the '=' too
SPARKLE_VERSION_MAJOR = 2
SPARKLE_VERSION_MINOR = 2
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION_PATCH = 2
// This should be in SemVer format or empty, ie. "-beta.1"
// These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX = -beta.2
CURRENT_PROJECT_VERSION = 2015
SPARKLE_VERSION_SUFFIX =
CURRENT_PROJECT_VERSION = 2017.1
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
ALWAYS_SEARCH_USER_PATHS = NO
@@ -2,5 +2,5 @@
INFOPLIST_FILE = InstallerStatus/Info.plist
WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_STATUS_NAME}
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_STATUS_BUNDLE_ID}
PRODUCT_NAME = ${INSTALLER_STATUS_NAME}
+3 -1
View File
@@ -15,7 +15,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUInstallerConnection : NSObject <SUInstallerConnectionProtocol>
// Due to XPC reasons, this delegate is strongly referenced, until it's invalidated
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate;
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate remote:(BOOL)remote;
- (instancetype)init NS_UNAVAILABLE;
@end
+67 -24
View File
@@ -25,21 +25,27 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
@end
@implementation SUInstallerConnection
{
BOOL _remote;
}
@synthesize delegate = _delegate;
@synthesize disabledAutomaticTermination = _disabledAutomaticTermination;
@synthesize invalidationBlock = _invalidationBlock;
@synthesize connection = _connection;
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate remote:(BOOL)remote
{
self = [super init];
if (self != nil) {
_delegate = delegate;
_remote = remote;
// If we are a XPC service, protect it from being terminated until the invalidation handler is set
_disabledAutomaticTermination = YES;
[[NSProcessInfo processInfo] disableAutomaticTermination:SUInstallerConnectionKeepAliveReason];
if (remote) {
// If we are a XPC service, protect it from being terminated until the invalidation handler is set
_disabledAutomaticTermination = YES;
[[NSProcessInfo processInfo] disableAutomaticTermination:SUInstallerConnectionKeepAliveReason];
}
}
return self;
}
@@ -52,7 +58,7 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
}
}
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
- (void)_setInvalidationHandler:(void (^)(void))invalidationHandler
{
self.invalidationBlock = invalidationHandler;
@@ -60,7 +66,18 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
[self enableAutomaticTermination];
}
- (void)setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[self _setInvalidationHandler:invalidationHandler];
});
} else {
[self _setInvalidationHandler:invalidationHandler];
}
}
- (void)_setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
{
NSXPCConnectionOptions options = systemDomain ? NSXPCConnectionPrivileged : 0;
NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:options];
@@ -74,41 +91,67 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
__weak SUInstallerConnection *weakSelf = self;
self.connection.interruptionHandler = ^{
[weakSelf.connection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.connection invalidate];
});
};
self.connection.invalidationHandler = ^{
SUInstallerConnection *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf invalidate];
}
dispatch_async(dispatch_get_main_queue(), ^{
SUInstallerConnection *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf _invalidate];
}
});
};
[self.connection resume];
}
- (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data
- (void)setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
{
[(id<SUInstallerCommunicationProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[self _setServiceName:serviceName systemDomain:systemDomain];
});
} else {
[self _setServiceName:serviceName systemDomain:systemDomain];
}
}
// This method can be called by us or from a remote
- (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[(id<SUInstallerCommunicationProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
});
} else {
[(id<SUInstallerCommunicationProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
}
}
- (void)_invalidate
{
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
// Break the retain cycle
self.delegate = nil;
[self enableAutomaticTermination];
}
// This method can be called from us or a remote
- (void)invalidate
{
dispatch_async(dispatch_get_main_queue(), ^{
[self.connection invalidate];
self.connection = nil;
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
// Break the retain cycle
self.delegate = nil;
[self enableAutomaticTermination];
[self _invalidate];
});
}
+1 -1
View File
@@ -26,7 +26,7 @@
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerConnectionProtocol)];
newConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerCommunicationProtocol)];
SUInstallerConnection *exportedObject = [[SUInstallerConnection alloc] initWithDelegate:newConnection.remoteObjectProxy];
SUInstallerConnection *exportedObject = [[SUInstallerConnection alloc] initWithDelegate:newConnection.remoteObjectProxy remote:YES];
newConnection.exportedObject = exportedObject;
+4
View File
@@ -12,4 +12,8 @@
// This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection.
@interface SUInstallerStatus : NSObject <SUInstallerStatusProtocol>
- (instancetype)initWithRemote:(BOOL)remote;
- (instancetype)init NS_UNAVAILABLE;
@end
+66 -16
View File
@@ -19,16 +19,34 @@
@end
@implementation SUInstallerStatus
{
BOOL _remote;
}
@synthesize invalidationBlock = _invalidationBlock;
@synthesize connection = _connection;
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
- (instancetype)initWithRemote:(BOOL)remote
{
self.invalidationBlock = invalidationHandler;
self = [super init];
if (self != nil) {
_remote = remote;
}
return self;
}
- (void)setServiceName:(NSString *)serviceName
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
self.invalidationBlock = invalidationHandler;
});
} else {
self.invalidationBlock = invalidationHandler;
}
}
- (void)_setServiceName:(NSString *)serviceName
{
NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:(NSXPCConnectionOptions)0];
@@ -38,41 +56,73 @@
__weak SUInstallerStatus *weakSelf = self;
self.connection.interruptionHandler = ^{
[weakSelf.connection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.connection invalidate];
});
};
self.connection.invalidationHandler = ^{
SUInstallerStatus *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf invalidate];
}
dispatch_async(dispatch_get_main_queue(), ^{
SUInstallerStatus *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf _invokeInvalidationBlock];
}
});
};
[self.connection resume];
}
- (void)setServiceName:(NSString *)serviceName
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[self _setServiceName:serviceName];
});
} else {
[self _setServiceName:serviceName];
}
}
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable installationInfoData))reply
{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
});
} else {
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
}
}
- (void)probeStatusConnectivityWithReply:(void (^)(void))reply
{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
});
} else {
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
}
}
// This method can be called by us or from a remote
- (void)_invokeInvalidationBlock
{
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
}
// This method can be called from us or a remote
- (void)invalidate
{
dispatch_async(dispatch_get_main_queue(), ^{
[self.connection invalidate];
self.connection = nil;
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
[self _invokeInvalidationBlock];
});
}
+1 -1
View File
@@ -25,7 +25,7 @@
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerStatusProtocol)];
// Next, set the object that the connection exports. All messages sent on the connection to this service will be sent to the exported object to handle. The connection retains the exported object.
SUInstallerStatus *exportedObject = [SUInstallerStatus new];
SUInstallerStatus *exportedObject = [[SUInstallerStatus alloc] initWithRemote:YES];
newConnection.exportedObject = exportedObject;
// Resuming the connection allows the system to deliver more incoming messages.
+3 -3
View File
@@ -2,10 +2,10 @@
import PackageDescription
// Version is technically not required here, SPM doesn't check
let version = "2.2.0-beta.2"
let version = "2.2.2"
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
let tag = "2.2.0-beta.2"
let checksum = "8020ba7dfcc764e6e25b93d1b1906aadbe2c0d8a0a7e8c0e3205da80d575da7a"
let tag = "2.2.2"
let checksum = "aafce90805ca50d099c32e744636b2524a7382629f8f7e14ff21c84634125a44"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package(
+1
View File
@@ -1,5 +1,6 @@
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
color: white;
background: transparent;
}
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "2.2.0-beta.2"
s.version = "2.2.2"
s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for macOS."
s.homepage = "https://sparkle-project.org"
+4
View File
@@ -171,6 +171,7 @@
7229E1BA1C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7229E1B81C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m */; };
7229E1BD1C98EFF200CB50D0 /* SPUDownloadDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1BB1C98EFF200CB50D0 /* SPUDownloadDriver.h */; };
7229E1BE1C98EFF200CB50D0 /* SPUDownloadDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7229E1BC1C98EFF200CB50D0 /* SPUDownloadDriver.m */; };
722C9539286EA68C0033908A /* SPUGentleUserDriverReminders.h in Headers */ = {isa = PBXBuildFile; fileRef = 722C9538286EA54A0033908A /* SPUGentleUserDriverReminders.h */; settings = {ATTRIBUTES = (Private, ); }; };
722FB7E5260EE53F00EB571C /* SUNormalization.m in Sources */ = {isa = PBXBuildFile; fileRef = 722FB7E4260EE53F00EB571C /* SUNormalization.m */; };
722FB7E6260EE53F00EB571C /* SUNormalization.m in Sources */ = {isa = PBXBuildFile; fileRef = 722FB7E4260EE53F00EB571C /* SUNormalization.m */; };
72316BD31E0DA8430039EFD9 /* SUUnarchiverNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 72316BD21E0DA8430039EFD9 /* SUUnarchiverNotifier.m */; };
@@ -1010,6 +1011,7 @@
7229E1B81C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUScheduledUpdateDriver.m; sourceTree = "<group>"; };
7229E1BB1C98EFF200CB50D0 /* SPUDownloadDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUDownloadDriver.h; sourceTree = "<group>"; };
7229E1BC1C98EFF200CB50D0 /* SPUDownloadDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUDownloadDriver.m; sourceTree = "<group>"; };
722C9538286EA54A0033908A /* SPUGentleUserDriverReminders.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUGentleUserDriverReminders.h; sourceTree = "<group>"; };
722FB7CA1DD69897001D40CE /* ConfigSwift.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwift.xcconfig; sourceTree = "<group>"; };
722FB7E3260EE53F00EB571C /* SUNormalization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUNormalization.h; sourceTree = "<group>"; };
722FB7E4260EE53F00EB571C /* SUNormalization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUNormalization.m; sourceTree = "<group>"; };
@@ -2159,6 +2161,7 @@
725CB9581C7121830064365A /* SPUStandardUserDriver.h */,
725CB9591C7121830064365A /* SPUStandardUserDriver.m */,
726E4A361C89116000C57C6A /* SPUStandardUserDriverDelegate.h */,
722C9538286EA54A0033908A /* SPUGentleUserDriverReminders.h */,
726DF88D1C84277500188804 /* SPUUserUpdateState.h */,
7269E49C2648FC6C0088C213 /* SPUUserUpdateState+Private.h */,
7269E4992648F7C00088C213 /* SPUUserUpdateState.m */,
@@ -2433,6 +2436,7 @@
7246E0A31C83B685003B4E75 /* SPUStandardUpdaterController.h in Headers */,
725CB95A1C7121830064365A /* SPUStandardUserDriver.h in Headers */,
726E4A371C89116000C57C6A /* SPUStandardUserDriverDelegate.h in Headers */,
722C9539286EA68C0033908A /* SPUGentleUserDriverReminders.h in Headers */,
729F7EAF273F1840004592DC /* SPUUserAgent+Private.h in Headers */,
72EE17FC26D1CC9D00C58B19 /* SPUInstallationType.h in Headers */,
72EF30BE2675CF38008CE987 /* SPUAppcastItemStateResolver.h in Headers */,
+3 -1
View File
@@ -126,7 +126,9 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
__weak InstallerProgressAppController *weakSelf = self;
_connection.interruptionHandler = ^{
[weakSelf.connection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.connection invalidate];
});
};
_connection.invalidationHandler = ^{
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#ifdef BUILDING_SPARKLE_DOWNLOADER_SERVICE
// Ignore incorrect warning
+22
View File
@@ -0,0 +1,22 @@
//
// SPUGentleUserDriverReminders.h
// Sparkle
//
// Copyright © 2022 Sparkle Project. All rights reserved.
//
#ifndef SPUGentleUserDriverReminders_h
#define SPUGentleUserDriverReminders_h
/**
A private protocol for user drivers implementing gentle scheduled reminders
*/
@protocol SPUGentleUserDriverReminders
- (void)logGentleScheduledUpdateReminderWarningIfNeeded;
- (void)resetTimeSinceOpportuneUpdateNotice;
@end
#endif /* SPUGentleUserDriverReminders_h */
+14 -20
View File
@@ -121,28 +121,22 @@
} else if (underlyingError.code == SUInstallationError) {
NSError *secondUnderlyingError = underlyingError.userInfo[NSUnderlyingErrorKey];
if (secondUnderlyingError != nil && [secondUnderlyingError.domain isEqualToString:NSCocoaErrorDomain] && secondUnderlyingError.code == NSFileWriteNoPermissionError) {
NSBundle *mainBundle = [NSBundle mainBundle];
// macOS 13 and later introduce a policy where Gatekeeper can block app modifications if the apps have different Team IDs
BOOL warnAboutGatekeeper;
if (@available(macOS 13, *)) {
warnAboutGatekeeper = ![mainBundle isEqual:self.host.bundle];
} else {
warnAboutGatekeeper = NO;
}
// Note: these error strings will only surface for external app updaters like sparkle-cli (i.e, updaters that update other app bundles)
NSString *errorDescription;
if (warnAboutGatekeeper) {
SUHost *mainBundleHost = [[SUHost alloc] initWithBundle:mainBundle];
errorDescription = [NSString stringWithFormat:SULocalizedString(@"The installation failed due to not having permission to write the new update. To install the update, you may need to allow modifications from %1$@ in System Settings under Privacy & Security and App Management", nil), mainBundleHost.name];
} else {
errorDescription = SULocalizedString(@"The installation failed due to not having permission to write the new update.", nil);
}
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: errorDescription,
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{
NSLocalizedDescriptionKey: SULocalizedString(@"The installation failed due to not having permission to write the new update.", nil),
NSUnderlyingErrorKey: (NSError * _Nonnull)currentInstallerError
};
}];
// macOS 13 and later introduce a policy where Gatekeeper can block app modifications if the apps have different Team IDs
if (@available(macOS 13, *)) {
NSBundle *mainBundle = [NSBundle mainBundle];
if (![mainBundle isEqual:self.host.bundle]) {
SUHost *mainBundleHost = [[SUHost alloc] initWithBundle:mainBundle];
userInfo[NSLocalizedRecoverySuggestionErrorKey] = [NSString stringWithFormat:SULocalizedString(@"You may need to allow modifications from %1$@ in System Settings under Privacy & Security and App Management to install future updates.", nil), mainBundleHost.name];
}
}
customError = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationWriteNoPermissionError userInfo:userInfo];
}
@@ -176,7 +170,7 @@
assert(hostBundleIdentifier != nil);
if (!SPUXPCServiceIsEnabled(SUEnableInstallerConnectionServiceKey)) {
self.installerConnection = [[SUInstallerConnection alloc] initWithDelegate:self];
self.installerConnection = [[SUInstallerConnection alloc] initWithDelegate:self remote:NO];
} else {
self.installerConnection = [[SUXPCInstallerConnection alloc] initWithDelegate:self];
}
+2 -2
View File
@@ -30,7 +30,7 @@
id<SUInstallerStatusProtocol> installerStatus = nil;
BOOL usesXPC = SPUXPCServiceIsEnabled(SUEnableInstallerStatusServiceKey);
if (!usesXPC) {
installerStatus = [[SUInstallerStatus alloc] init];
installerStatus = [[SUInstallerStatus alloc] initWithRemote:NO];
} else {
installerStatus = [[SUXPCInstallerStatus alloc] init];
}
@@ -93,7 +93,7 @@
id<SUInstallerStatusProtocol> installerStatus = nil;
BOOL usesXPC = SPUXPCServiceIsEnabled(SUEnableInstallerStatusServiceKey);
if (!usesXPC) {
installerStatus = [[SUInstallerStatus alloc] init];
installerStatus = [[SUInstallerStatus alloc] initWithRemote:NO];
} else {
installerStatus = [[SUXPCInstallerStatus alloc] init];
}
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SPUUserDriver.h>
#import <Sparkle/SUExport.h>
+10 -12
View File
@@ -10,6 +10,7 @@
#import "SPUStandardUserDriver.h"
#import "SPUStandardUserDriverDelegate.h"
#import "SPUGentleUserDriverReminders.h"
#import "SUAppcastItem.h"
#import "SUVersionDisplayProtocol.h"
#import "SUHost.h"
@@ -33,7 +34,7 @@
// The amount of time the app is allowed to be idle for us to consider showing an update prompt right away when the app is active
static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 30.0 : 5 * 60.0;
@interface SPUStandardUserDriver ()
@interface SPUStandardUserDriver () <SPUGentleUserDriverReminders>
@property (nonatomic, readonly) SUHost *host;
// We must store the oldHostName before the host is potentially replaced
@@ -59,7 +60,7 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
@implementation SPUStandardUserDriver
{
mach_timebase_info_data_t _timebaseInfo;
double _initializationTime;
double _timeSinceOpportuneUpdateNotice;
id<NSObject> _applicationBecameActiveAfterUpdateAlertBecameKeyObserver;
NSValue *_updateAlertWindowFrameValue;
BOOL _updateAlertWindowWasInactive;
@@ -98,8 +99,6 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
_timebaseInfo.numer = 0;
_timebaseInfo.denom = 0;
} else {
[self _resetInitializationTime];
}
}
return self;
@@ -114,9 +113,10 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
}
}
- (void)_resetInitializationTime
// This private method is used by SPUUpdater for resetting the opportune time to show an update notice in utmost focus
- (void)resetTimeSinceOpportuneUpdateNotice
{
_initializationTime = [self currentTime];
_timeSinceOpportuneUpdateNotice = [self currentTime];
}
#pragma mark Update Permission
@@ -131,8 +131,6 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
__weak __typeof__(self) weakSelf = self;
self.permissionPrompt = [[SUUpdatePermissionPrompt alloc] initPromptWithHost:self.host request:request reply:^(SUUpdatePermissionResponse *response) {
[weakSelf _resetInitializationTime];
reply(response);
weakSelf.permissionPrompt = nil;
}];
@@ -143,7 +141,7 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
#pragma mark Update Alert Focus
// This private method is used by SPUUpdater when scheduling for update checks
- (void)_logGentleScheduledUpdateReminderWarningIfNeeded
- (void)logGentleScheduledUpdateReminderWarningIfNeeded
{
id<SPUStandardUserDriverDelegate> delegate = self.delegate;
if (!_loggedGentleUpdateReminderWarning && (![delegate respondsToSelector:@selector(supportsGentleScheduledUpdateReminders)] || !delegate.supportsGentleScheduledUpdateReminders)) {
@@ -177,10 +175,10 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
[self.activeUpdateAlert setInstallButtonFocus:YES];
} else {
// Handle scheduled update check
uint64_t timeElapsedSinceInitialization = (uint64_t)([self currentTime] - _initializationTime);
uint64_t timeElapsedSinceOpportuneUpdateNotice = (uint64_t)([self currentTime] - _timeSinceOpportuneUpdateNotice);
// Give scheduled update alerts priority if 3 or less seconds have passed since initialization
BOOL appNearUpdaterInitialization = (timeElapsedSinceInitialization <= 3000000000ULL);
// Give scheduled update alerts priority if 3 or less seconds have passed since our last opportune time
BOOL appNearUpdaterInitialization = (timeElapsedSinceOpportuneUpdateNotice <= 3000000000ULL);
// We will always show an update alert at the right time
[self.activeUpdateAlert setInstallButtonFocus:YES];
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
+20 -19
View File
@@ -6,14 +6,7 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUUserDriver.h>
@@ -32,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
Prefer to set initial properties in your bundle's Info.plist as described in [Customizing Sparkle](https://sparkle-project.org/documentation/customization/).
Otherwise only if you need dynamic behavior (eg. for user preferences) should you set properties on the updater such as:
Otherwise only if you need dynamic behavior for user preferences should you set properties on the updater such as:
- `automaticallyChecksForUpdates`
- `updateCheckInterval`
- `automaticallyDownloadsUpdates`
@@ -102,19 +95,24 @@ SU_EXPORT @interface SPUUpdater : NSObject
- (void)checkForUpdates;
/**
Checks for updates, but does not display any UI unless an update is found.
Checks for updates, but does not show any UI unless an update is found.
You usually do not need to call this method directly. If `automaticallyChecksForUpdates` is @c YES,
Sparkle calls this method automatically according to its update schedule using the `updateCheckInterval`
and the `lastUpdateCheckDate`.
and the `lastUpdateCheckDate`. Therefore, you should typically only consider calling this method directly if you
opt out of automatic update checks.
This is meant for programmatically initating a check for updates in the background without the user initiating it.
This check will not show UI if no new updates are found.
If a new update is found, the updater's user driver may handle showing it at an appropriate (but not necessarily immediate) time.
If you want control over when and how a new update is shown, please see https://sparkle-project.org/documentation/gentle-reminders/
Note if automated updating is turned on, either a new update may be downloaded in the background to be installed silently,
or an already downloaded update may be shown.
This is meant for programmatically initating a check for updates.
That is, it will display no UI unless it finds an update, in which case it proceeds as usual.
This will not find updates that the user has opted into skipping.
Note if there is no resumable update found, and automated updating is turned on,
the update will be downloaded in the background without disrupting the user.
This method does not do anything if there is a `sessionInProgress`.
*/
- (void)checkForUpdatesInBackground;
@@ -177,7 +175,9 @@ SU_EXPORT @interface SPUUpdater : NSObject
this permission request is not performed however.
Setting this property will persist in the host bundle's user defaults.
Only set this property if you need dynamic behavior (e.g. user preferences).
Only set this property if the user wants to change the default via a user preferences option.
For testing environments, you can disable update checks by passing `-SUEnableAutomaticChecks NO`
to your app's command line arguments instead of setting this property.
The update schedule cycle will be reset in a short delay after the property's new value is set.
This is to allow reverting this property without kicking off a schedule change immediately
@@ -187,9 +187,10 @@ SU_EXPORT @interface SPUUpdater : NSObject
/**
A property indicating the current automatic update check interval in seconds.
Prefer to set SUScheduledCheckInterval directly in your Info.plist for setting the initial value.
Setting this property will persist in the host bundle's user defaults.
For this reason, only set this property if you need dynamic behavior (eg user preferences).
Otherwise prefer to set SUScheduledCheckInterval directly in your Info.plist.
Only set this property if the user wants to change the default via a user preferences option.
The update schedule cycle will be reset in a short delay after the property's new value is set.
This is to allow reverting this property without kicking off a schedule change immediately
@@ -205,7 +206,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
In this case, this property will return NO regardless of how this property is set.
Setting this property will persist in the host bundle's user defaults.
For this reason, only set this property if you need dynamic behavior (eg user preferences).
For this reason, only set this property if the user wants to change the default via a user preferences option.
Otherwise prefer to set SUAutomaticallyUpdate directly in your Info.plist.
*/
@property (nonatomic) BOOL automaticallyDownloadsUpdates;
+13 -8
View File
@@ -32,16 +32,11 @@
#import "SPUResumableUpdate.h"
#import "SUSignatures.h"
#import "SPUUserAgent+Private.h"
#import "SPUGentleUserDriverReminders.h"
#include "AppKitPrevention.h"
@interface NSObject (SPUStandardUserDriverPrivate)
- (void)_logGentleScheduledUpdateReminderWarningIfNeeded;
@end
NSString *const SUUpdaterDidFinishLoadingAppCastNotification = @"SUUpdaterDidFinishLoadingAppCastNotification";
NSString *const SUUpdaterDidFindValidUpdateNotification = @"SUUpdaterDidFindValidUpdateNotification";
NSString *const SUUpdaterDidNotFindUpdateNotification = @"SUUpdaterDidNotFindUpdateNotification";
@@ -175,6 +170,10 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
return NO;
}
if ([self.userDriver respondsToSelector:@selector(resetTimeSinceOpportuneUpdateNotice)]) {
[(id<SPUGentleUserDriverReminders>)self.userDriver resetTimeSinceOpportuneUpdateNotice];
}
self.startedUpdater = YES;
self.canCheckForUpdates = YES;
@@ -520,8 +519,8 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
[self.delegate updater:self willScheduleUpdateCheckAfterDelay:delayUntilCheck];
}
if ([self.userDriver respondsToSelector:@selector(_logGentleScheduledUpdateReminderWarningIfNeeded)]) {
[(NSObject *)self.userDriver _logGentleScheduledUpdateReminderWarningIfNeeded];
if ([self.userDriver respondsToSelector:@selector(logGentleScheduledUpdateReminderWarningIfNeeded)]) {
[(id<SPUGentleUserDriverReminders>)self.userDriver logGentleScheduledUpdateReminderWarningIfNeeded];
}
[self.updaterTimer startAndFireAfterDelay:delayUntilCheck];
@@ -807,6 +806,12 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
return; // not even ready yet
}
// Note this resets the opportune time when user grants Sparkle permission to check for updates
// and when the user changes preferences on automatically checking for updates or the update time check interval
if ([self.userDriver respondsToSelector:@selector(resetTimeSinceOpportuneUpdateNotice)]) {
[(id<SPUGentleUserDriverReminders>)self.userDriver resetTimeSinceOpportuneUpdateNotice];
}
if (!self.sessionInProgress) {
[self cancelNextUpdateCycle];
[self scheduleNextUpdateCheckFiringImmediately:NO usingCurrentDate:YES];
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUUpdateCheck.h>
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SPUUserUpdateState.h>
#import <Sparkle/SUExport.h>
-7
View File
@@ -9,14 +9,7 @@
#ifndef SPUUserUpdateState_h
#define SPUUserUpdateState_h
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
NS_ASSUME_NONNULL_BEGIN
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUAPPCAST_H
#define SUAPPCAST_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUAppcastItem_Private_h
#define SUAppcastItem_Private_h
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
NS_ASSUME_NONNULL_BEGIN
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUAPPCASTITEM_H
#define SUAPPCASTITEM_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#ifdef BUILDING_SPARKLE_TESTS
// Ignore incorrect warning
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUERRORS_H
#define SUERRORS_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#if defined(BUILDING_SPARKLE_TOOL) || defined(BUILDING_SPARKLE_TESTS)
// Ignore incorrect warning
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
#define SUSTANDARDVERSIONCOMPARATOR_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#ifdef BUILDING_SPARKLE_TOOL
// Ignore incorrect warning
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
/**
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUUPDATER_H
#define SUUPDATER_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
#import <Sparkle/SUVersionComparisonProtocol.h>
#import <Sparkle/SUVersionDisplayProtocol.h>
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
@protocol SUVersionComparison, SUVersionDisplay;
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
#define SUVERSIONCOMPARISONPROTOCOL_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#ifdef BUILDING_SPARKLE_TOOL
// Ignore incorrect warning
-7
View File
@@ -6,14 +6,7 @@
// Copyright 2009 Elgato Systems GmbH. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
/**
+1 -1
View File
@@ -1,5 +1,5 @@
/* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */
"5.title" = "Software Update";
"5.title" = "Ενημέρωση προγράμματος";
/* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */
"170.title" = "Σημειώσεις Έκδοσης:";
+4 -4
View File
@@ -5,16 +5,16 @@
"45.title" = "Text Cell";
/* Class = "NSTextFieldCell"; title = "Anonymous system profile information is used to help us plan future development work. Please contact us if you have any questions about this.\n\nThis is the information that would be sent:"; ObjectID = "183"; */
"183.title" = "Το ανώνυμο προφίλ συστήματος χρησιμοποιείται για να μας βοηθήσει σε μελλοντική ανάπτυξη του προγράμματος. Παρακαλώ επικοινωνήστε μαζί μας άν έχετε ερωτήσεις.\n\nΑυτές είναι οι πληροφορίες που θα σταλούν:";
"183.title" = "Οι ανώνυμες πληροφορίες του προφίλ του συστήματός σας, μας βοηθούν στο σχεδιασμό της μελλοντικής ανάπτυξης του προγράμματος. Παρακαλώ επικοινωνήστε μαζί μας άν έχετε ερωτήσεις.\n\nΑυτές είναι οι πληροφορίες που θα σταλούν σε εμάς:";
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "cCJ-V0-aTi"; */
"cCJ-V0-aTi.title" = "Μή έλεγχος";
"cCJ-V0-aTi.title" = "Κανένας έλεγχος";
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "gmh-T4-BO0"; */
"gmh-T4-BO0.title" = "Αυτόματος έλεγχος για ενημερώσεις;";
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "gz7-LM-gNf"; */
"gz7-LM-gNf.title" = "Αποστολή ανώνυμου προφίλ συστήματος";
"gz7-LM-gNf.title" = "Συμπερίληψη του ανώνυμου προφίλ του συστήματός σας";
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "OhZ-1K-DmA"; */
"OhZ-1K-DmA.title" = "Έλεγχος Αυτόματα";
"OhZ-1K-DmA.title" = "Αυτόματος Ελεγχος";
+5 -5
View File
@@ -2,10 +2,10 @@
"%@ %@ is currently the newest version available." = "Το %1$@ %2$@ είναι η τελευταία διαθέσιμη έκδοση.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "Το %1$@ %2$@ είναι η τελευταία διαθέσιμη έκδοση.\n(Die derzeit installierte Version ist %3$@.)";
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "Το %1$@ %2$@ είναι η τελευταία διαθέσιμη έκδοση.\n(Η παρούσα εκδοσή σας είναι η %3$@.)";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available—you have %@. Would you like to download it now?" = "Το %1$@ %2$@ είναι πλέον διαθέσιμο--έχετε το %3$@. Θέλετε να το κατεβάσετε τώρα;";
"%@ %@ is now available—you have %@. Would you like to download it now?" = "Το %1$@ %2$@ είναι η νέα έκδοση--έχετε την %3$@. Θέλετε να την κατεβάσετε τώρα;";
/* The download progress in a unit of bytes, e.g. 100 KB */
"%@ downloaded" = "%@ λήφθησαν";
@@ -14,7 +14,7 @@
"%@ of %@" = "%1$@ από %2$@";
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "Το %1$@ %2$@ έχει ληφθεί και είναι έτοιμο προς χρήση! Θα θέλατε να το εγκαταστήσετε και να επανεκκινήσετε το %1$@ τώρα;";
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "Το %1$@ %2$@ κατέβηκε. Είναι έτοιμο προς εγκατάσταση! Θέλετε να εγκαταστήσετε και να επανεκκινήσετε το %1$@ τώρα;";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "Το %1$@ δεν μπορεί να ενημερωθεί όσο τρέχει από έναν δίσκο ανάγνωσης-μόνο ή έναν οπτικό δίσκο.";
@@ -65,7 +65,7 @@
"Ready to Install" = "Έτοιμο προς Εγκατάσταση";
/* No comment provided by engineer. */
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Θέλετε το %1$@ να ελέγχει αυτόματα για ενημερώσεις; Μπορείτε πάντα να ελέγχετε για ενημερώσεις χειροκίνητα από το μενού %1$@.";
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Θέλετε το %1$@ να ελέγχει αυτόματα για ενημερώσεις; Μπορείτε να ελέγχετε πάντα για επιθυμητές ενημερώσεις από το μενού %1$@.";
/* No comment provided by engineer. */
"Update Error!" = "Σφάλμα Ενημέρωσης!";
@@ -74,7 +74,7 @@
"Updating %@" = "Ενημέρωση %@";
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Μεταφέρετε το %1$@ στον φάκελο εφαρμογών σας, επανεκκινήστε το από εκεί, και ξαναδοκιμάστε.";
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Αντιγράψτε το %1$@ στον φάκελο εφαρμογών συστήματος, επανεκκινήστε το από εκεί και ξαναδοκιμάστε.";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You’re up-to-date!" = "Είστε ενημερωμένοι!";
+1 -1
View File
@@ -1,5 +1,5 @@
/* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */
"5.title" = "Aggiormento Software";
"5.title" = "Aggiornamento Software";
/* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */
"170.title" = "Note di rilascio:";
+79 -10
View File
@@ -1,26 +1,50 @@
/* Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install. */
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ è stato scaricato ed è pronto per essere utilizzato! Questo è un aggiornamento importante; desideri installare e riavviare %1$@ ora?";
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ è stato scaricato ed è pronto per essere utilizzato! Desideri installare e riavviare %1$@ ora?";
/* No comment provided by engineer. */
"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@." = "%1$@ %2$@ è disponibile ma la tua versione di macOS è troppo recente per questo aggiornamento. Questo aggiornamento supporta solo fino a macOS %3$@.";
/* No comment provided by engineer. */
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@ è disponibile ma la tua versione di macOS è troppo vecchia per installarla. È richiesto almeno macOS %3$@.";
/* No comment provided by engineer. */
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ non può essere aggiornata se è in esecuzione dalla posizione in cui è stato scaricata.";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ non può essere aggiornata perché è stata aperta da una posizione di sola lettura o temporanea.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ è la versione più recente attualmente disponibile.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ è la versione più recente attualmente disponibile.\n(You are currently running version %3$@.)";
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ è la versione più recente attualmente disponibile.\n(Attualmente stai utilizzando la versione %3$@)";
/* Description text for SUUpdateAlert when the critical update is downloadable. */
"%@ %@ is now available—you have %@. This is an important update; would you like to download it now?" = "%1$@ %2$@ è disponibile; disponi della versione %3$@. Questo è un aggiornamento importante; desideri eseguire l’aggiornamento ora?";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ è disponbile; disponi della versione %3$@. Desideri eseguire l’aggiornamento ora?";
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ è disponibile; disponi della versione %3$@. Desideri eseguire l’aggiornamento ora?";
/* Description text for SUUpdateAlert when the update informational with no download. */
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ è disponibile; disponi della versione %3$@. Desideri ulteriori informazioni su questo aggiornamento sul web?";
/* The download progress in a unit of bytes, e.g. 100 KB */
"%@ downloaded" = "%@ scaricato";
/* No comment provided by engineer. */
"%@ is now updated to version %@!" = "%1$@ ora è aggiornata alla versione %2$@!";
/* No comment provided by engineer. */
"%@ is now updated!" = "%@ ora è aggiornata!";
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
"%@ of %@" = "%1$@ di %2$@";
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ è stato scaricato ed è pronto per essere utilizzato! Desideri installare e riavviare %1$@ ora?";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "Impossibile aggiornare %1$@ quando viene eseguito da un volume di sola lettura come un’immagine disco o un’unità ottica.";
/* No comment provided by engineer. */
"A new version of %@ is available!" = "E’ disponibile una nuova versione di %@!";
"A new version of %@ is available!" = "È disponibile una nuova versione di %@!";
/* No comment provided by engineer. */
"A new version of %@ is ready to install!" = "Una nuova versione di %@ è pronta per essere installata!";
@@ -28,15 +52,30 @@
/* No comment provided by engineer. */
"An error occurred in retrieving update information. Please try again later." = "Si è verificato un errore durante il recupero delle informazioni sull’aggiornamento. Riprova in seguito.";
/* No comment provided by engineer. */
"An error occurred while connecting to the installer. Please try again later." = "Si è verificato un errore durante la connessione al programma di installazione. Riprova in seguito.";
/* No comment provided by engineer. */
"An error occurred while downloading the update. Please try again later." = "Si è verificato un errore durante lo scaricamento dell’aggiornamento. Riprova in seguito.";
/* No comment provided by engineer. */
"An error occurred while extracting the archive. Please try again later." = "Si è verificato un errore durante l’estrazione dell’archivio. Riprova in seguito.";
/* No comment provided by engineer. */
"An error occurred while launching the installer. Please try again later." = "Si è verificato un errore durante l’avvio del programma di installazione. Riprova in seguito.";
/* No comment provided by engineer. */
"An error occurred while parsing the update feed." = "Si è verificato un errore durante la lettura del feed di aggiornamento.";
/* No comment provided by engineer. */
"An error occurred while running the updater. Please try again later." = "Si è verificato un errore durante l’esecuzione del programma di aggiornamento. Riprova in seguito.";
/* No comment provided by engineer. */
"An error occurred while starting the installer. Please try again later." = "Si è verificato un errore durante l’avvio del programma di installazione. Riprova in seguito.";
/* No comment provided by engineer. */
"An important update to %@ is ready to install" = "Un importante aggiornamento di %@ è pronto per l’installazione";
/* No comment provided by engineer. */
"Cancel" = "Annulla";
@@ -52,9 +91,15 @@
/* Take care not to overflow the status window. */
"Extracting update…" = "Estrazione dell’aggiornamento…";
/* No comment provided by engineer. */
"Failed to resume installing update." = "Impossibile riprendere l’installazione dell’aggiornamento.";
/* No comment provided by engineer. */
"Install and Relaunch" = "Installa e Riavvia";
/* Alternate title for 'Remind Me Later' button when downloaded updates can be resumed */
"Install on Quit" = "Installa all’uscita";
/* Take care not to overflow the status window. */
"Installing update…" = "Installazione aggiornamento in corso…";
@@ -64,20 +109,44 @@
/* No comment provided by engineer. */
"OK" = "OK";
/* No comment provided by engineer. */
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "Esci da %1$@, spostala nella Cartella Applicazioni, riavviala da lì e riprova.";
/* No comment provided by engineer. */
"Ready to Install" = "Pronto per l’installazione";
/* No comment provided by engineer. */
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Desideri che %1$@ verifichi gli aggiornamenti automaticamente? Puoi effettuare la verifica manualmente dal menu di %1$@.";
/* No comment provided by engineer. */
"The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version." = "Il controllo degli aggiornamenti non è stato avviato correttamente. È necessario contattare lo sviluppatore dell’app per segnalare questo problema e verificare di disporre della versione più recente.";
/* No comment provided by engineer. */
"The update is improperly signed and could not be validated. Please try again later or contact the app developer." = "L’aggiornamento è firmato in modo errato e non può essere convalidato. Riprova in seguito o contatta lo sviluppatore dell’app.";
/* No comment provided by engineer. */
"Unable to Check For Updates" = "Impossibile controllare gli aggiornamenti";
/* No comment provided by engineer. */
"Update Error!" = "Errore di Aggiornamento!";
/* No comment provided by engineer. */
"Update Installed" = "Aggiornamento installato";
/* No comment provided by engineer. */
"Updating %@" = "Aggiornamento di %@";
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Spostare %1$@ nella Cartella Applicazioni, riavviarlo e riprovare.";
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Spostare %1$@ nella Cartella Applicazioni, riavviarla e riprovare.";
/* No comment provided by engineer. */
"Version History" = "Cronologia versioni";
/* No comment provided by engineer. */
"Your macOS version is too new" = "La tua versione di macOS è troppo recente";
/* No comment provided by engineer. */
"Your macOS version is too old" = "La tua versione di macOS è troppo vecchia";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You’re up-to-date!" = "La tua applicazione è aggiornata!";
+26 -2
View File
@@ -32,7 +32,13 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@がダウンロードされました! 今すぐ %1$@ をインストールして再起動しますか?";
/* No comment provided by engineer. */
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "この場所ではダウンロードされたアップデータを %1$@ に適用できません。";
"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@." = "%1$@ %2$@が入手可能ですが、インストールするにはmacOSのバージョンが新しすぎます。このアップデートはmacOS %3$@までしか対応していません。";
/* No comment provided by engineer. */
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@が入手可能ですが、インストールするにはmacOSのバージョンが古すぎます。macOS %3$@以降が必要です。";
/* No comment provided by engineer. */
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "この場所ではダウンロードされたアップデータを%1$@に適用できません。";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@は読み出し専用またはテンポラリな場所で開かれているためアップデートできません。";
@@ -104,7 +110,7 @@
"OK" = "OK";
/* No comment provided by engineer. */
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "%1$@ を終了させ、アプリケーションフォルダに移動の上再度お試しください。";
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "%1$@を終了させ、アプリケーションフォルダに移動の上再度お試しください。";
/* No comment provided by engineer. */
"Ready to Install" = "インストールできます";
@@ -112,6 +118,15 @@
/* No comment provided by engineer. */
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = " %1$@のアップデートを自動で確認しますか? アップデートは%1$@メニューから手動でいつでも確認することができます。";
/* No comment provided by engineer. */
"The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version." = "アップデートチェッカーが正しくスタートできませんでした。アプリケーション開発者に連絡をしてこの不具合を報告し、最新バージョンであることを確認してください。";
/* No comment provided by engineer. */
"The update is improperly signed and could not be validated. Please try again later or contact the app developer." = "アップデートの署名が不適切で認証できませんでした。あとでやり直すかアプリケーション開発者に連絡してください。";
/* No comment provided by engineer. */
"Unable to Check For Updates" = "アップデートを確認できませんでした";
/* No comment provided by engineer. */
"Update Error!" = "アップデートエラー!";
@@ -124,5 +139,14 @@
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@をアプリケーションフォルダに移動し、そこから再起動したあとやり直してください。";
/* No comment provided by engineer. */
"Version History" = "バージョン履歴";
/* No comment provided by engineer. */
"Your macOS version is too new" = "このmacOSのバージョンは新しすぎます";
/* No comment provided by engineer. */
"Your macOS version is too old" = "このmacOSのバージョンは古すぎます";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You’re up-to-date!" = "最新版を使用しています!";
+1 -1
View File
@@ -2,7 +2,7 @@
"%@ %@ is currently the newest version available." = "O %1$@ %2$@ é neste momento a versão mais recente disponível.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "O %1$@ %2$@ é neste momento a versão mais recente disponível.\n(You are currently running version %3$@.)";
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "O %1$@ %2$@ é neste momento a versão mais recente disponível.\n(Neste momento está na versão %3$@.)";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available—you have %@. Would you like to download it now?" = "O %1$@ %2$@ está agora disponível e tem a versão %3$@. Gostaria de o transferir agora?";
+3 -3
View File
@@ -2,7 +2,7 @@
"%@ %@ is currently the newest version available." = "%1$@ %2$@ 已是目前最新的版本。";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ 已是目前最新的版本。\n(You are currently running version %3$@.)";
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ 已是目前最新的版本。\n(您正在執行的版本是 %3$@。)";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ 現在已可取得,您的版本則是 %3$@。您要現在下載嗎?";
@@ -74,7 +74,7 @@
"Updating %@" = "正在更新 %@";
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "請將 %1$@ 移至您的“應用程式”檔案夾,從該處重新啟動,然後再試一次。";
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "請將 %1$@ 移至您的「應用程式」檔案夾,從該處重新啟動,然後再試一次。";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You’re up-to-date!" = "你已有最新版本!";
"You’re up-to-date!" = "您已有最新版本!";
+6 -11
View File
@@ -24,10 +24,9 @@ class SUUnarchiverTest: XCTestCase
let unarchivedSuccessExpectation = super.expectation(description: "Unarchived Success (format: \(archiveExtension))")
let unarchivedFailureExpectation = super.expectation(description: "Unarchived Failure (format: \(archiveExtension))")
let tempArchiveURL = tempDirectoryURL.appendingPathComponent(archiveResourceURL.lastPathComponent)
let extractedAppURL = tempDirectoryURL.appendingPathComponent(extractedAppName).appendingPathExtension("app")
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, tempArchiveURL: tempArchiveURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
self.unarchiveNonExistentFileTestFailureAppWithExtension(archiveExtension, tempDirectoryURL: tempDirectoryURL, password: password, expectingInstallationType: installationType, testExpectation: unarchivedFailureExpectation)
super.waitForExpectations(timeout: 30.0, handler: nil)
@@ -40,7 +39,7 @@ class SUUnarchiverTest: XCTestCase
func unarchiveNonExistentFileTestFailureAppWithExtension(_ archiveExtension: String, tempDirectoryURL: URL, password: String?, expectingInstallationType installationType: String, testExpectation: XCTestExpectation) {
let tempArchiveURL = tempDirectoryURL.appendingPathComponent("error-invalid").appendingPathExtension(archiveExtension)
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
XCTAssertNotNil(error)
@@ -49,13 +48,9 @@ class SUUnarchiverTest: XCTestCase
}
// swiftlint:disable function_parameter_count
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, tempArchiveURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
let fileManager = FileManager.default
try! fileManager.copyItem(at: archiveResourceURL, to: tempArchiveURL)
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
let unarchiver = SUUnarchiver.unarchiver(forPath: archiveResourceURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
if expectingSuccess {
@@ -130,7 +125,7 @@ class SUUnarchiverTest: XCTestCase
self.unarchiveTestAppWithExtension("dmg", resourceName: "SparkleTestCodeSign_apfs")
}
func testUnarchivingFlatPackage()
func testUnarchivingBarePackage()
{
self.unarchiveTestAppWithExtension("pkg", resourceName: "test", expectingInstallationType: SPUInstallationTypeGuidedPackage)
+15 -9
View File
@@ -138,18 +138,24 @@ class ArchiveItem: CustomStringConvertible {
}
var frameworkVersion: String? = nil
if let appBundle = Bundle(url: appPath), let frameworksURL = appBundle.privateFrameworksURL {
let sparkleBundleURL = frameworksURL.appendingPathComponent("Sparkle").appendingPathExtension("framework")
do {
let canonicalFrameworksURL = appPath.appendingPathComponent("Contents/Frameworks/Sparkle.framework")
if let sparkleBundle = Bundle(url: sparkleBundleURL), let infoDictionary = sparkleBundle.infoDictionary {
frameworkVersion = infoDictionary[kCFBundleVersionKey as String] as? String
} else {
let frameworksURL: URL?
if !FileManager.default.fileExists(atPath: canonicalFrameworksURL.path) {
// Try legacy SparkleCore framework that was shipping in early 2.0 betas
let sparkleCoreBundleURL = frameworksURL.appendingPathComponent("SparkleCore").appendingPathExtension("framework")
if let sparkleBundle = Bundle(url: sparkleCoreBundleURL), let infoDictionary = sparkleBundle.infoDictionary {
frameworkVersion = infoDictionary[kCFBundleVersionKey as String] as? String
let sparkleCoreFrameworksURL = appPath.appendingPathComponent("Contents/Frameworks/SparkleCore.framework")
if FileManager.default.fileExists(atPath: sparkleCoreFrameworksURL.path) {
frameworksURL = sparkleCoreFrameworksURL
} else {
frameworksURL = nil
}
} else {
frameworksURL = canonicalFrameworksURL
}
if let frameworksURL = frameworksURL, let frameworkInfoPlist = NSDictionary(contentsOf: frameworksURL.appendingPathComponent("Resources/Info.plist")) {
frameworkVersion = frameworkInfoPlist[kCFBundleVersionKey as String] as? String
}
}
+4
View File
@@ -33,6 +33,10 @@ extension FileHandle {
CC_SHA256_Final(hash.baseAddress, &context)
defer {
hash.deallocate()
}
return hash.reduce("") { $0 + String(format: "%02x", $1) }
}
+16 -28
View File
@@ -8,38 +8,26 @@ import Foundation
func unarchive(itemPath: URL, archiveDestDir: URL, callback: @escaping (Error?) -> Void) {
let fileManager = FileManager.default
let tempDir = archiveDestDir.appendingPathExtension("tmp")
let itemCopy = tempDir.appendingPathComponent(itemPath.lastPathComponent)
_ = try? fileManager.removeItem(at: tempDir)
_ = try? fileManager.createDirectory(at: tempDir, withIntermediateDirectories: true, attributes: [:])
do {
do {
try fileManager.linkItem(at: itemPath, to: itemCopy)
} catch {
try fileManager.copyItem(at: itemPath, to: itemCopy)
}
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemCopy.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
unarchiver.unarchive(completionBlock: { (error: Error?) in
if error != nil {
callback(error)
return
}
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemPath.path, extractionDirectory: tempDir.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
unarchiver.unarchive(completionBlock: { (error: Error?) in
if error != nil {
callback(error)
return
}
_ = try? fileManager.removeItem(at: itemCopy)
do {
try fileManager.moveItem(at: tempDir, to: archiveDestDir)
callback(nil)
} catch {
callback(error)
}
}, progressBlock: nil)
} else {
_ = try? fileManager.removeItem(at: itemCopy)
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemCopy)"))
}
} catch {
_ = try? fileManager.removeItem(at: tempDir)
callback(error)
do {
try fileManager.moveItem(at: tempDir, to: archiveDestDir)
callback(nil)
} catch {
callback(error)
}
}, progressBlock: nil)
} else {
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemPath.path)"))
}
}
+38 -3
View File
@@ -59,8 +59,8 @@ struct GenerateAppcast: ParsableCommand {
@Option(help: ArgumentHelp("The account name in your keychain associated with your private EdDSA (ed25519) key to use for signing new updates."))
var account : String = "ed25519"
@Option(name: .customShort("s"), help: ArgumentHelp("The private EdDSA string (128 characters). If not specified, the private EdDSA key will be read from the Keychain instead.", valueName: "private-EdDSA-key"))
var privateEdString : String?
@Option(name: .customLong("ed-key-file"), help: ArgumentHelp("Path to the private EdDSA key file. If not specified, the private EdDSA key will be read from the Keychain instead. '-' can be used to echo the EdDSA key from a 'secret' environment variable to the standard input stream. For example: echo \"$PRIVATE_KEY_SECRET\" | ./\(programName) --ed-key-file -", valueName: "private-EdDSA-key-file"))
var privateEdKeyPath: String?
@Option(name: .customShort("f"), help: ArgumentHelp("Path to the private DSA key file. Only use this option for transitioning to EdDSA from older updates.", valueName: "private-dsa-key-file"), transform: { URL(fileURLWithPath: $0) })
var privateDSAKeyURL: URL?
@@ -68,6 +68,9 @@ struct GenerateAppcast: ParsableCommand {
@Option(name: .customShort("n"), help: ArgumentHelp("The name of the private DSA key. This option must be used together with `-k`. Only use this option for transitioning to EdDSA from older updates.", valueName: "dsa-key-name"))
var privateDSAKeyName: String?
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA string (128 characters). This option is deprecated. Please use the Keychain, or pass the key as standard input when using the --ed-key-file - option instead.", valueName: "private-EdDSA-key"))
var privateEdString : String?
@Option(name: .customShort("k"), help: ArgumentHelp("The path to the keychain to look up the private DSA key. This option must be used together with `-n`. Only use this option for transitioning to EdDSA from older updates.", valueName: "keychain-for-dsa"), transform: { URL(fileURLWithPath: $0) })
var keychainURL: URL?
@@ -178,6 +181,10 @@ struct GenerateAppcast: ParsableCommand {
throw ValidationError("-f <private-dsa-key-file> cannot be provided if -n <dsa-key-name> and -k <keychain> is provided")
}
guard (privateEdKeyPath == nil) || (privateEdString == nil) else {
throw ValidationError("--ed-key-file <private-EdDSA-key-file> cannot be provided if -s <private-EdDSA-key> is provided")
}
if let versions = versions {
guard versions.count > 0 else {
throw ValidationError("--versions must specify at least one application version.")
@@ -220,7 +227,35 @@ struct GenerateAppcast: ParsableCommand {
privateDSAKey = nil
}
let keys = loadPrivateKeys(account, privateDSAKey, privateEdString)
let privateEdKeyString: String?
if let privateEdString = privateEdString {
privateEdKeyString = privateEdString
print("Warning: The -s option for passing the private EdDSA key is insecure and deprecated. Please see its help usage for more information.")
} else if let privateEdKeyPath = privateEdKeyPath {
do {
let privateKeyString: String
if privateEdKeyPath == "-" && !FileManager.default.fileExists(atPath: privateEdKeyPath) {
if let line = readLine(strippingNewline: true) {
privateKeyString = line
} else {
print("Unable to read EdDSA private key from standard input")
throw ExitCode(1)
}
} else {
privateKeyString = try String(contentsOf: URL(fileURLWithPath: privateEdKeyPath))
}
privateEdKeyString = privateKeyString
} catch {
print("Unable to load EdDSA private key from", privateEdKeyPath, "\n", error)
throw ExitCode(1)
}
} else {
privateEdKeyString = nil
}
let keys = loadPrivateKeys(account, privateDSAKey, privateEdKeyString)
do {
let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, cacheDirectory: GenerateAppcast.cacheDirectory, keys: keys, versions: versions, maximumDeltas: maximumDeltas, deltaCompressionModeDescription: deltaCompression, deltaCompressionLevel: deltaCompressionLevel, disableNestedCodeCheck: disableNestedCodeCheck, verbose: verbose)
+22 -8
View File
@@ -22,7 +22,7 @@ func findKeysInKeychain(account: String) throws -> (Data, Data) {
if res == errSecSuccess, let encoded = item as? Data, let keys = Data(base64Encoded: encoded) {
return (keys[0..<64], keys[64..<(64+32)])
} else if res == errSecItemNotFound {
print("ERROR! Signing key not found for account \(account). Please run generate_keys tool first or provide key with -f <private_key_file> or -s <private_key> parameter.")
print("ERROR! Signing key not found for account \(account). Please run generate_keys tool first or provide key with --ed-key-file <private_key_file>")
} else if res == errSecAuthFailed {
print("ERROR! Access denied. Can't get keys from the keychain.")
print("Go to Keychain Access.app, lock the login keychain, then unlock it again.")
@@ -37,7 +37,17 @@ func findKeysInKeychain(account: String) throws -> (Data, Data) {
}
func findKeys(inFile privateAndPublicBase64KeyFile: String) throws -> (Data, Data) {
let privateAndPublicBase64Key = try String(contentsOfFile: privateAndPublicBase64KeyFile)
let privateAndPublicBase64Key: String
if privateAndPublicBase64KeyFile == "-" && !FileManager.default.fileExists(atPath: privateAndPublicBase64KeyFile) {
if let line = readLine(strippingNewline: true) {
privateAndPublicBase64Key = line
} else {
print("ERROR! Unable to read EdDSA private key from standard input")
throw ExitCode(1)
}
} else {
privateAndPublicBase64Key = try String(contentsOfFile: privateAndPublicBase64KeyFile)
}
return try findKeys(inString: privateAndPublicBase64Key)
}
@@ -70,16 +80,15 @@ func edSignature(data: Data, publicEdKey: Data, privateEdKey: Data) -> String {
}
struct SignUpdate: ParsableCommand {
static let programName = "sign_update"
@Option(help: ArgumentHelp("The account name in your keychain associated with your private EdDSA (ed25519) key to use for signing the update."))
var account: String = "ed25519"
@Flag(help: ArgumentHelp("Verify that the update is signed correctly. If this is set, a second argument <verify-signature> denoting the signature must be passed after the <update-path>.", valueName: "verify"))
var verify: Bool = false
@Option(name: .customShort("s"), help: ArgumentHelp("The private EdDSA (ed25519) key.", valueName: "private-key"))
var privateKey: String?
@Option(name: .customShort("f"), help: ArgumentHelp("Path to the file containing the private EdDSA (ed25519) key.", valueName: "private-key-file"))
@Option(name: [.customShort("f"), .customLong("ed-key-file")], help: ArgumentHelp("Path to the file containing the private EdDSA (ed25519) key. '-' can be used to echo the EdDSA key from a 'secret' environment variable to the standard input stream. For example: echo \"$PRIVATE_KEY_SECRET\" | ./\(programName) --ed-key-file -", valueName: "private-key-file"))
var privateKeyFile: String?
@Argument(help: "The update archive, delta update, or package (pkg) to sign or verify.")
@@ -88,13 +97,16 @@ struct SignUpdate: ParsableCommand {
@Argument(help: "The signature to verify when --verify is passed.")
var verifySignature: String?
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA (ed25519) key. Please use the Keychain, or pass the key as standard input when using --ed-key-file - instead.", valueName: "private-key"))
var privateKey: String?
static var configuration: CommandConfiguration = CommandConfiguration(
abstract: "Sign or verify an update using your EdDSA (ed25519) keys.",
discussion: "The EdDSA keys are automatically read from the Keychain if no <private-key> or <private-key-file> is specified.\n\nWhen signing, this tool will output an EdDSA signature and length attributes to use for your update's appcast item enclosure.")
discussion: "The EdDSA keys are automatically read from the Keychain if no <private-key-file> is specified.\n\nWhen signing, this tool will output an EdDSA signature and length attributes to use for your update's appcast item enclosure.")
func validate() throws {
guard privateKey == nil || privateKeyFile == nil else {
throw ValidationError("Both -s <private-key> and -f <private-key-file> options cannot be provided.")
throw ValidationError("Both --ed-key-file <private-key-file> and -s <private-key> options cannot be provided.")
}
guard !verify || verifySignature != nil else {
@@ -106,6 +118,8 @@ struct SignUpdate: ParsableCommand {
let (priv, pub): (Data, Data)
if let privateKey = privateKey {
fputs("Warning: The -s option for passing the private EdDSA key is insecure and deprecated. Please see its help usage for more information.\n", stderr)
(priv, pub) = try findKeys(inString: privateKey)
} else if let privateKeyFile = privateKeyFile {
(priv, pub) = try findKeys(inFile: privateKeyFile)
+5 -1
View File
@@ -248,7 +248,11 @@ typedef NS_ENUM(int, CLIErrorExitStatus) {
fprintf(stderr, "%s\n", error.localizedDescription.UTF8String);
exit(CLIErrorCodeCannotInstallInteractivePackageAsRoot);
} else if (error.code == SUInstallationWriteNoPermissionError) {
fprintf(stderr, "Error: %s\n", error.localizedDescription.UTF8String);
fprintf(stderr, "Error: %s", error.localizedDescription.UTF8String);
if (error.localizedRecoverySuggestion != nil) {
fprintf(stderr, " %s", error.localizedRecoverySuggestion.UTF8String);
}
fprintf(stderr, "\n");
exit(CLIErrorExitStatusInstallationWriteNoPermissionError);
} else {
fprintf(stderr, "Error: Update has failed due to error %ld (%s). %s\n", (long)error.code, error.domain.UTF8String, error.localizedDescription.UTF8String);