mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1bf68f91f | ||
|
|
4622061d8f | ||
|
|
a7e5320d6a | ||
|
|
90221e7a0f | ||
|
|
7c1cc5627b | ||
|
|
bececc3738 | ||
|
|
a6984d3c02 | ||
|
|
102c4a4009 | ||
|
|
d2fd9a50e0 | ||
|
|
d544d456e0 | ||
|
|
b1f6c161d1 | ||
|
|
06daa03196 | ||
|
|
e64b7649f2 | ||
|
|
220c1edac1 | ||
|
|
e866f8d786 | ||
|
|
2b6664cd8a | ||
|
|
a913fe1355 | ||
|
|
24b072c661 | ||
|
|
2ddef5179e |
No files matched your search
@@ -78,7 +78,9 @@
|
||||
|
||||
__weak AgentConnection *weakSelf = self;
|
||||
newConnection.interruptionHandler = ^{
|
||||
[weakSelf.activeConnection invalidate];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[weakSelf.activeConnection invalidate];
|
||||
});
|
||||
};
|
||||
|
||||
newConnection.invalidationHandler = ^{
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
#define FIRST_UPDATER_MESSAGE_TIMEOUT 7ull
|
||||
#define RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT 5ull
|
||||
#define FIRST_UPDATER_MESSAGE_TIMEOUT 18ull
|
||||
#define RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT 8ull
|
||||
|
||||
/**
|
||||
* Show display progress UI after a delay from starting the final part of the installation.
|
||||
@@ -147,7 +147,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 = ^{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,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)
|
||||
@@ -20,16 +21,23 @@
|
||||
* Ignore custom icons set via resource forks when applying delta updates (Zorg) (#2114)
|
||||
* Fall back to regular update if delta update fails to download (Zorg) (#2118)
|
||||
* Skip downloading delta updates when application has been moved to a file system (like FAT) that doesn't support regular permission modes (Zorg) (#2148)
|
||||
* 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
@@ -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"}
|
||||
{"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"}
|
||||
@@ -47,8 +47,8 @@ SPARKLE_VERSION_PATCH = 0
|
||||
|
||||
// This should be in SemVer format or empty, ie. "-beta.1"
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_SUFFIX = -beta.1
|
||||
CURRENT_PROJECT_VERSION = 2014
|
||||
SPARKLE_VERSION_SUFFIX =
|
||||
CURRENT_PROJECT_VERSION = 2016
|
||||
|
||||
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}
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -81,7 +81,8 @@
|
||||
jobDictionary[@"EnableTransactions"] = @NO;
|
||||
jobDictionary[@"KeepAlive"] = @{@"SuccessfulExit" : @NO};
|
||||
jobDictionary[@"RunAtLoad"] = @NO;
|
||||
jobDictionary[@"NICE"] = @0;
|
||||
jobDictionary[@"Nice"] = @0;
|
||||
jobDictionary[@"ProcessType"] = @"Interactive";
|
||||
jobDictionary[@"LaunchOnlyOnce"] = @YES;
|
||||
jobDictionary[@"MachServices"] = @{SPUStatusInfoServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES};
|
||||
|
||||
@@ -277,7 +278,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
NSDictionary *jobDictionary = @{@"Label" : label, @"ProgramArguments" : arguments, @"EnableTransactions" : @NO, @"KeepAlive" : @{@"SuccessfulExit" : @NO}, @"RunAtLoad" : @NO, @"Nice" : @0, @"LaunchOnlyOnce": @YES, @"MachServices" : @{SPUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES, SPUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}};
|
||||
NSDictionary *jobDictionary = @{@"Label" : label, @"ProgramArguments" : arguments, @"EnableTransactions" : @NO, @"KeepAlive" : @{@"SuccessfulExit" : @NO}, @"RunAtLoad" : @NO, @"Nice" : @0, @"ProcessType": @"Interactive", @"LaunchOnlyOnce": @YES, @"MachServices" : @{SPUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES, SPUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}};
|
||||
|
||||
CFErrorRef submitError = NULL;
|
||||
#pragma clang diagnostic push
|
||||
|
||||
@@ -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
|
||||
@@ -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];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -29,13 +29,86 @@ EXTERNAL LICENSES
|
||||
=================
|
||||
|
||||
bspatch.c and bsdiff.c, from bsdiff 4.3 <http://www.daemonology.net/bsdiff/>:
|
||||
Copyright (c) 2003-2005 Colin Percival.
|
||||
|
||||
Copyright 2003-2005 Colin Percival
|
||||
All rights reserved
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted providing that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--
|
||||
|
||||
sais.c and sais.c, from sais-lite (2010/08/07) <https://sites.google.com/site/yuta256/sais>:
|
||||
Copyright (c) 2008-2010 Yuta Mori.
|
||||
|
||||
The sais-lite copyright is as follows:
|
||||
|
||||
Copyright (c) 2008-2010 Yuta Mori All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
--
|
||||
|
||||
Portable C implementation of Ed25519, from https://github.com/orlp/ed25519
|
||||
|
||||
Copyright (c) 2015 Orson Peters <orsonpeters@gmail.com>
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty. In no event will the
|
||||
authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including commercial
|
||||
applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you wrote the
|
||||
original software. If you use this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be misrepresented as
|
||||
being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
--
|
||||
|
||||
SUSignatureVerifier.m:
|
||||
Copyright (c) 2011 Mark Hamlin.
|
||||
|
||||
Copyright (c) 2011 Mark Hamlin.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@
|
||||
import PackageDescription
|
||||
|
||||
// Version is technically not required here, SPM doesn't check
|
||||
let version = "2.2.0-beta.1"
|
||||
let version = "2.2.0"
|
||||
// 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.1"
|
||||
let checksum = "f14624404fdc112cf9a4f4c57586c7e0d97c100082aa86f877885389da22d733"
|
||||
let tag = "2.2.0"
|
||||
let checksum = "44b546e7b40fec4aba1916972497964e2ed5638f6b5459a042a803697b00113e"
|
||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
let package = Package(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "2.2.0-beta.1"
|
||||
s.version = "2.2.0"
|
||||
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"
|
||||
|
||||
@@ -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 */,
|
||||
|
||||
@@ -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 = ^{
|
||||
|
||||
+22
@@ -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 */
|
||||
Vendored
+14
-20
@@ -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];
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -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];
|
||||
}
|
||||
|
||||
Vendored
+10
-12
@@ -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];
|
||||
|
||||
+12
-13
@@ -79,7 +79,7 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
|
||||
Declares whether or not gentle scheduled update reminders are supported.
|
||||
|
||||
The delegate may implement scheduled update reminders that are presented in a gentle manner by implementing one or both of:
|
||||
`-standardUserDriverWillShowUpdate:state:` and `-standardUserDriverShouldHandleShowingUpdateAlertForScheduledUpdate:andInImmediateFocus:`
|
||||
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:` and `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
|
||||
|
||||
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
|
||||
|
||||
@@ -99,8 +99,9 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
|
||||
|
||||
If the standard user driver handles showing the update, `immediateFocus` reflects whether or not it will show the update in immediate and utmost focus.
|
||||
The standard user driver may choose to show the update in immediate and utmost focus when the app was launched recently
|
||||
or the system has been idle for some time. If `immediateFocus` is @c NO the standard user driver may want to
|
||||
defer showing the update until the user comes back to the app.
|
||||
or the system has been idle for some time.
|
||||
|
||||
If `immediateFocus` is @c NO the standard user driver may want to defer showing the update until the user comes back to the app.
|
||||
For background running applications, when `immediateFocus` is @c NO the standard user driver will always want to show
|
||||
the update alert immediately, but behind other running applications or behind the app's own windows if it's currently active.
|
||||
|
||||
@@ -121,16 +122,14 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
|
||||
/**
|
||||
Called before an update will be shown to the user.
|
||||
|
||||
If the standard user driver handles showing the update, `handleShowingUpdate` will be @c YES
|
||||
In this case, if the update is not user initiated (`state.userInitiated` is @c NO) then the standard user driver may defer showing the update,
|
||||
and it may be shown when the user comes back to the app.
|
||||
For a background (dockless) running app, the update alert will always show up immediately but behind other running applications or behind
|
||||
its own windows if the app is currently active.
|
||||
If the standard user driver handles showing the update, `handleShowingUpdate` will be `YES`.
|
||||
Please see `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:` for how the standard user driver
|
||||
may handle showing scheduled updates when `handleShowingUpdate` is `YES` and `state.userInitiated` is `NO`.
|
||||
|
||||
If the delegate declared it handles showing the update by returning @c NO in `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
|
||||
then the delegate should handle showing update reminders in this method, or at some later point.
|
||||
In this case, `handleShowingUpdate` will be @c NO.
|
||||
To bring the update alert in focus, you may call `-[SPUStandardUpdateController checkForUpdates:]` or `-[SPUUpdater checkForUpdates]`
|
||||
To bring the update alert in focus, you may call `-[SPUStandardUpdaterController checkForUpdates:]` or `-[SPUUpdater checkForUpdates]`.
|
||||
You may want to show additional UI indicators in your application that will show this update in focus
|
||||
and want to dismiss additional UI indicators in `-standardUserDriverWillFinishUpdateSession` or `-standardUserDriverDidReceiveUserAttentionForUpdate:`
|
||||
|
||||
@@ -153,9 +152,9 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
|
||||
This occurs either when the user first brings the update alert in utmost focus or when the user makes a choice to install an update or dismiss/skip it.
|
||||
|
||||
This may be useful to intercept for dismissing custom attention-based UI indicators (e.g, user notifications) introduced when implementing
|
||||
`-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
|
||||
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
|
||||
|
||||
For custom UI indicators that need to still be on screen after the user has started to install an update, please see `standardUserDriverWillFinishUpdateSession`.
|
||||
For custom UI indicators that need to still be on screen after the user has started to install an update, please see `-standardUserDriverWillFinishUpdateSession`.
|
||||
|
||||
@param update The new update that the user gave attention to.
|
||||
*/
|
||||
@@ -168,10 +167,10 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
|
||||
For updaters updating external/other bundles, this may also be called after an update has been successfully installed.
|
||||
|
||||
This may be useful to intercept for dismissing custom UI indicators introduced when implementing
|
||||
`-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
|
||||
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
|
||||
|
||||
For UI indicators that need to be dismissed when the user has given attention to a new update alert,
|
||||
please see `standardUserDriverDidReceiveUserAttentionForUpdate:`
|
||||
please see `-standardUserDriverDidReceiveUserAttentionForUpdate:`
|
||||
*/
|
||||
- (void)standardUserDriverWillFinishUpdateSession;
|
||||
|
||||
|
||||
Vendored
+20
-12
@@ -32,7 +32,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 +102,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 +182,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 +194,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 +213,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;
|
||||
|
||||
Vendored
+13
-8
@@ -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];
|
||||
|
||||
+1
-1
@@ -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
@@ -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" = "Αυτόματος Ελεγχος";
|
||||
Vendored
+5
-5
@@ -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!" = "Είστε ενημερωμένοι!";
|
||||
Vendored
+26
-2
@@ -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!" = "最新版を使用しています!";
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user