mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e27997de0 | ||
|
|
ff6418d3cd | ||
|
|
c263b969c0 | ||
|
|
3c0ebbf570 | ||
|
|
743e15cce8 | ||
|
|
77bf6ad890 | ||
|
|
f6b7693b75 | ||
|
|
f410960ac0 | ||
|
|
0b0a751d82 | ||
|
|
059ce91287 | ||
|
|
cc0007de3a | ||
|
|
fe69cab530 | ||
|
|
14e511f901 | ||
|
|
80e60279ee | ||
|
|
c1bf68f91f | ||
|
|
4622061d8f | ||
|
|
a7e5320d6a | ||
|
|
90221e7a0f | ||
|
|
7c1cc5627b | ||
|
|
bececc3738 | ||
|
|
a6984d3c02 | ||
|
|
102c4a4009 | ||
|
|
d2fd9a50e0 | ||
|
|
d544d456e0 | ||
|
|
b1f6c161d1 | ||
|
|
06daa03196 | ||
|
|
e64b7649f2 |
No files matched your search
@@ -2,9 +2,9 @@ name: Build & Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 2.x, master ]
|
||||
branches: [ 2.x, 2.2.2-dev, master ]
|
||||
pull_request:
|
||||
branches: [ 2.x, master ]
|
||||
branches: [ 2.x, 2.2.2-dev, master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -78,7 +78,9 @@
|
||||
|
||||
__weak AgentConnection *weakSelf = self;
|
||||
newConnection.interruptionHandler = ^{
|
||||
[weakSelf.activeConnection invalidate];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[weakSelf.activeConnection invalidate];
|
||||
});
|
||||
};
|
||||
|
||||
newConnection.invalidationHandler = ^{
|
||||
|
||||
@@ -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 = ^{
|
||||
|
||||
@@ -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;
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+43
-8
@@ -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];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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"}
|
||||
@@ -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}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
+3
-3
@@ -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,5 +1,6 @@
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
color-scheme: dark;
|
||||
color: white;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
@@ -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 = ^{
|
||||
|
||||
-7
@@ -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>
|
||||
|
||||
|
||||
Vendored
-7
@@ -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
@@ -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];
|
||||
}
|
||||
|
||||
-7
@@ -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
|
||||
|
||||
Vendored
-7
@@ -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>
|
||||
|
||||
|
||||
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];
|
||||
|
||||
-7
@@ -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
|
||||
|
||||
Vendored
-7
@@ -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
|
||||
|
||||
Vendored
+20
-19
@@ -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;
|
||||
|
||||
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];
|
||||
|
||||
Vendored
-7
@@ -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>
|
||||
|
||||
|
||||
Vendored
-7
@@ -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
|
||||
|
||||
Vendored
-7
@@ -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>
|
||||
|
||||
Vendored
-7
@@ -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>
|
||||
|
||||
|
||||
Vendored
-7
@@ -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
|
||||
|
||||
|
||||
Vendored
-7
@@ -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
|
||||
|
||||
Vendored
-7
@@ -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
|
||||
|
||||
|
||||
Vendored
-7
@@ -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
|
||||
|
||||
Vendored
-7
@@ -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
@@ -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
|
||||
|
||||
Vendored
-7
@@ -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>
|
||||
|
||||
/**
|
||||
|
||||
Vendored
-7
@@ -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>
|
||||
|
||||
Vendored
-7
@@ -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
@@ -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
|
||||
|
||||
Vendored
-7
@@ -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
@@ -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!" = "Είστε ενημερωμένοι!";
|
||||
+1
-1
@@ -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:";
|
||||
|
||||
Vendored
+79
-10
@@ -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!";
|
||||
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!" = "最新版を使用しています!";
|
||||
Vendored
+1
-1
@@ -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?";
|
||||
|
||||
Vendored
+3
-3
@@ -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!" = "您已有最新版本!";
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,10 @@ extension FileHandle {
|
||||
|
||||
CC_SHA256_Final(hash.baseAddress, &context)
|
||||
|
||||
defer {
|
||||
hash.deallocate()
|
||||
}
|
||||
|
||||
return hash.reduce("") { $0 + String(format: "%02x", $1) }
|
||||
}
|
||||
|
||||
|
||||
@@ -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