Compare commits

...
Author SHA1 Message Date
Sparkle-Bot b328c499a3 Update Package management files for version 2.6.1 2024-05-02 15:22:43 +00:00
Zorg 00e6259c9d Update CHANGELOG for 2.6.1 2024-05-02 17:15:18 +02:00
Zorg 31b462f860 Extract archives in a separate directory from the input archive (#2550) 2024-04-30 21:24:43 +02:00
Zorg 5264c01d37 Remove assert on download response being available (#2547) 2024-04-25 20:01:14 -07:00
Zorg 0cff81740f Fix the WebKit view not transitioning from light to dark mode (#2542)
adaptReleaseNotesAppearance was over-engineered to update the transparent background state of the web view (which was causing the issue) and the background NSBox view when the system changes to dark or light mode. This is because when dark mode support was originally written, it used to use a stylesheet that was only specific to dark aqua. However this code has changed some time ago to use a universal stylesheet for both light/dark mode.

So now when the WebKit view is created, we just opt into a transparent background and set up a background NSBox view once and don't do anything when the effectiveAppearance of the views change. This fixes visual issues on current and older OS systems when changing system appearance.
2024-04-21 15:58:37 -07:00
Viktor Szépe e9989a8ae7 Fix typos (#2537) 2024-04-13 16:12:23 -07:00
Zorg 2e1bdb98f1 Update upload-artifact version to v4 (#2536) 2024-03-31 20:26:04 -07:00
Zorg d30adc8407 Create tar.xz files with built-in tar and remove bzip2 fallback (#2535) 2024-03-31 16:41:50 -07:00
Zorg 0183bf2b3f Clarify authorization prompt can show after starting extraction (#2534) 2024-03-29 11:02:35 -07:00
Zorg 2b7615fe5b Fallback in case SULocalizedStringFromTableInBundle() fails (#2533)
SULocalizedStringFromTableInBundle() should only fail in the abnormal situation where the app bundle may have been moved while it was running. Technically the app is running in an unsupported state but I suppose we can guard against it here.
2024-03-28 18:52:28 -07:00
Zorg 9aece0259c Add NN (Norwegian Nynorsk) locale (#2532) 2024-03-28 18:51:35 -07:00
Zorg 8c7476f93d Document user driver interaction with authorization (#2531) 2024-03-27 19:20:43 -07:00
Sparkle-Bot 0a4caaf7a8 Update Package management files for version 2.6.0 2024-03-15 18:08:43 +00:00
Sparkle-Bot a603047fd5 Update Package management files for version 2.6.0-beta.2 2024-03-04 02:40:08 +00:00
Zorg 2bd33682d1 Update CHANGELOG 2024-03-03 18:34:12 -08:00
Zorg dfab64efdf Remove installer status & connection entitlement files (#2517)
These entitlements are not easy to configure properly and most developers should not be using these services.

Also simplify how to opt into enabling sandboxing entitlements for the Downloader XPC Service.
2024-03-03 17:41:12 -08:00
Zorg 51ce7108c9 Swap app bundles with APFS atomic swap if team IDs match (#2516) 2024-03-02 17:32:54 -08:00
Sparkle-Bot 56e365d050 Update Package management files for version 2.6.0-beta.1 2024-02-23 05:22:24 +00:00
Zorg c983fa1548 Update CHANGELOG for 2.6 2024-02-22 21:11:53 -08:00
Zorg ef1f03cf1e Disable sandboxing for downloader XPC service by default (#2511) 2024-02-19 18:49:18 -08:00
Zorg 4d164ba4ab Update GitHub actions runners to Xcode 15.2 (#2506) 2024-02-18 12:38:30 -08:00
Zorg 66c198932d Perform Gatekeeper scan to pre-warm app launch (#2505)
This avoids users being a "Verifying..." Dialog when the installed update is (re-)launched.

This scan is only done for macOS 14.4+ onwards (gktool was introduced in macOS 14.0 but had issues).

Also this scan is only done if Autoupdate's team identifier matches the new update's team identifier. Otherwise the OS may think Autoupdate is modifying a bundle which it shouldn't be permitted to (this is a bug).
2024-02-18 12:37:58 -08:00
CheolHyun Mun 24f0f3952d Update Korean localization (#2504) 2024-02-16 22:03:03 -08:00
Zorg 7e5ebca735 Mention only 10.13 minimum macOS requirement
The last couple years of Xcode releases don't support anything less than 10.13 deployment target.
2024-01-13 08:00:01 -08:00
Zorg 001d6d6a69 Use $PROJECT_DIR instead of $SRCROOT (#2489) 2024-01-13 07:59:15 -08:00
Zorg 9e9830eb0f Update CI runners to use Xcode 15.1 (#2484) 2023-12-28 15:17:11 -05:00
Zorg 615043da2b Audit minimum supported system version in Swift Package.swift (#2483)
Also add Package.swift to the Xcode project so its contents are searchable.
2023-12-28 14:41:08 -05:00
Eitot 485f0e661d Set minimum deployment to macOS 10.13 in Package.swift (#2481) 2023-12-27 14:31:01 -05:00
Zorg f1daff840f Merge branch '2.5.2-dev' into 2.x 2023-12-21 09:29:52 -08:00
Sparkle-Bot 47d3d90aee Update Package management files for version 2.5.2 2023-12-20 04:08:02 +00:00
Zorg 9a29d14b7b Update CHANGELOG for 2.5.2 2023-12-19 19:58:50 -08:00
Zorg 7a7fb9ecd9 Don't clean up update directory when Autoupdate receives SIGTERM (#2479)
Under rare circumstances, if Autoupdate receives SIGTERM while the installer queue is installing an update this could cause potential corruption.
2023-12-19 19:56:25 -08:00
1024jp 4ad2b0d945 Update Japanese localization (#2285) (#2475) 2023-12-19 19:56:06 -08:00
Emir SARI 2afa08405c Improve Turkish translations (#2464)
Updates the strings to be more in-line with the Apple terminology, and
capitalisation. Ambiguities have been found and fixed as well.
2023-12-19 19:55:43 -08:00
Billy Gray ed1bc2fdc8 Update Spanish translation for 'You are currently running version %@.' and 'Version History'. (#2463) 2023-12-19 19:55:17 -08:00
Zorg b84c1b14ce Don't clean up update directory when Autoupdate receives SIGTERM (#2479)
Under rare circumstances, if Autoupdate receives SIGTERM while the installer queue is installing an update this could cause potential corruption.
2023-12-19 19:49:36 -08:00
1024jp 0a92e049eb Update Japanese localization (#2285) (#2475) 2023-12-02 06:57:15 -08:00
Zorg 1a0b023e1c Store private seed as the secret for newly generated keys (#2472)
This improves compatibility when using the seed onto other cryptography libraries.
2023-11-23 09:23:10 -05:00
Zorg 1e419c8c16 Improve signing error message to developers (#2471)
If we detect the wrong archive is being served (i.e, expected content length differs from archive length) we log this out to developers. If the app version in the archive (if available) also differs, we report this discrepancy as well. If the update archive looks the same but signing validation fails, we tell the developer the update may have not been signed correctly.

I'm not changing the generic error that is reported to users about the update being improperly signed (that would involve propagating this information there and updating bunch of localizations). The extra info is more for the developer than it is for the user.

Fixes #2468
2023-11-18 16:04:44 -08:00
Emir SARI ac6c897dd5 Improve Turkish translations (#2464)
Updates the strings to be more in-line with the Apple terminology, and
capitalisation. Ambiguities have been found and fixed as well.
2023-11-10 05:32:09 -08:00
Billy Gray 5a708be2a5 Update Spanish translation for 'You are currently running version %@.' and 'Version History'. (#2463) 2023-10-31 17:54:14 -07:00
Zorg 82209831c0 Update GitHub checkout action for create-draft-release (#2457) 2023-10-16 21:14:57 -07:00
Zorg 70a9ad52ae Fix false positive analyzer warning about resumableUpdate type (#2454) 2023-10-16 20:31:32 -07:00
Jozef Izso a00fd1d323 Update GHA libraries to use modern NodeJS runtime (#2451)
* Update `actions/checkout` and `actions/upload-artifact`

This removes the warning about the deprecated `node12` runtime used by existing actions.

* Update `mshick/add-pr-comment`

The v2 action uses `node16` runtime
Workflow will use the `GITHUB_TOKEN` with `pull-requests: write` permission instead of PAT
2023-10-15 20:19:37 -07:00
Sparkle-Bot 1f07f4096e Update Package management files for version 2.5.1 2023-10-15 23:57:08 +00:00
Zorg 679d3568c2 Update CHANGELOG for 2.5.1 2023-10-15 16:37:29 -07:00
97 changed files with 1176 additions and 490 deletions

No files matched your search

+15 -14
View File
@@ -10,25 +10,28 @@ jobs:
build:
strategy:
matrix:
xcode: ['xcode14.3.1', 'xcode15']
xcode: ['xcode14.3.1', 'xcode15.2']
include:
- xcode: 'xcode15'
xcode-path: '/Applications/Xcode_15.0.app/Contents/Developer'
upload-dist: false
- xcode: 'xcode15.2'
xcode-path: '/Applications/Xcode_15.2.app/Contents/Developer'
upload-dist: true
run-analyzer: true
macos: 'macos-13'
- xcode: 'xcode14.3.1'
xcode-path: '/Applications/Xcode_14.3.1.app/Contents/Developer'
upload-dist: true
upload-dist: false
run-analyzer: false
macos: 'macos-13'
name: Build and Test Sparkle
runs-on: ${{ matrix.macos }}
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
@@ -58,7 +61,7 @@ jobs:
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
xcodebuild analyze -project Sparkle.xcodeproj -quiet -scheme Sparkle -configuration Release -derivedDataPath analyze > anaylze_output.txt
xcodebuild analyze -project Sparkle.xcodeproj -quiet -scheme Sparkle -configuration Release -derivedDataPath analyze > analyze_output.txt
- name: Find Analyzed Warnings
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }}
@@ -66,7 +69,7 @@ jobs:
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
if grep -q "warning:" anaylze_output.txt; then
if grep -q "warning:" analyze_output.txt; then
echo '::set-output name=analyzestatus::0'
else
echo '::set-output name=analyzestatus::1'
@@ -76,15 +79,13 @@ jobs:
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }}
id: warnings
run: |
echo ::set-output name=content::$(cat anaylze_output.txt)
echo ::set-output name=content::$(cat analyze_output.txt)
- name: Post Analyzed Warnings
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }}
uses: mshick/add-pr-comment@v1
uses: mshick/add-pr-comment@v2
with:
allow-repeats: false
repo-token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
repo-token-user-login: 'Sparkle-Bot'
message: "``` ${{ steps.warnings.outputs.content }} ```"
- name: Build Release Distribution
@@ -94,13 +95,13 @@ jobs:
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
- name: Archive Test Results
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: build-logs
path: build/Logs
- name: Upload Distribution
if: ${{ success() && matrix.upload-dist }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz
path: build/Build/Products/Release/sparkle-dist.tar.xz
+2 -2
View File
@@ -2,7 +2,7 @@ name: "Create Draft Release"
env:
BUILDDIR: "build"
DEVELOPER_DIR: "/Applications/Xcode_14.3.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_15.2.app/Contents/Developer"
on:
workflow_dispatch:
@@ -33,7 +33,7 @@ jobs:
steps:
- name: "Checkout sources"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
submodules: true
+28 -6
View File
@@ -27,6 +27,7 @@
#import "SPUInstallerAgentProtocol.h"
#import "SPUInstallationType.h"
#import "SPULocalCacheDirectory.h"
#import "SPUVerifierInformation.h"
#include "AppKitPrevention.h"
@@ -58,11 +59,13 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
NSString *_userName;
SUHost *_host;
NSString *_updateDirectoryPath;
NSString *_extractionDirectory;
NSString *_downloadName;
NSString *_decryptionPassword;
SUSignatures *_signatures;
NSString *_relaunchPath;
NSString *_installationType;
SPUVerifierInformation *_verifierInformation;
id<SUInstallerProtocol> _installer;
@@ -170,7 +173,8 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
[_communicator handleMessageWithIdentifier:SPUExtractionStarted data:[NSData data]];
NSString *archivePath = [_updateDirectoryPath stringByAppendingPathComponent:_downloadName];
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath updatingHostBundlePath:_host.bundlePath decryptionPassword:_decryptionPassword expectingInstallationType:_installationType];
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath extractionDirectory:_extractionDirectory updatingHostBundlePath:_host.bundlePath decryptionPassword:_decryptionPassword expectingInstallationType:_installationType];
NSError *unarchiverError = nil;
BOOL success = NO;
@@ -179,7 +183,15 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
success = NO;
} else {
_updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:archivePath signatures:_signatures host:_host];
NSError *fileAttributesError = nil;
NSDictionary<NSFileAttributeKey, id> *archiveFileAttributes = [NSFileManager.defaultManager attributesOfItemAtPath:archivePath error:&fileAttributesError];
if (archiveFileAttributes == nil) {
SULog(SULogLevelError, @"Failed to retrieve file attributes from archive: %@.", fileAttributesError);
} else {
_verifierInformation.actualContentLength = (uint64_t)(archiveFileAttributes.fileSize);
}
_updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:archivePath signatures:_signatures host:_host verifierInformation:_verifierInformation];
// Delta & package updates will require validation before extraction
// Normal application updates are a bit more lenient allowing developers to change one of apple dev ID or EdDSA keys
@@ -203,7 +215,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
[self->_communicator handleMessageWithIdentifier:SPUValidationStarted data:[NSData data]];
NSError *validationError = nil;
BOOL validationSuccess = [self->_updateValidator validateWithUpdateDirectory:self->_updateDirectoryPath error:&validationError];
BOOL validationSuccess = [self->_updateValidator validateWithUpdateDirectory:self->_extractionDirectory error:&validationError];
if (!validationSuccess) {
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Update validation was a failure", NSUnderlyingErrorKey: validationError }]];
@@ -253,6 +265,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
// but may as well set other fields to nil too
[self clearUpdateDirectory];
_downloadName = nil;
_extractionDirectory = nil;
_decryptionPassword = nil;
_signatures = nil;
_relaunchPath = nil;
@@ -315,7 +328,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (!receivedResponse) {
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Timeout error: failed to retreive process identifier from agent" }]];
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Timeout error: failed to retrieve process identifier from agent" }]];
}
});
}
@@ -443,14 +456,23 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
return;
}
// Carry these properities separately rather than using the SUInstallationInputData object
NSString *extractionDirectory = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:cacheInstallationPath];
if (extractionDirectory == nil) {
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Failed to create installation extraction directory in %@", cacheInstallationPath] }]];
return;
}
// Carry these properties separately rather than using the SUInstallationInputData object
// Some of our properties may slightly differ than our input and we don't want to make the mistake of using one of those
self->_installationType = installationType;
self->_relaunchPath = installationData.relaunchPath;
self->_downloadName = downloadName;
self->_signatures = installationData.signatures;
self->_updateDirectoryPath = cacheInstallationPath;
self->_extractionDirectory = extractionDirectory;
self->_host = [[SUHost alloc] initWithBundle:hostBundle];
self->_verifierInformation = [[SPUVerifierInformation alloc] initWithExpectedVersion:installationData.expectedVersion expectedContentLength:installationData.expectedContentLength];
[self extractAndInstallUpdate];
});
@@ -510,7 +532,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
dispatch_async(_installerQueue, ^{
NSError *installerError = nil;
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self->_host expectedInstallationType:self->_installationType updateDirectory:self->_updateDirectoryPath homeDirectory:self->_homeDirectory userName:self->_userName error:&installerError];
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self->_host expectedInstallationType:self->_installationType updateDirectory:self->_extractionDirectory homeDirectory:self->_homeDirectory userName:self->_userName error:&installerError];
if (installer == nil) {
dispatch_async(dispatch_get_main_queue(), ^{
+1 -1
View File
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
SPU_OBJC_DIRECT_MEMBERS @interface SPUInstallationInfo : NSObject <NSSecureCoding>
- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem canSilentlyInstall:(BOOL)canSilentyInstall;
- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem canSilentlyInstall:(BOOL)canSilentlyInstall;
@property (nonatomic, readonly) SUAppcastItem *appcastItem;
@property (nonatomic, readonly) BOOL canSilentlyInstall;
+5 -1
View File
@@ -21,8 +21,10 @@ SPU_OBJC_DIRECT_MEMBERS @interface SPUInstallationInputData : NSObject <NSSecure
* downloadName - name of update archive in update directory
* signatures - signatures for the update that came from the appcast item
* decryptionPassword - optional decryption password for dmg archives
* expectedVersion - optional expected version of the new update
* expectedContentLength - optional expected content length of the new download archive
*/
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword;
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword expectedVersion:(NSString *)expectedVersion expectedContentLength:(uint64_t)expectedContentLength;
@property (nonatomic, copy, readonly) NSString *relaunchPath;
@property (nonatomic, copy, readonly) NSString *hostBundlePath;
@@ -30,6 +32,8 @@ SPU_OBJC_DIRECT_MEMBERS @interface SPUInstallationInputData : NSObject <NSSecure
@property (nonatomic, copy, readonly) NSString *installationType;
@property (nonatomic, readonly, nullable) SUSignatures *signatures; // nullable because although not using signatures is deprecated, it's still supported
@property (nonatomic, copy, readonly, nullable) NSString *decryptionPassword;
@property (nonatomic, copy, readonly, nullable) NSString *expectedVersion;
@property (nonatomic, readonly) uint64_t expectedContentLength;
@end
+16 -2
View File
@@ -18,6 +18,8 @@ static NSString *SUUpdateURLBookmarkDataKey = @"SUUpdateURLBookmarkData";
static NSString *SUSignaturesKey = @"SUSignatures";
static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword";
static NSString *SUInstallationTypeKey = @"SUInstallationType";
static NSString *SUExpectedVersionKey = @"SUExpectedVersion";
static NSString *SUExpectedContentLength = @"SUExpectedContentLength";
@implementation SPUInstallationInputData
@@ -27,8 +29,10 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
@synthesize signatures = _signatures;
@synthesize decryptionPassword = _decryptionPassword;
@synthesize installationType = _installationType;
@synthesize expectedVersion = _expectedVersion;
@synthesize expectedContentLength = _expectedContentLength;
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateURLBookmarkData:(NSData *)updateURLBookmarkData installationType:(NSString *)installationType signatures:(SUSignatures * _Nullable)signatures decryptionPassword:(nullable NSString *)decryptionPassword expectedVersion:(nonnull NSString *)expectedVersion expectedContentLength:(uint64_t)expectedContentLength
{
self = [super init];
if (self != nil) {
@@ -41,6 +45,9 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
_signatures = signatures;
_decryptionPassword = [decryptionPassword copy];
_expectedVersion = [expectedVersion copy];
_expectedContentLength = expectedContentLength;
}
return self;
}
@@ -74,7 +81,10 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
NSString *decryptionPassword = [decoder decodeObjectOfClass:[NSString class] forKey:SUDecryptionPasswordKey];
return [self initWithRelaunchPath:relaunchPath hostBundlePath:hostBundlePath updateURLBookmarkData:updateURLBookmarkData installationType:installationType signatures:signatures decryptionPassword:decryptionPassword];
NSString *expectedVersion = [decoder decodeObjectOfClass:[NSString class] forKey:SUExpectedVersionKey];
uint64_t expectedContentLength = (uint64_t)[decoder decodeInt64ForKey:SUExpectedContentLength];
return [self initWithRelaunchPath:relaunchPath hostBundlePath:hostBundlePath updateURLBookmarkData:updateURLBookmarkData installationType:installationType signatures:signatures decryptionPassword:decryptionPassword expectedVersion:expectedVersion expectedContentLength:expectedContentLength];
}
- (void)encodeWithCoder:(NSCoder *)coder
@@ -87,6 +97,10 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
if (_decryptionPassword != nil) {
[coder encodeObject:_decryptionPassword forKey:SUDecryptionPasswordKey];
}
if (_expectedVersion != nil) {
[coder encodeObject:_expectedVersion forKey:SUExpectedVersionKey];
}
[coder encodeInt64:(int64_t)_expectedContentLength forKey:SUExpectedContentLength];
}
+ (BOOL)supportsSecureCoding
+3 -3
View File
@@ -103,7 +103,7 @@ extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
NSString *patchFile = _patchFile;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// Sparkle's XAR delta archives have been superceded by Sparkle's own format
// Sparkle's XAR delta archives have been superseded by Sparkle's own format
xar_t x = xar_open(patchFile.fileSystemRepresentation, READ);
#pragma clang diagnostic pop
if (x == NULL) {
@@ -176,7 +176,7 @@ extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// Sparkle's XAR delta archives have been superceded by Sparkle's own format
// Sparkle's XAR delta archives have been superseded by Sparkle's own format
xar_t x = xar_open(patchFile.fileSystemRepresentation, WRITE);
#pragma clang diagnostic pop
if (x == NULL) {
@@ -246,7 +246,7 @@ static xar_file_t _xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTa
// We store every file we add into a fileTable for easy referencing
// Note if a diff has Contents/Resources/foo/ and Contents/Resources/foo/bar.txt,
// due to sorting order we will add the foo directory first and won't end up with
// mis-ordering bugs
// misordering bugs
xar_file_t lastParent = NULL;
for (NSUInteger componentIndex = 0; componentIndex < relativePathComponentsCount; componentIndex++) {
NSArray<NSString *> *subpathComponents = [relativePathComponents subarrayWithRange:NSMakeRange(0, componentIndex + 1)];
+1 -1
View File
@@ -291,7 +291,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
// Remove the file non-writable we're patching that may cause issues
[fileManager removeItemAtPath:destinationFilePath error:NULL];
// We will need to preserve permissons if there is no need to make permission changes later on
// We will need to preserve permissions if there is no need to make permission changes later on
needsToCopyFilePermissions = (commands & SPUDeltaItemCommandModifyPermissions) == 0;
} else {
needsToCopyFilePermissions = ((commands & SPUDeltaItemCommandClone) != 0) && ((commands & SPUDeltaItemCommandModifyPermissions) == 0);
+1 -1
View File
@@ -750,7 +750,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
return originalTreeState[key1] ? NSOrderedAscending : NSOrderedDescending;
}];
// Using a couple of heursitics we track if files have been moved to other locations within the app bundle
// Using a couple of heuristics we track if files have been moved to other locations within the app bundle
NSMutableDictionary<NSString *, NSString *> *frameworkVersionsSubstitutes = [NSMutableDictionary dictionary];
NSMutableDictionary<NSString *, NSString *> *fileSubstitutes = [NSMutableDictionary dictionary];
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion3)) {
+1 -1
View File
@@ -19,7 +19,7 @@ SPU_OBJC_DIRECT_MEMBERS
#endif
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath;
+ (BOOL)canUnarchivePath:(NSString *)path;
+4 -2
View File
@@ -20,6 +20,7 @@
{
NSString *_archivePath;
NSString *_updateHostBundlePath;
NSString *_extractionDirectory;
}
+ (BOOL)canUnarchivePath:(NSString *)path
@@ -71,12 +72,13 @@ SPU_OBJC_DIRECT
}
}
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_updateHostBundlePath = [updateHostBundlePath copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -94,7 +96,7 @@ SPU_OBJC_DIRECT
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
{
NSString *sourcePath = _updateHostBundlePath;
NSString *targetPath = [[_archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
NSString *targetPath = [_extractionDirectory stringByAppendingPathComponent:[sourcePath lastPathComponent]];
NSError *applyDiffError = nil;
BOOL success = applyBinaryDelta(sourcePath, targetPath, _archivePath, NO, ^(double progress){
+7
View File
@@ -11,6 +11,8 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#ifndef BUILDING_SPARKLE_TESTS
SPU_OBJC_DIRECT_MEMBERS
#endif
@@ -24,6 +26,11 @@ SPU_OBJC_DIRECT_MEMBERS
+ (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundleURL error:(NSError *__autoreleasing *)error;
+ (BOOL)bundleAtURLIsCodeSigned:(NSURL *)bundleURL;
+ (NSString * _Nullable)teamIdentifierAtURL:(NSURL *)url;
@end
NS_ASSUME_NONNULL_END
#endif
+25 -1
View File
@@ -61,7 +61,7 @@
// Note that kSecCSCheckNestedCode may not work with pre-Mavericks code signing.
// See https://github.com/sparkle-project/Sparkle/issues/376#issuecomment-48824267 and https://developer.apple.com/library/mac/technotes/tn2206
// Aditionally, there are several reasons to stay away from deep verification and to prefer EdDSA signing the download archive instead.
// Additionally, there are several reasons to stay away from deep verification and to prefer EdDSA signing the download archive instead.
// See https://github.com/sparkle-project/Sparkle/pull/523#commitcomment-17549302 and https://github.com/sparkle-project/Sparkle/issues/543
SecCSFlags flags = (SecCSFlags) (kSecCSDefaultFlags | kSecCSCheckAllArchitectures);
result = SecStaticCodeCheckValidityWithErrors(staticCode, flags, requirement, &cfError);
@@ -258,4 +258,28 @@ static id valueOrNSNull(id value) {
return (result == 0);
}
+ (NSString * _Nullable)teamIdentifierAtURL:(NSURL *)url
{
SecStaticCodeRef staticCode = NULL;
OSStatus staticCodeResult = SecStaticCodeCreateWithPath((__bridge CFURLRef)url, kSecCSDefaultFlags, &staticCode);
if (staticCodeResult != noErr) {
SULog(SULogLevelError, @"Failed to get static code for retrieving team identifier: %d", staticCodeResult);
return nil;
}
CFDictionaryRef cfSigningInformation = NULL;
OSStatus copySigningInfoCode = SecCodeCopySigningInformation(staticCode, kSecCSSigningInformation,
&cfSigningInformation);
NSDictionary *signingInformation = CFBridgingRelease(cfSigningInformation);
if (copySigningInfoCode != noErr) {
SULog(SULogLevelError, @"Failed to get signing information for retrieving team identifier: %d", copySigningInfoCode);
return nil;
}
// Note this will return nil for ad-hoc or unsigned binaries
return signingInformation[(NSString *)kSecCodeInfoTeamIdentifier];
}
@end
+1 -1
View File
@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
SPU_OBJC_DIRECT_MEMBERS @interface SUDiskImageUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword;
+ (BOOL)canUnarchivePath:(NSString *)path;
+4 -2
View File
@@ -19,6 +19,7 @@
{
NSString *_archivePath;
NSString *_decryptionPassword;
NSString *_extractionDirectory;
}
+ (BOOL)canUnarchivePath:(NSString *)path
@@ -31,12 +32,13 @@
return NO;
}
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_decryptionPassword = [decryptionPassword copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -171,7 +173,7 @@
for (NSString *item in contents)
{
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
NSString *toPath = [[_archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
NSString *toPath = [_extractionDirectory stringByAppendingPathComponent:item];
itemsCopied += 1.0;
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
// An unarchiver for flat packages that doesn't really do any unarchiving
SPU_OBJC_DIRECT_MEMBERS @interface SUFlatPackageUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType;
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType;
+ (BOOL)canUnarchivePath:(NSString *)path;
+17 -3
View File
@@ -20,6 +20,7 @@
{
NSString *_flatPackagePath;
NSString *_expectedInstallationType;
NSString *_extractionDirectory;
}
+ (BOOL)canUnarchivePath:(NSString *)path
@@ -32,12 +33,13 @@
return YES;
}
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType
{
self = [super init];
if (self != nil) {
_flatPackagePath = [flatPackagePath copy];
_expectedInstallationType = [installationType copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -53,8 +55,20 @@
} else if (![[NSFileManager defaultManager] fileExistsAtPath:_flatPackagePath isDirectory:&isDirectory] || isDirectory) {
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package does not exist at %@", _flatPackagePath]}]];
} else {
[notifier notifyProgress:1.0];
[notifier notifySuccess];
// Copying the flat package should be very fast, especially on APFS
NSError *copyError = nil;
if (![[NSFileManager defaultManager] copyItemAtPath:_flatPackagePath toPath:[_extractionDirectory stringByAppendingPathComponent:_flatPackagePath.lastPathComponent] error:&copyError]) {
NSMutableDictionary *userInfoDictionary = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package (%@) cannot be copied to extraction directory (%@)", _flatPackagePath, _extractionDirectory]}];
if (copyError != nil) {
userInfoDictionary[NSUnderlyingErrorKey] = copyError;
}
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:userInfoDictionary]];
} else {
[notifier notifyProgress:1.0];
[notifier notifySuccess];
}
}
}
+28 -13
View File
@@ -22,15 +22,6 @@
@implementation SUInstaller
+ (BOOL)isAliasFolderAtPath:(NSString *)path SPU_OBJC_DIRECT
{
NSNumber *aliasFlag = nil;
[[NSURL fileURLWithPath:path] getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:nil];
NSNumber *directoryFlag = nil;
[[NSURL fileURLWithPath:path] getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:nil];
return aliasFlag.boolValue && directoryFlag.boolValue;
}
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host
#if SPARKLE_BUILD_PACKAGE_SUPPORT
isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr
@@ -55,6 +46,34 @@
while ((currentFile = [dirEnum nextObject])) {
NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
// Ignore all symbolic links and aliases
{
NSURL *currentPathURL = [NSURL fileURLWithPath:currentPath];
NSNumber *symbolicLinkFlag = nil;
[currentPathURL getResourceValue:&symbolicLinkFlag forKey:NSURLIsSymbolicLinkKey error:NULL];
if (symbolicLinkFlag.boolValue) {
// NSDirectoryEnumerator won't recurse into symlinked directories
continue;
}
NSNumber *aliasFlag = nil;
[currentPathURL getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:NULL];
if (aliasFlag.boolValue) {
NSNumber *directoryFlag = nil;
[currentPathURL getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:NULL];
// Some DMGs have symlinks into /Applications! That's no good!
if (directoryFlag.boolValue) {
[dirEnum skipDescendents];
}
continue;
}
}
NSString *currentFilename = [currentFile lastPathComponent];
#if SPARKLE_BUILD_PACKAGE_SUPPORT
NSString *currentExtension = [currentFile pathExtension];
@@ -92,10 +111,6 @@
break;
}
}
// Some DMGs have symlinks into /Applications! That's no good!
if ([self isAliasFolderAtPath:currentPath])
[dirEnum skipDescendents];
}
#if SPARKLE_BUILD_PACKAGE_SUPPORT
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
SPU_OBJC_DIRECT_MEMBERS @interface SUPipedUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory;
+ (BOOL)canUnarchivePath:(NSString *)path;
+4 -2
View File
@@ -17,6 +17,7 @@
@implementation SUPipedUnarchiver
{
NSString *_archivePath;
NSString *_extractionDirectory;
}
static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPath(NSString *path)
@@ -59,11 +60,12 @@ static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPa
return NO;
}
- (instancetype)initWithArchivePath:(NSString *)archivePath
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -89,7 +91,7 @@ static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPa
{
// *** GETS CALLED ON NON-MAIN THREAD!!!
@autoreleasepool {
NSString *destination = [_archivePath stringByDeletingLastPathComponent];
NSString *destination = _extractionDirectory;
SULog(SULogLevelDefault, @"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], _archivePath, destination);
+63 -5
View File
@@ -14,6 +14,7 @@
#import "SUErrors.h"
#import "SUVersionComparisonProtocol.h"
#import "SUStandardVersionComparator.h"
#import "SUCodeSigningVerifier.h"
#include "AppKitPrevention.h"
@@ -28,6 +29,7 @@
NSURL *_temporaryNewDirectory;
BOOL _newAndOldBundlesOnSameVolume;
BOOL _canPerformSafeAtomicSwap;
}
- (instancetype)initWithHost:(SUHost *)host bundlePath:(NSString *)bundlePath installationPath:(NSString *)installationPath
@@ -41,7 +43,7 @@
return self;
}
- (void)_performInitialInstallationWithFileManager:(SUFileManager *)fileManager oldBundleURL:(NSURL *)oldBundleURL newBundleURL:(NSURL *)newBundleURL progressBlock:(nullable void(^)(double))progress SPU_OBJC_DIRECT
- (void)_performInitialInstallationWithFileManager:(SUFileManager *)fileManager oldBundleURL:(NSURL *)oldBundleURL newBundleURL:(NSURL *)newBundleURL performGatekeeperScan:(BOOL)performGatekeeperScan progressBlock:(nullable void(^)(double))progress SPU_OBJC_DIRECT
{
// Release our new app from quarantine
NSError *quarantineError = nil;
@@ -88,6 +90,38 @@
if (progress) {
progress(8/11.0);
}
if (performGatekeeperScan) {
// Perform a Gatekeeper scan to pre-warm the app launch
// This avoids users seeing a "Verifying..." dialog when the installed update is launched
// Note the tool we use to perform the Gatekeeper scan (gktool) is technically available on macOS 14.0,
// however there are some potential bugs/issues with performing a Gatekeeper scan on versions before 14.4:
// https://github.com/sparkle-project/Sparkle/issues/2491
if (@available(macOS 14.4, *)) {
// Only perform Gatekeeper scan if we're updating an app bundle
NSString *newBundlePath = newBundleURL.path;
if ([newBundlePath.pathExtension caseInsensitiveCompare:@"app"] == NSOrderedSame) {
NSURL *gktoolURL = [NSURL fileURLWithPath:@"/usr/bin/gktool" isDirectory:NO];
if ([gktoolURL checkResourceIsReachableAndReturnError:NULL]) {
NSTask *gatekeeperScanTask = [[NSTask alloc] init];
gatekeeperScanTask.executableURL = gktoolURL;
gatekeeperScanTask.arguments = @[@"scan", newBundlePath];
NSError *taskError;
if (![gatekeeperScanTask launchAndReturnError:&taskError]) {
// Not a fatal error
SULog(SULogLevelError, @"Failed to perform GateKeeper scan on '%@' with error %@", newBundlePath, taskError);
} else {
[gatekeeperScanTask waitUntilExit];
if (gatekeeperScanTask.terminationStatus != 0) {
SULog(SULogLevelError, @"gktool failed and returned exit status %d", gatekeeperScanTask.terminationStatus);
}
}
}
}
}
}
}
@@ -189,7 +223,9 @@
}
if (!_newAndOldBundlesOnSameVolume) {
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:oldURL newBundleURL:newFinalURL progressBlock:progress];
// If we're updating a bundle on another volume, the install process can be pretty slow.
// In this case let's get out of the way and skip the Gatekeeper scan
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:oldURL newBundleURL:newFinalURL performGatekeeperScan:NO progressBlock:progress];
}
if (progress) {
@@ -199,8 +235,8 @@
// First try swapping the application atomically
NSError *swapError = nil;
BOOL swappedApp;
// If the app is normalized and the installation path differs, go through the old swap path
if (SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME && ![oldURL.path isEqual:installationURL.path]) {
// If we can not safely perform an atomic swap, or if the app is normalized and the installation path differs, go through the old swap path
if (!_canPerformSafeAtomicSwap || (SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME && ![oldURL.path isEqual:installationURL.path])) {
swappedApp = NO;
} else {
// We will be cleaning up the temporary directory later in -performCleanup:
@@ -308,11 +344,33 @@
SUFileManager *fileManager = [[SUFileManager alloc] init];
if (@available(macOS 13.0, *)) {
NSURL *mainExecutableURL = NSBundle.mainBundle.executableURL;
if (mainExecutableURL == nil) {
// This shouldn't happen
_canPerformSafeAtomicSwap = NO;
} else {
NSString *installerTeamIdentifier = [SUCodeSigningVerifier teamIdentifierAtURL:mainExecutableURL];
NSString *bundleTeamIdentifier = [SUCodeSigningVerifier teamIdentifierAtURL:bundle.bundleURL];
// If the new update is code signed and Autoupdate is not signed with the same Team ID as the new update,
// then we may run into Privacy & Security prompt issues from the OS
// To avoid these, we skip the gatekeeper scan and skip performing an atomic swap during install
_canPerformSafeAtomicSwap = (bundleTeamIdentifier == nil || (installerTeamIdentifier != nil && [installerTeamIdentifier isEqualToString:bundleTeamIdentifier]));
}
} else {
_canPerformSafeAtomicSwap = YES;
}
if (!_canPerformSafeAtomicSwap) {
SULog(SULogLevelDefault, @"Skipping atomic rename/swap and gatekeeper scan because Autoupdate is not signed with same identity as the new update %@", bundle.bundleURL.lastPathComponent);
}
_newAndOldBundlesOnSameVolume = [fileManager itemAtURL:bundle.bundleURL isOnSameVolumeItemAsURL:_host.bundle.bundleURL];
// We can do a lot of the installation work ahead of time if the new app update does not need to be copied to another volume
if (_newAndOldBundlesOnSameVolume) {
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:_host.bundle.bundleURL newBundleURL:bundle.bundleURL progressBlock:NULL];
[self _performInitialInstallationWithFileManager:fileManager oldBundleURL:_host.bundle.bundleURL newBundleURL:bundle.bundleURL performGatekeeperScan:_canPerformSafeAtomicSwap progressBlock:NULL];
}
return YES;
+9 -2
View File
@@ -18,15 +18,22 @@
#import <Foundation/Foundation.h>
@class SUSignatures;
@class SUPublicKeys;
@class SPUVerifierInformation;
NS_ASSUME_NONNULL_BEGIN
SPU_OBJC_DIRECT_MEMBERS @interface SUSignatureVerifier : NSObject
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys error:(NSError * __autoreleasing *)error;
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithPublicKeys:(SUPublicKeys *)pkeys;
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures error:(NSError * __autoreleasing *)error;
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error;
@end
NS_ASSUME_NONNULL_END
#endif
+29 -5
View File
@@ -16,6 +16,8 @@
#import "SULog.h"
#import "SUSignatures.h"
#import "SUErrors.h"
#import "SPUVerifierInformation.h"
#import "SUConstants.h"
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
#include <CommonCrypto/CommonDigest.h>
#endif
@@ -29,7 +31,7 @@
SUPublicKeys *_pubKeys;
}
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys error:(NSError * __autoreleasing *)error
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error
{
SUSignatureVerifier *verifier = [(SUSignatureVerifier *)[self alloc] initWithPublicKeys:pkeys];
@@ -40,7 +42,7 @@
return NO;
}
return [verifier verifyFileAtPath:path signatures:signatures error:error];
return [verifier verifyFileAtPath:path signatures:signatures verifierInformation:verifierInformation error:error];
}
- (instancetype)initWithPublicKeys:(SUPublicKeys *)pubkeys
@@ -90,7 +92,7 @@
}
#endif
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures error:(NSError * __autoreleasing *)error
- (BOOL)verifyFileAtPath:(NSString *)path signatures:(SUSignatures *)signatures verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error
{
if (!path || !path.length) {
if (error != NULL) {
@@ -176,9 +178,31 @@
return YES;
}
} else {
NSString *message = @"EdDSA signature does not match. Data of the update file being checked is different than data that has been signed, or the public key and the private key are not from the same set.";
NSMutableString *message = [NSMutableString stringWithString:@"EdDSA signature does not match. Data of the update file being checked is different than data that has been signed, or the public key and the private key are not from the same set."];
SULog(SULogLevelError, @"%@", message);
// Elaborate on the error message if we have more information about the download archive
if (verifierInformation != nil) {
BOOL reportedDiscrepancy = NO;
if (verifierInformation.expectedContentLength > 0 && verifierInformation.actualContentLength > 0) {
if (verifierInformation.expectedContentLength != verifierInformation.actualContentLength) {
[message appendFormat:@" The downloaded update (%@) is likely different than the signed archive because the expected content length from the appcast item (%llu bytes) differs from the downloaded archive length (%llu bytes).", path.lastPathComponent, verifierInformation.expectedContentLength, verifierInformation.actualContentLength];
reportedDiscrepancy = YES;
}
}
NSString *actualVersion = verifierInformation.actualVersion;
if (actualVersion != nil && ![verifierInformation.expectedVersion isEqualToString:actualVersion]) {
[message appendFormat:@" The downloaded update (%@) also has a CFBundleVersion (%@) which differs from the %@ in the appcast item (%@).", path.lastPathComponent, actualVersion, SUAppcastAttributeVersion, verifierInformation.expectedVersion];
reportedDiscrepancy = YES;
}
if (!reportedDiscrepancy && verifierInformation.expectedContentLength > 0) {
[message appendFormat:@" The downloaded update (%@) is likely not signed correctly because the archive has the expected content length (%llu bytes)%@ which matches the appcast item.", path.lastPathComponent, verifierInformation.actualContentLength, (actualVersion == nil ? @"" : [NSString stringWithFormat:@" and CFBundleVersion (%@)", actualVersion])];
}
}
SULog(SULogLevelError, @"%@", [message copy]);
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
if (signatures.dsaSignatureStatus != SUSigningInputStatusAbsent) {
+1 -1
View File
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
SPU_OBJC_DIRECT_MEMBERS @interface SUUnarchiver : NSObject
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
@end
+5 -7
View File
@@ -18,27 +18,25 @@
@implementation SUUnarchiver
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
{
if ([SUPipedUnarchiver canUnarchivePath:path]) {
return [[SUPipedUnarchiver alloc] initWithArchivePath:path];
return [[SUPipedUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory];
}
#if SPARKLE_BUILD_DMG_SUPPORT
else if ([SUDiskImageUnarchiver canUnarchivePath:path]) {
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path decryptionPassword:decryptionPassword];
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory decryptionPassword:decryptionPassword];
}
#endif
else if ([SUBinaryDeltaUnarchiver canUnarchivePath:path]) {
assert(hostPath != nil);
NSString *nonNullHostPath = hostPath;
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory updateHostBundlePath:nonNullHostPath];
}
#if SPARKLE_BUILD_PACKAGE_SUPPORT
else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
// Flat packages are only supported for guided packaage installs
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path expectingInstallationType:installationType];
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path extractionDirectory:extractionDirectory expectingInstallationType:installationType];
}
#endif
return nil;
+5 -1
View File
@@ -28,7 +28,11 @@ int main(int __unused argc, const char __unused *argv[])
dispatch_source_t sigtermSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue());
dispatch_source_set_event_handler(sigtermSource, ^{
[appInstaller cleanupAndExitWithStatus:SIGTERM error:nil];
// Don't clear the update directory because the installer may be in middle of installing an update
// We still need to set an event handler for receiving SIGTERM though, otherwise our job may not terminate
// (This is also recommended from the developer documentation).
// Simply exit with SIGTERM if we receive this signal
exit(SIGTERM);
});
dispatch_resume(sigtermSource);
+38 -2
View File
@@ -1,3 +1,39 @@
# 2.6.1
* Extract archives in a separate directory from the input archive (#2550) (Zorg)
* Fix the release notes WebKit view not updating background when transitioning from light to dark mode (#2542) (Zorg)
* Add NN (Norwegian Nynorsk) locale (#2532) (Sjur N Moshagen, Zorg)
* Create tar.xz files with built-in tar and remove bzip2 fallback for creating a release distribution (#2535) (Zorg)
* Add fallback in case SULocalizedStringFromTableInBundle() fails (#2533) (Zorg)
* Remove assert on download response being available fixing rare crash (#2547) (Zorg)
* Clarify when authoriation prompt may show in SPUUserDriver documentation (#2531, #2534) (Zorg)
* Fix typos in codebase (#2537) (Viktor Szépe)
# 2.6.0
* Perform Gatekeeper scan to pre-warm app launch (#2505) (Zorg)
* Disable sandboxing for the Downloader XPC service by default to fix downloader prompt warnings (#2511) (Zorg)
* Store private seed as the secret for newly generated keys (#2472) (Zorg)
* Improve signing error message to developers if they serve the wrong update file (#2471) (Zorg)
* Prevent app modification warnings from external updaters (like sparkli-cli) by improving installation (#2516) (Zorg)
* Update Korean localization (#2504) (CheolHyun Mun)
* Use $PROJECT_DIR instead of $SRCROOT (#2489) (Zorg)
* Set Package.swift minimum deployment to macOS 10.13 (#2481) (Eitot)
* Fix false positive analyzer warning about resumableUpdate type (#2454) (Zorg)
# 2.5.2
* Don't clean up update directory when Autoupdate receives SIGTERM (#2479) (Zorg)
* Update Japanese localization (#2475) (1024jp)
* Improve Turkish translations (#2464) (Emir SARI)
* Update Spanish translation for 'You are currently running version %@.' and 'Version History' (#2463) (Billy Gray)
# 2.5.1
* Default to English for XML nodes when no xml:lang is present (#2440) (Zorg)
* Filter for archive files in generate_appcast more intelligently (#2448) (Zorg)
* Use correct entitlements and dsym files when using custom bundle id and XPC names in ConfigCommon (#2446) (floorish)
# 2.5.0
* Add ability to adapt release notes based on the currently installed version (#2373) (Nathan Manceaux-Panot)
@@ -375,7 +411,7 @@ If you are migrating from earlier beta versions of Sparkle 2 and use sandboxing,
# 1.20.0
* `generate_appcast` option to read private key directly from the keychain (Tamás Lustyik)
* Add delegate callbacks for fininshed download and extraction related events (Csaba Horony)
* Add delegate callbacks for finished download and extraction related events (Csaba Horony)
* Don't check for updates if Do Not Disturb is on (Kornel)
* Expose `CodesigningVerifier`, add codesign info API (sunuslee)
* Threading fixes:
@@ -725,7 +761,7 @@ Important security fixes:
* All the user defaults keys are now private; instead, SUUpdater is KVC-compliant for automaticallyChecksForUpdates, updateCheckInterval, and feedURL.
* Reduced the size of the English-only framework by 25%.
* System profiling information is now only submitted to the server once per week; this will help normalize your statistics across users with different interval preferences.
* The feedParamatersForUpdater: delegate method now requires "displayKey" and "displayVersion" keys so that it can inform the user what's being sent.
* The feedParametersForUpdater: delegate method now requires "displayKey" and "displayVersion" keys so that it can inform the user what's being sent.
* Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
* Added support for xml:lang to pick localized nodes in appcasts (for release notes, etc).
* Fixed a bug which would cause the "checking for updates" window to not disappear in certain extraordinary error conditions.
+1 -1
View File
@@ -1 +1 @@
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "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", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.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", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "2.5.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.1/Sparkle-2.5.1.tar.xz", "2.5.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz", "2.6.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.1/Sparkle-2.6.0-beta.1.tar.xz", "2.6.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.2/Sparkle-2.6.0-beta.2.tar.xz", "2.6.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0/Sparkle-2.6.0.tar.xz", "2.6.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.1/Sparkle-2.6.1.tar.xz"}
+12 -5
View File
@@ -76,7 +76,14 @@ XPC_SERVICE_BUNDLE_ID_PREFIX = org.sparkle-project
INSTALLER_CONNECTION_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.InstallerConnection
INSTALLER_STATUS_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.InstallerStatus
INSTALLER_LAUNCHER_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.InstallerLauncher
DOWNLOADER_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.Downloader
DOWNLOADER_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.DownloaderService
// The Downloader XPC Service is not sandboxed by default.
// Uncomment line to enable Sandboxing for this service.
// If this is done, you *must* set a custom XPC_SERVICE_BUNDLE_ID_PREFIX for your app above.
// Otherwise sandboxed apps that use the same sandboxed Downloader Service may conflict with each other.
//DOWNLOADER_SANDBOXED_ENTITLEMENTS = Downloader/Downloader.entitlements
// If your app file on disk is named "MyApp 1.1b4", Sparkle usually updates it
// in place, giving you an app named 1.1b4 that is actually 1.2. Turn the
@@ -91,13 +98,13 @@ SPARKLE_ICON_NAME = AppIcon
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
// These variables must have a space after the '=' too
SPARKLE_VERSION_MAJOR = 2
SPARKLE_VERSION_MINOR = 5
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION_MINOR = 6
SPARKLE_VERSION_PATCH = 1
// This should be in SemVer format or empty, ie. "-beta.1"
// These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX =
CURRENT_PROJECT_VERSION = 2031
CURRENT_PROJECT_VERSION = 2037
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
ALWAYS_SEARCH_USER_PATHS = NO
@@ -162,4 +169,4 @@ GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_UNUSED_VARIABLE = YES
// Turn on all warnings, then disable a few which are almost impossible to avoid
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Werror=undef
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Werror=undef
+1 -1
View File
@@ -4,6 +4,6 @@ INFOPLIST_FILE = Downloader/Info.plist
WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${DOWNLOADER_BUNDLE_ID}
PRODUCT_NAME = ${DOWNLOADER_NAME}
CODE_SIGN_ENTITLEMENTS = Downloader/org.sparkle-project.Downloader.entitlements
CODE_SIGN_ENTITLEMENTS = $(DOWNLOADER_SANDBOXED_ENTITLEMENTS)
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
CLANG_MODULES_AUTOLINK = NO
+18 -44
View File
@@ -34,9 +34,9 @@ if [ "$ACTION" = "" ] ; then
mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/INSTALL" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/INSTALL" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$PROJECT_DIR/CHANGELOG" "$PROJECT_DIR/LICENSE" "$PROJECT_DIR/INSTALL" "$PROJECT_DIR/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp "$PROJECT_DIR/CHANGELOG" "$PROJECT_DIR/LICENSE" "$PROJECT_DIR/INSTALL" "$PROJECT_DIR/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$PROJECT_DIR/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
@@ -45,14 +45,6 @@ if [ "$ACTION" = "" ] ; then
cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.xcframework" "$CONFIGURATION_BUILD_DIR/staging-spm"
if [[ "$SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE" -eq 1 ]]; then
mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Entitlements"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements"
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/Entitlements/$DOWNLOADER_NAME.entitlements"
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements/$DOWNLOADER_NAME.entitlements"
fi
mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Symbols"
@@ -85,31 +77,17 @@ if [ "$ACTION" = "" ] ; then
cd "$CONFIGURATION_BUILD_DIR/staging"
if [ -x "$(command -v xz)" ]; then
XZ_EXISTS=1
else
XZ_EXISTS=0
fi
rm -rf "/tmp/sparkle-extract"
mkdir -p "/tmp/sparkle-extract"
# Sorted file list groups similar files together, which improves tar compression
if [ "$XZ_EXISTS" -eq 1 ] ; then
find . \! -type d | rev | sort | rev | tar cv --files-from=- | xz -9 > "../Sparkle-$MARKETING_VERSION.tar.xz"
find . \! -type d | rev | sort | rev | tar --no-xattrs -cJvf "../Sparkle-$MARKETING_VERSION.tar.xz" --files-from=-
# Copy archived distribution for CI
cp -f "../Sparkle-$MARKETING_VERSION.tar.xz" "../sparkle-dist.tar.xz"
# Copy archived distribution for CI
cp -f "../Sparkle-$MARKETING_VERSION.tar.xz" "../sparkle-dist.tar.xz"
# Extract archive for testing binary validity
tar -xf "../Sparkle-$MARKETING_VERSION.tar.xz" -C "/tmp/sparkle-extract"
else
# Fallback to bz2 compression if xz utility is not available
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$MARKETING_VERSION.tar.bz2" --files-from=-
# Extract archive for testing binary validity
tar -xf "../Sparkle-$MARKETING_VERSION.tar.bz2" -C "/tmp/sparkle-extract"
fi
# Extract archive for testing binary validity
tar -xf "../Sparkle-$MARKETING_VERSION.tar.xz" -C "/tmp/sparkle-extract"
# Test code signing validity of the extracted products
# This guards against our archives being corrupt / created incorrectly
@@ -119,7 +97,7 @@ if [ "$ACTION" = "" ] ; then
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
# Get latest git tag
cd "$SRCROOT"
cd "$PROJECT_DIR"
latest_git_tag=$( git describe --tags --abbrev=0 || true )
if [ -n "$latest_git_tag" ] ; then
@@ -138,7 +116,7 @@ if [ "$ACTION" = "" ] ; then
rm -rf "/tmp/sparkle-spm-extract"
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
cd "$SRCROOT"
cd "$PROJECT_DIR"
# Check semantic versioning
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
@@ -150,9 +128,9 @@ if [ "$ACTION" = "" ] ; then
# Generate new Package manifest, podspec, and carthage files
cd "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
cp "$PROJECT_DIR/Package.swift" "$CONFIGURATION_BUILD_DIR"
cp "$PROJECT_DIR/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
cp "$PROJECT_DIR/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
fi
if [ -z "$latest_git_tag" ] ; then
@@ -162,7 +140,7 @@ if [ "$ACTION" = "" ] ; then
spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.zip")
rm -rf ".build"
sed -E -i '' -e "/let tag/ s/\".+\"/\"$latest_git_tag\"/" -e "/let version/ s/\".+\"/\"$MARKETING_VERSION\"/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
cp "Package.swift" "$SRCROOT"
cp "Package.swift" "$PROJECT_DIR"
echo "Package.swift updated with the following values:"
echo "Version: $MARKETING_VERSION"
echo "Tag: $latest_git_tag"
@@ -170,19 +148,15 @@ if [ "$ACTION" = "" ] ; then
sed -E -i '' -e "/s\.version.+=/ s/\".+\"/\"$MARKETING_VERSION\"/" "Sparkle.podspec"
"$SRCROOT/Configurations/update-carthage.py" "Carthage-dev.json" "$MARKETING_VERSION"
cp "Sparkle.podspec" "$SRCROOT"
"$PROJECT_DIR/Configurations/update-carthage.py" "Carthage-dev.json" "$MARKETING_VERSION"
cp "Sparkle.podspec" "$PROJECT_DIR"
# Note the Carthage-dev.json file will finally be copied to the website repo in Carthage/Sparkle.json in the end
cp "Carthage-dev.json" "$SRCROOT"
cp "Carthage-dev.json" "$PROJECT_DIR"
echo "Sparkle.podspec and Carthage-dev.json updated with following values:"
echo "Version: $MARKETING_VERSION"
else
echo "warning: Xcode version $XCODE_VERSION_ACTUAL does not support computing checksums for Swift Packages. Please update the Package manifest manually."
fi
if [ "$XZ_EXISTS" -ne 1 ] ; then
echo "WARNING: xz compression is used for official releases but bz2 is being used instead because xz tool is not installed on your system."
fi
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
fi
+2 -2
View File
@@ -5,7 +5,7 @@ if ! which -s git ; then
exit 0
fi
if [ -z "$SRCROOT" ] || \
if [ -z "$PROJECT_DIR" ] || \
[ -z "$BUILT_PRODUCTS_DIR" ] || \
[ -z "$INFOPLIST_PATH" ] || \
[ -z "$MARKETING_VERSION" ]; then
@@ -16,7 +16,7 @@ fi
version="$MARKETING_VERSION"
# Get version in format 1.x.x-commits-hash
gitversion=$( cd "$SRCROOT"; git describe --tags --match '[12].*' || true )
gitversion=$( cd "$PROJECT_DIR"; git describe --tags --match '[12].*' || true )
if [ -z "$gitversion" ] ; then
echo "$0: Can't find a Git hash!" 1>&2
exit 0
+5 -5
View File
@@ -10,15 +10,15 @@ The protocols used in XPC services must also not adopt other protocols (i.e, one
Singletons and other global mutable variables have been either removed entirely or completely avoided with an exception to backwards compatibility. They have no place in a well architectured framework.
`SPUUpdater` doesn't maintain singleton instances and can now be properly deconstructed. Note because a caller is not expected to explicitly invalidate an updater, this means that the updater needs to avoid geting into a retain cycle. Intermediate clasess were created for the update cycle and schedule timer to avoid just this.
`SPUUpdater` doesn't maintain singleton instances and can now be properly deconstructed. Note because a caller is not expected to explicitly invalidate an updater, this means that the updater needs to avoid getting into a retain cycle. Intermediate clasess were created for the update cycle and schedule timer to avoid just this.
One may argue that we shouldn't allow multiple live updaters running at the same bundle simutaneously, but I disagree and I think that is missing the point. It also does not account for updaters running external to the process. For example, it may be perfectly reasonable to start an update from `sparkle-cli` that defers the installation until quit, and have the application that is being updated be able to resume that installation and relaunch immediately.
One may argue that we shouldn't allow multiple live updaters running at the same bundle simultaneously, but I disagree and I think that is missing the point. It also does not account for updaters running external to the process. For example, it may be perfectly reasonable to start an update from `sparkle-cli` that defers the installation until quit, and have the application that is being updated be able to resume that installation and relaunch immediately.
The original `SUUpdater` may have also been created to assist plug-ins and other non-app bundles. My advice there is in order to be truely safe, you must not inject a framework like Sparkle into the host application anyway. An external tool that is bundled like `sparkle-cli` may be more appropriate to use here.
The original `SUUpdater` may have also been created to assist plug-ins and other non-app bundles. My advice there is in order to be truly safe, you must not inject a framework like Sparkle into the host application anyway. An external tool that is bundled like `sparkle-cli` may be more appropriate to use here.
## Extensibility
Sparkle 2.0 does not support subclassing classes internal (not exported) to Sparkle anymore. Doing so would be almost impossible to maintain into the future. Subclassing in general has been banned. Composition is prefered everywhere, even amongst the internal update drivers which were rewritten to follow a protocol oriented approach. The reason why composition is preferred is because it's easier to follow the flow of logic.
Sparkle 2.0 does not support subclassing classes internal (not exported) to Sparkle anymore. Doing so would be almost impossible to maintain into the future. Subclassing in general has been banned. Composition is preferred everywhere, even amongst the internal update drivers which were rewritten to follow a protocol oriented approach. The reason why composition is preferred is because it's easier to follow the flow of logic.
I hope the user driver API gives enough extensibility without someone wanting to create another fork.
@@ -32,7 +32,7 @@ You may notice that the delegate and user driver are not accessible as propertie
## Decoupling
Two software components should not directly know about each other. Preferrably they wouldn't know about each other at all, but if they must, they can use the delegation pattern with a declared protocol.
Two software components should not directly know about each other. Preferably they wouldn't know about each other at all, but if they must, they can use the delegation pattern with a declared protocol.
See `Documentation/graph-of-sparkle.png` for a graph of how the code looks like currently. This was generated via [objc_dep](https://github.com/nst/objc_dep) (great tool). Note that there are no red edges which would mean that two nodes know of each other.
+3 -3
View File
@@ -57,7 +57,7 @@ After extraction starts, one or more `SPUExtractedArchiveWithProgress` messages
### Post Validation
If the unarchiving succeeds, a `SPUValidationStarted` message is sent back to the updater, and the installer begins post validating the update.
If validation was already done before extraction, just the code signature is checked on the extracted bundle to make sure it's valid (if there's a code signature on the bundle). This is just a consistency check to make sure the developer didn't make a careless erorr.
If validation was already done before extraction, just the code signature is checked on the extracted bundle to make sure it's valid (if there's a code signature on the bundle). This is just a consistency check to make sure the developer didn't make a careless error.
If validation fails, the installer aborts, causing the updater to abort the update as well. Otherwise, the installer sends a message `SPUInstallationStartedStage1` to the updater and begins the installation.
@@ -92,7 +92,7 @@ For automatic based drivers, if the update is not going to be installed immediat
Otherwise if the updater delegate doesn't handle immediate installation for automatic based drivers (assuming still the update is not going to be installed immediately), the update driver is aborted; the installer will still wait for the target to terminate however. If the update cannot be silently installed or if the update is marked as critical from the appcast, the update procedure is actually 'resumed' as a scheduled UI based update driver immediately. The update driver can also be 'resumed' later when the user initiates for an update manually or when a long duration (I think a week) has passed by without the user terminating the application. Note automatic based drivers are unable to do a resume, so only UI based ones can.
If an update driver is resumed (which cannot happen if the target applicaton is already terminated by the way), then the updater first requests the installer for the appcast item data that the installer received before. The updater does this by creating a temporary distinct connection for the purpose of querying for the installation status. The connection will give up if a short timeout passes. If the updater fails to retrieve resume data, it assumes that there's no update to resume and will start back from the beginning. The updater can use this data for showing release notes, etc. Note the updater and target application don't have to live in the same process, and the updater could choose to terminate and resume later as a new process - so having the installer keep the appcast item data is nice.
If an update driver is resumed (which cannot happen if the target application is already terminated by the way), then the updater first requests the installer for the appcast item data that the installer received before. The updater does this by creating a temporary distinct connection for the purpose of querying for the installation status. The connection will give up if a short timeout passes. If the updater fails to retrieve resume data, it assumes that there's no update to resume and will start back from the beginning. The updater can use this data for showing release notes, etc. Note the updater and target application don't have to live in the same process, and the updater could choose to terminate and resume later as a new process - so having the installer keep the appcast item data is nice.
Afterwards the resumed update driver then allows the user driver to decide whether to a) install the update now, b) install & relaunch the update, or to c) delay the update installation and abort the update driver. Note we are now back to the same options discussed earlier.
@@ -134,4 +134,4 @@ When the progress agent exits, it cleans up by removing itself from disk. The in
* When we terminate the application before doing final installation work, we send an Apple quit event to all running application instances we find under the agent's GUI login session. This does not include running instances from other logged in sessions -- that may require authenticating all the time, so trade off is not worthwhile. Also currently the installer only handles a single process identifier to watch for until termination, and certainly doesn't handle the case if more instances are launched afterwards. Note all of this only applies to instances being launched from the same bundle path, and the consequence may rarely be updating a bundle when a running instance is still left alive.
* SMJobBless() would be interesting to explore and perhaps more suitable for sparkle-cli than ordinary application updaters because using this API is less approriate for one-off installations. Furthermore, the installer would have to change to persist rather than be a one-time install, and may have to handle mutliple connections for installing multiple bundles simutaneously.
* SMJobBless() would be interesting to explore and perhaps more suitable for sparkle-cli than ordinary application updaters because using this API is less appropriate for one-off installations. Furthermore, the installer would have to change to persist rather than be a one-time install, and may have to handle multiple connections for installing multiple bundles simultaneously.
+1 -1
View File
@@ -20,7 +20,7 @@ For XPC Services, it's significant to understand they can be used independent of
We have code that detects whether or not XPC services are available and enabled by the main application bundle. This is simpler and more efficient than attempting to create a connection and wait for a timeout. We don't have *any* checks for seeing if the "current process" is sandboxed; doing so is a rather broken behavior. The XPC Services are important, not the sandboxing.
I said above that XPC services are looked up in the main bundle. One may think this assumption doesn't hold for helpers or plug-ins inside applications. My response to that is they probably don't need the services, and they probably shoudn't be injecting Sparkle inside the host application anyway due to unintended conflicts and other consequences. A more appropriate approach may be to bundle a separate tool such as the sparkle command line utility.
I said above that XPC services are looked up in the main bundle. One may think this assumption doesn't hold for helpers or plug-ins inside applications. My response to that is they probably don't need the services, and they probably shouldn't be injecting Sparkle inside the host application anyway due to unintended conflicts and other consequences. A more appropriate approach may be to bundle a separate tool such as the sparkle command line utility.
The `InstallerLauncher` XPC service needs a `JoinExistingSession` key set to `YES` otherwise authorization will not work properly, and even less so on older systems. It took me forever to debug this, so it's worth mentioning.
+1 -2
View File
@@ -249,7 +249,6 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
NSData *data = [NSData dataWithContentsOfFile:_downloadFilename];
if (data != nil) {
NSURLResponse *response = _download.response;
assert(response != nil);
NSURL *responseURL = response.URL;
if (responseURL == nil) {
@@ -290,7 +289,7 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
}
}
// NSURLDownload has a [downlaod:shouldDecodeSourceDataOfMIMEType:] to determine if the data should be decoded.
// NSURLDownload has a [download:shouldDecodeSourceDataOfMIMEType:] to determine if the data should be decoded.
// This does not exist for NSURLSessionDownloadTask and appears unnecessary. Data tasks will decode data, but not download tasks.
@end
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)-spki</string>
</array>
</dict>
</plist>
+1 -1
View File
@@ -447,7 +447,7 @@ static BOOL SPUUsesSystemDomainForBundlePath(NSString *path, BOOL rootUser
return;
}
// We do however have to copy the progress tool app somewhere safe due to its external depedencies
// We do however have to copy the progress tool app somewhere safe due to its external dependencies
NSString *progressToolResourcePath = [self pathForBundledTool:@""SPARKLE_INSTALLER_PROGRESS_TOOL_NAME extension:@"app" fromBundle:ourBundle];
if (progressToolResourcePath == nil) {
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)-spks</string>
</array>
</dict>
</plist>
+4 -4
View File
@@ -2,15 +2,15 @@
import PackageDescription
// Version is technically not required here, SPM doesn't check
let version = "2.5.0"
let version = "2.6.1"
// 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.5.0"
let checksum = "f7e6ef91edee5704b76358c9485edc63a79dfefe770d8b5340818b7db69187df"
let tag = "2.6.1"
let checksum = "f37b84ffdb79f1afef627ab23ddb2c2e3ce1ca496adf3e5b39428fec13af4b62"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package(
name: "Sparkle",
platforms: [.macOS(.v10_11)],
platforms: [.macOS(.v10_13)], // leaving "10.13" as a breadcrumb for searching
products: [
.library(
name: "Sparkle",
+2 -2
View File
@@ -29,7 +29,7 @@ Please visit [Sparkle's website](http://sparkle-project.org) for up to date docu
## Requirements
* Runtime: macOS 10.13 or greater for 2.3, macOS 10.11 or greater for 2.2.x
* Runtime: macOS 10.13 or later.
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less.
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
@@ -54,7 +54,7 @@ If you are adding a symbol to the public API you must decorate the declaration w
You do not usually need to build a Sparkle distribution unless you're making changes to Sparkle itself.
To build a Sparkle distribution, `cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.xz (or .bz2) will be created and revealed in Finder after the build has completed.
To build a Sparkle distribution, `cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.xz will be created and revealed in Finder after the build has completed.
Alternatively, build the Distribution scheme in the Xcode UI.
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "2.5.0"
s.version = "2.6.1"
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"
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.xz" }
s.source_files = 'Sparkle.framework/Versions/B/Headers/*.h'
s.preserve_paths = ['bin/*', 'Entitlements', 'Symbols']
s.preserve_paths = ['bin/*', 'Symbols']
s.public_header_files = 'Sparkle.framework/Versions/B/Headers/*.h'
s.vendored_frameworks = 'Sparkle.framework'
s.xcconfig = {
+42 -11
View File
@@ -247,6 +247,9 @@
725F97841C8AA90000265BE4 /* SUPopUpTitlebarUserDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 725F97831C8AA90000265BE4 /* SUPopUpTitlebarUserDriver.m */; };
725F97A51C8B304D00265BE4 /* SUInstallUpdateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 725F97A31C8B304D00265BE4 /* SUInstallUpdateViewController.m */; };
725F97A61C8B304D00265BE4 /* SUInstallUpdateViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 725F97A41C8B304D00265BE4 /* SUInstallUpdateViewController.xib */; };
72666DC62B0B28F4001511B0 /* secret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72666DC52B0B28F4001511B0 /* secret.swift */; };
72666DC72B0B28F4001511B0 /* secret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72666DC52B0B28F4001511B0 /* secret.swift */; };
72666DC82B0B28F4001511B0 /* secret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72666DC52B0B28F4001511B0 /* secret.swift */; };
7267E5751D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */; };
7267E5761D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */; };
7267E5771D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */; };
@@ -392,6 +395,8 @@
72BC6C3D275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg in Resources */ = {isa = PBXBuildFile; fileRef = 72BC6C3C275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg */; };
72BEBFEF1D7287570019146B /* SUSpotlightImporterTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72BEBFEE1D7287560019146B /* SUSpotlightImporterTest.swift */; };
72CCDEBE27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip in Resources */ = {isa = PBXBuildFile; fileRef = 72CCDEBD27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip */; };
72D04F3D2B094C8400A6DEAA /* SPUVerifierInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */; };
72D04F3E2B097D4300A6DEAA /* SPUVerifierInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */; };
72D60CD928C2BAE900189AB8 /* SPUStandardUserDriver+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 72D60CD828C2BA2100189AB8 /* SPUStandardUserDriver+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
72D954811CBACC35006F28BD /* InstallerProgressAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954801CBACC35006F28BD /* InstallerProgressAppController.m */; };
72D954831CBAD34F006F28BD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954821CBAD34F006F28BD /* main.m */; };
@@ -1050,8 +1055,6 @@
7214B8851D45AD9A00CB5CED /* SPUInstallationType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUInstallationType.h; sourceTree = "<group>"; };
72162B071C82C9600013C1C5 /* SULocalizations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SULocalizations.h; sourceTree = "<group>"; };
721652671D3C8FED00FD13D8 /* SUInstallerLauncherStatus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUInstallerLauncherStatus.h; path = InstallerLauncher/SUInstallerLauncherStatus.h; sourceTree = SOURCE_ROOT; };
7218EC362623F31C008FECF3 /* org.sparkle-project.InstallerConnection.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "org.sparkle-project.InstallerConnection.entitlements"; sourceTree = "<group>"; };
7218EC372623F32E008FECF3 /* org.sparkle-project.InstallerStatus.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "org.sparkle-project.InstallerStatus.entitlements"; sourceTree = "<group>"; };
721AB11626C777D900D34A86 /* SPUDownloadDataPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUDownloadDataPrivate.h; sourceTree = "<group>"; };
721BC2061D17A532002BC71E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
721BC2081D17A553002BC71E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
@@ -1197,6 +1200,7 @@
723B5DA51CF7AB0100365F95 /* SPUDownloaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SPUDownloaderProtocol.h; path = Downloader/SPUDownloaderProtocol.h; sourceTree = SOURCE_ROOT; };
723C8A521E2D60DB00C14942 /* SUTouchBarButtonGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUTouchBarButtonGroup.h; sourceTree = "<group>"; };
723C8A531E2D60DB00C14942 /* SUTouchBarButtonGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUTouchBarButtonGroup.m; sourceTree = "<group>"; };
723DFF962B3DFF6E00628E6C /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
723EDC3E26885A8E000BCBA4 /* testappcast_channels.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast_channels.xml; sourceTree = "<group>"; };
7246E0A11C83B685003B4E75 /* SPUStandardUpdaterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUStandardUpdaterController.h; sourceTree = "<group>"; };
7246E0A21C83B685003B4E75 /* SPUStandardUpdaterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUStandardUpdaterController.m; sourceTree = "<group>"; };
@@ -1246,6 +1250,7 @@
725F97A21C8B304D00265BE4 /* SUInstallUpdateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstallUpdateViewController.h; sourceTree = "<group>"; };
725F97A31C8B304D00265BE4 /* SUInstallUpdateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallUpdateViewController.m; sourceTree = "<group>"; };
725F97A41C8B304D00265BE4 /* SUInstallUpdateViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SUInstallUpdateViewController.xib; sourceTree = "<group>"; };
72666DC52B0B28F4001511B0 /* secret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = secret.swift; sourceTree = "<group>"; };
7267E56E1D3D895B00D1BF90 /* SUBinaryDeltaApply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaApply.h; path = Autoupdate/SUBinaryDeltaApply.h; sourceTree = SOURCE_ROOT; };
7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUBinaryDeltaApply.m; path = Autoupdate/SUBinaryDeltaApply.m; sourceTree = SOURCE_ROOT; };
7267E5701D3D895B00D1BF90 /* SUBinaryDeltaCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaCommon.h; path = Autoupdate/SUBinaryDeltaCommon.h; sourceTree = SOURCE_ROOT; };
@@ -1334,9 +1339,13 @@
7286EE5E28CEC84900163C1D /* SUPlainTextReleaseNotesView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUPlainTextReleaseNotesView.m; sourceTree = "<group>"; };
728ED348277DA23400D9238F /* SPUSparkleDeltaArchive.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SPUSparkleDeltaArchive.h; path = Autoupdate/SPUSparkleDeltaArchive.h; sourceTree = SOURCE_ROOT; };
728ED349277DA23400D9238F /* SPUSparkleDeltaArchive.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SPUSparkleDeltaArchive.m; path = Autoupdate/SPUSparkleDeltaArchive.m; sourceTree = SOURCE_ROOT; };
728FBA192BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
728FBA1A2BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
728FBA1B2BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/MainMenu.strings; sourceTree = "<group>"; };
728FBA1C2BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/Sparkle.strings; sourceTree = "<group>"; };
729924921DF4A45000DBCDF5 /* SUUpdateValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUpdateValidator.h; path = Sparkle/SUUpdateValidator.h; sourceTree = SOURCE_ROOT; };
729924931DF4A45000DBCDF5 /* SUUpdateValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUpdateValidator.m; path = Sparkle/SUUpdateValidator.m; sourceTree = SOURCE_ROOT; };
729BB3D11D503826007C4276 /* org.sparkle-project.Downloader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "org.sparkle-project.Downloader.entitlements"; path = "Downloader/org.sparkle-project.Downloader.entitlements"; sourceTree = SOURCE_ROOT; };
729BB3D11D503826007C4276 /* Downloader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Downloader.entitlements; path = Downloader/Downloader.entitlements; sourceTree = SOURCE_ROOT; };
729F10FD1C65A9B500DFCCC5 /* ConfigUITest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITest.xcconfig; sourceTree = "<group>"; };
729F10FE1C65A9B500DFCCC5 /* ConfigUITestCoverage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestCoverage.xcconfig; sourceTree = "<group>"; };
729F7EAB27366353004592DC /* test-links.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "test-links.xml"; sourceTree = "<group>"; };
@@ -1384,6 +1393,8 @@
72BC6C3C275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg */ = {isa = PBXFileReference; lastKnownFileType = file; path = SparkleTestCodeSign_apfs.dmg; sourceTree = "<group>"; };
72BEBFEE1D7287560019146B /* SUSpotlightImporterTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUSpotlightImporterTest.swift; sourceTree = "<group>"; };
72CCDEBD27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = SparkleTestCodeSignApp_bad_header.zip; sourceTree = "<group>"; };
72D04F3B2B094C8400A6DEAA /* SPUVerifierInformation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUVerifierInformation.h; sourceTree = "<group>"; };
72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SPUVerifierInformation.m; sourceTree = "<group>"; };
72D60CD828C2BA2100189AB8 /* SPUStandardUserDriver+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SPUStandardUserDriver+Private.h"; sourceTree = "<group>"; };
72D9547F1CBACC35006F28BD /* InstallerProgressAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstallerProgressAppController.h; path = Sparkle/InstallerProgress/InstallerProgressAppController.h; sourceTree = SOURCE_ROOT; };
72D954801CBACC35006F28BD /* InstallerProgressAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InstallerProgressAppController.m; path = Sparkle/InstallerProgress/InstallerProgressAppController.m; sourceTree = SOURCE_ROOT; };
@@ -1700,6 +1711,7 @@
0867D691FE84028FC02AAC07 /* Sparkle */ = {
isa = PBXGroup;
children = (
723DFF962B3DFF6E00628E6C /* Package.swift */,
1495006D195FBBBD00BC5B5B /* Sparkle */,
EA1E288122B6688A004AA304 /* Command Line Tools */,
14732BB81960EEB600593899 /* Resources */,
@@ -2096,6 +2108,8 @@
7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */,
7267E59A1D3D8A5A00D1BF90 /* SUSignatureVerifier.h */,
7267E59B1D3D8A5A00D1BF90 /* SUSignatureVerifier.m */,
72D04F3B2B094C8400A6DEAA /* SPUVerifierInformation.h */,
72D04F3C2B094C8400A6DEAA /* SPUVerifierInformation.m */,
);
name = Verifiers;
path = ..;
@@ -2221,7 +2235,6 @@
724BB36E1D31D0B7005D534A /* SUInstallerConnectionProtocol.h */,
724BB3851D32A167005D534A /* SUXPCInstallerConnection.h */,
724BB3861D32A167005D534A /* SUXPCInstallerConnection.m */,
7218EC362623F31C008FECF3 /* org.sparkle-project.InstallerConnection.entitlements */,
);
name = InstallerConnection;
path = ../InstallerConnection;
@@ -2238,7 +2251,6 @@
7267E5DD1D3D8F5A00D1BF90 /* SUStatusInfoProtocol.h */,
724BB3A61D33461B005D534A /* SUXPCInstallerStatus.h */,
724BB3A71D33461B005D534A /* SUXPCInstallerStatus.m */,
7218EC372623F32E008FECF3 /* org.sparkle-project.InstallerStatus.entitlements */,
);
name = InstallerStatus;
path = ../InstallerStatus;
@@ -2262,6 +2274,14 @@
name = "User Driver";
sourceTree = "<group>";
};
72666DC42B0B28D4001511B0 /* common_cli */ = {
isa = PBXGroup;
children = (
72666DC52B0B28F4001511B0 /* secret.swift */,
);
path = common_cli;
sourceTree = "<group>";
};
726B2B5E1C645FC900388755 /* UI Tests */ = {
isa = PBXGroup;
children = (
@@ -2292,7 +2312,7 @@
children = (
723B5D9F1CF7AB0100365F95 /* Info.plist */,
723B5DA01CF7AB0100365F95 /* main.m */,
729BB3D11D503826007C4276 /* org.sparkle-project.Downloader.entitlements */,
729BB3D11D503826007C4276 /* Downloader.entitlements */,
723B5DA21CF7AB0100365F95 /* SPUDownloader.h */,
723B5DA31CF7AB0100365F95 /* SPUDownloader.m */,
723B5DA41CF7AB0100365F95 /* SPUDownloaderDelegate.h */,
@@ -2436,6 +2456,7 @@
EA1E288122B6688A004AA304 /* Command Line Tools */ = {
isa = PBXGroup;
children = (
72666DC42B0B28D4001511B0 /* common_cli */,
7205C43F1E13049400E370AE /* generate_appcast */,
EA1E285F22B66487004AA304 /* generate_keys */,
EA1E287722B666EB004AA304 /* sign_update */,
@@ -2593,7 +2614,7 @@
/* Begin PBXLegacyTarget section */
14732BC51960F69300593899 /* Distribution */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "$(SRCROOT)/Configurations/make-release-package.sh $(ACTION)";
buildArgumentsString = "$(PROJECT_DIR)/Configurations/make-release-package.sh $(ACTION)";
buildConfigurationList = 14732BC61960F69300593899 /* Build configuration list for PBXLegacyTarget "Distribution" */;
buildPhases = (
);
@@ -3100,6 +3121,7 @@
hr,
fa,
zh_HK,
nn,
);
mainGroup = 0867D691FE84028FC02AAC07 /* Sparkle */;
packageReferences = (
@@ -3262,7 +3284,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/set-git-version-info.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/set-git-version-info.sh\"\n";
showEnvVarsInLog = 0;
};
72045CE626FEE8CC004F96E5 /* Strip Framework */ = {
@@ -3282,7 +3304,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/strip-framework.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/strip-framework.sh\"\n";
};
720B4C2125EBFAA5005A0592 /* Run Script: Link Tools */ = {
isa = PBXShellScriptBuildPhase;
@@ -3301,7 +3323,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/link-tools.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/link-tools.sh\"\n";
};
895C5DC524D78E460058A82D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -3318,7 +3340,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/make-xcframework.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/make-xcframework.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -3344,6 +3366,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
72D04F3E2B097D4300A6DEAA /* SPUVerifierInformation.m in Sources */,
72266A8C29464D0200645376 /* SUSignatures.m in Sources */,
72266A8B29464CEA00645376 /* SUHost.m in Sources */,
72266A8A2946493C00645376 /* SUCodeSigningVerifier.m in Sources */,
@@ -3434,6 +3457,7 @@
7205C4571E13061F00E370AE /* SUUnarchiver.m in Sources */,
7205C4581E13061F00E370AE /* SUUnarchiverNotifier.m in Sources */,
7205C4501E1304CE00E370AE /* Unarchive.swift in Sources */,
72666DC62B0B28F4001511B0 /* secret.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3557,6 +3581,7 @@
7267E57F1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m in Sources */,
7267E59C1D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m in Sources */,
7267E5CC1D3D8C6B00D1BF90 /* SUConstants.m in Sources */,
72D04F3D2B094C8400A6DEAA /* SPUVerifierInformation.m in Sources */,
7267E5861D3D89B300D1BF90 /* SUDiskImageUnarchiver.m in Sources */,
7267E59D1D3D8A5A00D1BF90 /* SUSignatureVerifier.m in Sources */,
7267E5E71D3D90AA00D1BF90 /* SUFileManager.m in Sources */,
@@ -3693,6 +3718,7 @@
buildActionMask = 2147483647;
files = (
EA1E286122B66487004AA304 /* main.swift in Sources */,
72666DC72B0B28F4001511B0 /* secret.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3701,6 +3727,7 @@
buildActionMask = 2147483647;
files = (
EA1E287922B666EB004AA304 /* main.swift in Sources */,
72666DC82B0B28F4001511B0 /* secret.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3947,6 +3974,7 @@
F67C9B7B281410B600740813 /* hu */,
F6E11510281410D10003736C /* ar */,
37A5F28528E9219000891504 /* zh_HK */,
728FBA1C2BB5013300651EDF /* nn */,
);
name = Sparkle.strings;
sourceTree = "<group>";
@@ -3988,6 +4016,7 @@
72E1DAB625B3E8AE0001BA6D /* hr */,
F67C9B7C281410B600740813 /* hu */,
37A5F28728E9219000891504 /* zh_HK */,
728FBA1A2BB5013300651EDF /* nn */,
);
name = SUUpdateAlert.xib;
sourceTree = "<group>";
@@ -4027,6 +4056,7 @@
723ABDA0259A9D6300BDB4FA /* uk */,
72E1DAB525B3E8AE0001BA6D /* hr */,
37A5F28628E9219000891504 /* zh_HK */,
728FBA192BB5013300651EDF /* nn */,
);
name = SUUpdatePermissionPrompt.xib;
sourceTree = "<group>";
@@ -4077,6 +4107,7 @@
72E1DAB725B3E8AE0001BA6D /* hr */,
726FD2CB25F4BE5F00123BC6 /* fa */,
37A5F28828E9219000891504 /* zh_HK */,
728FBA1B2BB5013300651EDF /* nn */,
);
name = MainMenu.xib;
sourceTree = "<group>";
+1 -1
View File
@@ -230,7 +230,7 @@
}
} else {
// When no updates are found in the appcast
// We will need to assume the user is up to date if the feed doen't have any applicable update items
// We will need to assume the user is up to date if the feed doesn't have any applicable update items
// There could be update items on channels the updater is not subscribed to for example. But we can't tell the user about them.
// There could also only be update items available for other platforms or none at all.
localizedDescription = SULocalizedStringFromTableInBundle(@"You’re up to date!", SPARKLE_TABLE, sparkleBundle, "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
+3 -2
View File
@@ -190,8 +190,9 @@
- (void)extractDownloadedUpdate
{
assert(_resumableUpdate != nil);
[self extractUpdate:_resumableUpdate];
id<SPUResumableUpdate> resumableUpdate = _resumableUpdate;
assert(resumableUpdate != nil && [resumableUpdate isKindOfClass:[SPUDownloadedUpdate class]]);
[self extractUpdate:(SPUDownloadedUpdate *)resumableUpdate];
}
- (void)clearDownloadedUpdate
+1 -1
View File
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)downloadDriverWillBeginDownload;
// For persitent update downloads
// For persistent update downloads
- (void)downloadDriverDidDownloadUpdate:(SPUDownloadedUpdate *)downloadedUpdate;
// For temporary downloads
+1 -1
View File
@@ -249,7 +249,7 @@
id<SPUInstallerDriverDelegate> delegate = _delegate;
SPUInstallationInputData *installationData = [[SPUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch hostBundlePath:_host.bundlePath updateURLBookmarkData:_updateURLBookmarkData installationType:_updateItem.installationType signatures:_updateItem.signatures decryptionPassword:decryptionPassword];
SPUInstallationInputData *installationData = [[SPUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch hostBundlePath:_host.bundlePath updateURLBookmarkData:_updateURLBookmarkData installationType:_updateItem.installationType signatures:_updateItem.signatures decryptionPassword:decryptionPassword expectedVersion:_updateItem.versionString expectedContentLength:_updateItem.contentLength];
NSData *archivedData = SPUArchiveRootObjectSecurely(installationData);
if (archivedData == nil) {
+3 -3
View File
@@ -28,10 +28,10 @@ NS_ASSUME_NONNULL_BEGIN
/**
A controller class that instantiates a `SPUUpdater` and allows binding UI to its updater settings.
This class can be instantiated in a nib or created programatically using `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:`.
This class can be instantiated in a nib or created programmatically using `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:`.
The controller's updater targets the application's main bundle and uses Sparkle's standard user interface.
Typically, this class is used by sticking it as a custom NSObject subclass in an Interface Builder nib (probably in MainMenu) but it works well programatically too.
Typically, this class is used by sticking it as a custom NSObject subclass in an Interface Builder nib (probably in MainMenu) but it works well programmatically too.
The controller creates an `SPUUpdater` instance using a `SPUStandardUserDriver` and allows hooking up the check for updates action and handling menu item validation.
It also allows hooking up the updater's and user driver's delegates.
@@ -71,7 +71,7 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
You cannot call this initializer directly. You must instantiate a `SPUStandardUpdaterController` inside of a nib (typically the MainMenu nib) to use it.
To create a `SPUStandardUpdaterController` programatically, use `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:` instead.
To create a `SPUStandardUpdaterController` programmatically, use `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:` instead.
*/
- (instancetype)init NS_UNAVAILABLE;
+3 -3
View File
@@ -52,7 +52,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
Related: See `SPUStandardUpdaterController` which wraps a `SPUUpdater` instance and is suitable for instantiating inside of nib files.
@param hostBundle The bundle that should be targetted for updating.
@param hostBundle The bundle that should be targeted for updating.
@param applicationBundle The application bundle that should be waited for termination and relaunched (unless overridden). Usually this can be the same as hostBundle. This may differ when updating a plug-in or other non-application bundle.
@param userDriver The user driver that Sparkle uses for user update interaction.
@param delegate The delegate for `SPUUpdater`.
@@ -114,7 +114,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
to ask the user's permission to check for updates automatically and `automaticallyChecksForUpdates` is `NO`.
If you want to reset the updater's cycle after an updater setting change, see `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
This is meant for programmatically initating a check for updates in the background without the user initiating it.
This is meant for programmatically initiating 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.
@@ -307,7 +307,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
Note if Sparkle is being used to update another application, the bundle information retrieved is from the main application performing the updating.
This default implementation can be overrided.
This default implementation can be overridden.
*/
@property (nonatomic, copy) NSString *userAgentString;
+2 -2
View File
@@ -722,7 +722,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
}
// Notify host app that update driver has finished
// As long as we're not going to immmediately kick off a new check
// As long as we're not going to immediately kick off a new check
if (!shouldShowUpdateImmediately && [delegate respondsToSelector:@selector((updater:didFinishUpdateCycleForUpdateCheck:error:))]) {
[delegate updater:self didFinishUpdateCycleForUpdateCheck:updateCheck error:error];
}
@@ -977,7 +977,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
if (![NSThread isMainThread]) {
SULog(SULogLevelError, @"Error: -[SPUUpdater retrieveFeedURL:error:] must be called on the main thread.");
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUIncorrectAPIUsageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"SUUpdater -retriveFeedURL:error: must be called on the main thread for %@", hostName]}];
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUIncorrectAPIUsageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"SUUpdater -retrieveFeedURL:error: must be called on the main thread for %@", hostName]}];
}
return nil;
}
+1 -1
View File
@@ -288,7 +288,7 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
- (void)updater:(SPUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request;
/**
Called immediately after succesfull download of the specified update.
Called immediately after successful download of the specified update.
@param updater The SUUpdater instance.
@param item The appcast item corresponding to the update that has been downloaded.
+11 -7
View File
@@ -46,7 +46,7 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply;
/**
* Show the user initating an update check
* Show the user initiating an update check
*
* Respond to the user initiating an update check. Sparkle uses this to show the user a window with an indeterminate progress bar.
*
@@ -64,11 +64,11 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
*
* `SPUUpdateStateNotDownloaded` - Update has not been downloaded yet.
*
* `SPUUpdateStateDownloaded` - Update has already been downloaded but not started installing yet.
* `SPUUpdateStateDownloaded` - Update has already been downloaded in the background automatically (via `SUAutomaticallyUpdate`) but not started installing yet.
*
* `SPUUpdateStateInstalling` - Update has been downloaded and already started installing.
*
* The `userIntiated` property on the @c state indicates if the update was initiated by the user or if it was automatically scheduled in the background.
* The `userInitiated` property on the @c state indicates if the update was initiated by the user or if it was automatically scheduled in the background.
*
* Additionally, these properties on the @c appcastItem are of importance:
*
@@ -78,9 +78,10 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
*
* @c appcastItem.criticalUpdate indicates if the update is a critical update.
*
* A reply of `SPUUserUpdateChoiceInstall` begins or resumes downloading or installing the update.
* A reply of `SPUUserUpdateChoiceInstall` begins or resumes downloading, extracting, or installing the update.
* If the state.stage is `SPUUserUpdateStateInstalling`, this may send a quit event to the application and relaunch it immediately (in this state, this behaves as a fast "install and Relaunch").
* Do not use this reply if @c appcastItem.informationOnlyUpdate is YES.
* If the state.stage is `SPUUpdateStateNotDownloaded` or `SPUUpdateStateDownloaded` the user may be presented an authorization prompt to install the update after `-showDownloadDidStartExtractingUpdate` is called if authorization is required for installation. For example, this may occur if the update on disk is owned by a different user (e.g. root or admin for non-admin users), or if the update is a package install.
* Do not use a reply of `SPUUserUpdateChoiceInstall` if @c appcastItem.informationOnlyUpdate is YES.
*
* A reply of `SPUUserUpdateChoiceDismiss` dismisses the update for the time being. The user may be reminded of the update at a later point.
* If the state.stage is `SPUUserUpdateStateDownloaded`, the downloaded update is kept after dismissing until the next time an update is shown to the user.
@@ -183,8 +184,11 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
*
* Sparkle uses this to show an indeterminate progress bar.
*
* Note that an update can resume at this point after having been downloaded before,
* so this may be called without any of the download callbacks being invoked prior.
* Before this point, `showDownloadDidReceiveDataOfLength:` or `showUpdateFoundWithAppcastItem:state:reply:` may be called.
* An update can potentially resume at this point after having been automatically downloaded in the background (without the user driver) before.
*
* After extraction starts, the user may be shown an authorization prompt to install the update if authorization is required for installation.
* For example, this may occur if the update on disk is owned by a different user (e.g. root or admin for non-admin users), or if the update is a package install.
*/
- (void)showDownloadDidStartExtractingUpdate;
+24
View File
@@ -0,0 +1,24 @@
//
// SPUVerifierInformation.h
// Autoupdate
//
// Copyright © 2023 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
SPU_OBJC_DIRECT_MEMBERS @interface SPUVerifierInformation : NSObject
- (instancetype)initWithExpectedVersion:(NSString * _Nullable)expectedVersion expectedContentLength:(uint64_t)expectedContentLength;
@property (nonatomic, readonly, copy, nullable) NSString *expectedVersion;
@property (nonatomic, readonly) uint64_t expectedContentLength;
@property (nonatomic, copy, nullable) NSString *actualVersion;
@property (nonatomic) uint64_t actualContentLength;
@end
NS_ASSUME_NONNULL_END
+27
View File
@@ -0,0 +1,27 @@
//
// SPUVerifierInformation.m
// Autoupdate
//
// Copyright © 2023 Sparkle Project. All rights reserved.
//
#import "SPUVerifierInformation.h"
@implementation SPUVerifierInformation
@synthesize expectedVersion = _expectedVersion;
@synthesize expectedContentLength = _expectedContentLength;
@synthesize actualVersion = _actualVersion;
@synthesize actualContentLength = _actualContentLength;
- (instancetype)initWithExpectedVersion:(NSString *)expectedVersion expectedContentLength:(uint64_t)expectedContentLength
{
self = [super init];
if (self != nil) {
_expectedVersion = [expectedVersion copy];
_expectedContentLength = expectedContentLength;
}
return self;
}
@end
+1
View File
@@ -10,6 +10,7 @@
#define SUAppcastItem_Private_h
#import <Foundation/Foundation.h>
#import <Sparkle/SUAppcastItem.h>
NS_ASSUME_NONNULL_BEGIN
+1 -1
View File
@@ -49,7 +49,7 @@ static NSString *SUAppcastItemDeltaFromSparkleLocalesKey = @"SUAppcastItemDeltaF
@implementation SUAppcastItem
{
// Auxillary appcast item state that needs to be evaluated based on the host state
// Auxiliary appcast item state that needs to be evaluated based on the host state
// This may be nil if the client creates an SUAppcastItem with a deprecated initializer
// In that case we will need to fallback to safe behavior
SPUAppcastItemState *_state;
+1 -1
View File
@@ -34,7 +34,7 @@
// Use a default icon if none is defined.
if (!icon) {
// this asumption may not be correct (eg. even though we're not the main bundle, it could be still be a regular app)
// this assumption may not be correct (eg. even though we're not the main bundle, it could be still be a regular app)
// but still better than nothing if no icon was included
BOOL isMainBundle = [host.bundle isEqualTo:[NSBundle mainBundle]];
+2 -1
View File
@@ -17,7 +17,8 @@
#define SPARKLE_TABLE @"Sparkle"
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment)
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) (NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) ?: key)
#else
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) key
#endif
+1 -1
View File
@@ -19,7 +19,7 @@ typedef NS_ENUM(uint8_t, SULogLevel) {
SULogLevelError
};
// Logging utlity function that is thread-safe and uses os_log
// Logging utility function that is thread-safe and uses os_log
// For debugging command line tools, you may have to use Console.app or log(1) to view log messages
// Try to keep log messages as compact/short as possible
void SULog(SULogLevel level, NSString *format, ...) NS_FORMAT_FUNCTION(2, 3);
+1 -1
View File
@@ -34,7 +34,7 @@ void SULog(SULogLevel level, NSString *format, ...)
switch (level) {
case SULogLevelDefault:
// See docs for OS_LOG_TYPE_DEFAULT
// By default, OS_LOG_TYPE_DEFAULT seems to be more noticable than OS_LOG_TYPE_INFO
// By default, OS_LOG_TYPE_DEFAULT seems to be more noticeable than OS_LOG_TYPE_INFO
os_log(logger, "%{public}@", logMessage);
break;
case SULogLevelError:
-2
View File
@@ -62,7 +62,6 @@ static SUSigningInputStatus decode(NSString *str, NSData * __strong *outData) {
NSData *data = nil;
_ed25519SignatureStatus = decode(maybeEd25519, &data);
if (data) {
assert(64 == sizeof(_ed25519_signature));
if ([data length] == sizeof(_ed25519_signature)) {
[data getBytes:_ed25519_signature length:sizeof(_ed25519_signature)];
} else {
@@ -163,7 +162,6 @@ static BOOL decodeStatus(NSCoder *decoder, NSString *key, SUSigningInputStatus *
NSData *ed = nil;
_ed25519PubKeyStatus = decode(maybeEd25519, &ed);
if (ed) {
assert(32 == sizeof(_ed25519_public_key));
if ([ed length] == sizeof(_ed25519_public_key)) {
[ed getBytes:_ed25519_public_key length:sizeof(_ed25519_public_key)];
} else {
+2 -2
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
+4 -4
View File
@@ -14,7 +14,7 @@
#import "SULocalizations.h"
#import "SUTouchBarButtonGroup.h"
static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUStatusController";
static NSString *const SUStatusControllerTouchBarIdentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUStatusController";
@interface SUStatusController () <NSTouchBarDelegate>
@@ -162,15 +162,15 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
- (NSTouchBar *)makeTouchBar
{
NSTouchBar *touchBar = [[NSTouchBar alloc] init];
touchBar.defaultItemIdentifiers = @[ SUStatusControllerTouchBarIndentifier,];
touchBar.principalItemIdentifier = SUStatusControllerTouchBarIndentifier;
touchBar.defaultItemIdentifiers = @[ SUStatusControllerTouchBarIdentifier,];
touchBar.principalItemIdentifier = SUStatusControllerTouchBarIdentifier;
touchBar.delegate = self;
return touchBar;
}
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
{
if ([identifier isEqualToString:SUStatusControllerTouchBarIndentifier]) {
if ([identifier isEqualToString:SUStatusControllerTouchBarIdentifier]) {
NSCustomTouchBarItem *item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
SUTouchBarButtonGroup *group = [[SUTouchBarButtonGroup alloc] initByReferencingButtons:@[_actionButton,]];
item.viewController = group;
+21 -63
View File
@@ -31,7 +31,7 @@
#import "SPUXPCServiceInfo.h"
#import "SPUUserUpdateState.h"
static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdateAlert";
static NSString *const SUUpdateAlertTouchBarIdentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdateAlert";
@interface SUUpdateAlert () <NSTouchBarDelegate>
@end
@@ -42,7 +42,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
SUHost *_host;
SPUUserUpdateState *_state;
NSProgressIndicator *_releaseNotesSpinner;
NSBox *_darkBackgroundView;
NSBox *_backgroundView;
id<SUReleaseNotesView> _releaseNotesView;
id<SUVersionDisplay> _versionDisplayer;
@@ -58,7 +58,6 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
void(^_completionBlock)(SPUUserUpdateChoice, NSRect, BOOL);
BOOL _allowsAutomaticUpdates;
BOOL _observingAppearance;
}
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item state:(SPUUserUpdateState *)state host:(SUHost *)aHost versionDisplayer:(id<SUVersionDisplay>)versionDisplayer completionBlock:(void (^)(SPUUserUpdateChoice, NSRect, BOOL))completionBlock didBecomeKeyBlock:(void (^)(void))didBecomeKeyBlock
@@ -183,62 +182,6 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
}
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(__attribute__((unused)) NSDictionary<NSKeyValueChangeKey,id> *)change context:(__attribute__((unused)) void *)context {
if (@available(macOS 10.14, *)) {
if (object == _releaseNotesView.view && [keyPath isEqualToString:@"effectiveAppearance"]) {
[self adaptReleaseNotesAppearance];
}
}
}
- (void)dealloc {
if (@available(macOS 10.14, *)) {
if (_observingAppearance) {
[_releaseNotesView.view removeObserver:self forKeyPath:@"effectiveAppearance"];
_observingAppearance = NO;
}
}
}
- (void)adaptReleaseNotesAppearance SPU_OBJC_DIRECT
{
if (@available(macOS 10.14, *)) {
NSAppearanceName bestAppearance = [_releaseNotesView.view.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
if ([bestAppearance isEqualToString:NSAppearanceNameDarkAqua])
{
// Remove web view background...
[_releaseNotesView setDrawsBackground:NO];
// ... and use NSBox to get the dynamically colored background
if (_darkBackgroundView == nil)
{
_darkBackgroundView = [[NSBox alloc] initWithFrame:_releaseNotesView.view.frame];
_darkBackgroundView.boxType = NSBoxCustom;
_darkBackgroundView.fillColor = [NSColor textBackgroundColor];
_darkBackgroundView.borderColor = [NSColor clearColor];
// Using auto-resizing mask instead of contraints works well enough
_darkBackgroundView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[_releaseNotesView.view.superview addSubview:_darkBackgroundView positioned:NSWindowBelow relativeTo:_releaseNotesView.view];
// The release note user stylesheet will not adjust to the user changing the theme until adaptReleaseNoteAppearance is called again.
// So lock the appearance of the background to keep the text readable if the system theme changes.
_darkBackgroundView.appearance = _darkBackgroundView.effectiveAppearance;
}
}
else
{
// Restore standard dark on light appearance
[_darkBackgroundView removeFromSuperview];
_darkBackgroundView = nil;
[_releaseNotesView setDrawsBackground:YES];
}
if (!_observingAppearance) {
[_releaseNotesView.view addObserver:self forKeyPath:@"effectiveAppearance" options:0 context:nil];
_observingAppearance = YES;
}
}
}
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData
{
if (![self showsReleaseNotes]) {
@@ -372,7 +315,22 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
_releaseNotesView.view.frame = boxContentView.bounds;
_releaseNotesView.view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[self adaptReleaseNotesAppearance];
if (@available(macOS 10.14, *)) {
// We need a transparent background
// This avoids a "white flash" that may be present when the webview initially loads in dark mode
// This also is necessary for macOS 10.14, otherwise the background may stay white on 10.14 (but not in later OS's)
[_releaseNotesView setDrawsBackground:NO];
// Use NSBox to get the proper dynamically colored background behind the release notes view when
// the release notes view background is transparent
_backgroundView = [[NSBox alloc] initWithFrame:_releaseNotesView.view.frame];
_backgroundView.boxType = NSBoxCustom;
_backgroundView.fillColor = [NSColor textBackgroundColor];
_backgroundView.borderColor = [NSColor clearColor];
// Using auto-resizing mask instead of constraints works well enough
_backgroundView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[_releaseNotesView.view.superview addSubview:_backgroundView positioned:NSWindowBelow relativeTo:_releaseNotesView.view];
}
}
- (void)windowDidLoad
@@ -531,15 +489,15 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
- (NSTouchBar *)makeTouchBar
{
NSTouchBar *touchBar = [[NSTouchBar alloc] init];
touchBar.defaultItemIdentifiers = @[SUUpdateAlertTouchBarIndentifier,];
touchBar.principalItemIdentifier = SUUpdateAlertTouchBarIndentifier;
touchBar.defaultItemIdentifiers = @[SUUpdateAlertTouchBarIdentifier,];
touchBar.principalItemIdentifier = SUUpdateAlertTouchBarIdentifier;
touchBar.delegate = self;
return touchBar;
}
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
{
if ([identifier isEqualToString:SUUpdateAlertTouchBarIndentifier]) {
if ([identifier isEqualToString:SUUpdateAlertTouchBarIdentifier]) {
NSCustomTouchBarItem* item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
item.viewController = [[SUTouchBarButtonGroup alloc] initByReferencingButtons:@[_installButton, _laterButton, _skipButton]];
return item;
+4 -4
View File
@@ -18,7 +18,7 @@
#import "SUApplicationInfo.h"
#import "SUTouchBarButtonGroup.h"
static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdatePermissionPrompt";
static NSString *const SUUpdatePermissionPromptTouchBarIdentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdatePermissionPrompt";
@interface SUUpdatePermissionPrompt () <NSTouchBarDelegate>
@@ -166,15 +166,15 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
- (NSTouchBar *)makeTouchBar
{
NSTouchBar *touchBar = [[NSTouchBar alloc] init];
touchBar.defaultItemIdentifiers = @[SUUpdatePermissionPromptTouchBarIndentifier,];
touchBar.principalItemIdentifier = SUUpdatePermissionPromptTouchBarIndentifier;
touchBar.defaultItemIdentifiers = @[SUUpdatePermissionPromptTouchBarIdentifier,];
touchBar.principalItemIdentifier = SUUpdatePermissionPromptTouchBarIdentifier;
touchBar.delegate = self;
return touchBar;
}
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
{
if ([identifier isEqualToString:SUUpdatePermissionPromptTouchBarIndentifier]) {
if ([identifier isEqualToString:SUUpdatePermissionPromptTouchBarIdentifier]) {
NSCustomTouchBarItem* item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
item.viewController = [[SUTouchBarButtonGroup alloc] initByReferencingButtons:@[_checkButton, _cancelButton]];
return item;
+4 -1
View File
@@ -10,6 +10,7 @@
@class SUHost;
@class SUSignatures;
@class SPUVerifierInformation;
NS_ASSUME_NONNULL_BEGIN
@@ -18,7 +19,9 @@ SPU_OBJC_DIRECT_MEMBERS
#endif
@interface SUUpdateValidator : NSObject
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation;
// This is "pre" validation, before the archive has been extracted
- (BOOL)validateDownloadPathWithError:(NSError **)error;
+10 -5
View File
@@ -14,6 +14,7 @@
#import "SULog.h"
#import "SUSignatures.h"
#import "SUErrors.h"
#import "SPUVerifierInformation.h"
#include "AppKitPrevention.h"
@@ -23,17 +24,19 @@
SUHost *_host;
SUSignatures *_signatures;
NSString *_downloadPath;
SPUVerifierInformation *_verifierInformation;
BOOL _prevalidatedSignature;
}
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host
- (instancetype)initWithDownloadPath:(NSString *)downloadPath signatures:(SUSignatures *)signatures host:(SUHost *)host verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation
{
self = [super init];
if (self != nil) {
_downloadPath = [downloadPath copy];
_signatures = signatures;
_host = host;
_verifierInformation = verifierInformation;
}
return self;
}
@@ -49,7 +52,7 @@
}
} else {
NSError *innerError = nil;
if ([SUSignatureVerifier validatePath:_downloadPath withSignatures:signatures withPublicKeys:publicKeys error:&innerError]) {
if ([SUSignatureVerifier validatePath:_downloadPath withSignatures:signatures withPublicKeys:publicKeys verifierInformation:_verifierInformation error:&innerError]) {
_prevalidatedSignature = YES;
return YES;
}
@@ -94,7 +97,7 @@
// For package type updates, all we do is check if the EdDSA signature is valid
NSError *innerError = nil;
SUPublicKeys *publicKeys = host.publicKeys;
BOOL validationCheckSuccess = [SUSignatureVerifier validatePath:downloadPath withSignatures:signatures withPublicKeys:publicKeys error:&innerError];
BOOL validationCheckSuccess = [SUSignatureVerifier validatePath:downloadPath withSignatures:signatures withPublicKeys:publicKeys verifierInformation:_verifierInformation error:&innerError];
if (!validationCheckSuccess) {
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUValidationError userInfo:@{ NSLocalizedDescriptionKey: @"EdDSA signature validation of the package failed. The update contains an installer package, and valid EdDSA signatures are mandatory for all installer packages. The update will be rejected. Sign the installer with a valid EdDSA key or use an .app bundle update instead.", NSUnderlyingErrorKey: innerError }];
@@ -156,6 +159,8 @@
SUHost *newHost = [[SUHost alloc] initWithBundle:newBundle];
SUPublicKeys *newPublicKeys = newHost.publicKeys;
_verifierInformation.actualVersion = newHost.version;
BOOL oldHasLegacyDSAKey = publicKeys.dsaPubKeyStatus != SUSigningInputStatusAbsent;
BOOL oldHasEdDSAKey = publicKeys.ed25519PubKeyStatus != SUSigningInputStatusAbsent;
BOOL oldHasAnyDSAKey = oldHasLegacyDSAKey || oldHasEdDSAKey;
@@ -181,7 +186,7 @@
NSError *dsaError = nil;
if (oldHasAnyDSAKey) {
// it's critical to check against the old public key, rather than the new key
passedDSACheck = [SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:publicKeys error:&dsaError];
passedDSACheck = [SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:publicKeys verifierInformation:_verifierInformation error:&dsaError];
}
NSError *codeSignedError = nil;
@@ -194,7 +199,7 @@
// In that case, the check ensures that the app author has correctly used DSA keys, so that the app will be updateable in the next version.
if (!passedDSACheck && newHasAnyDSAKey) {
NSError *innerError = nil;
if (![SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:newPublicKeys error:&innerError]) {
if (![SUSignatureVerifier validatePath:downloadedPath withSignatures:signatures withPublicKeys:newPublicKeys verifierInformation:_verifierInformation error:&innerError]) {
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUValidationError userInfo:@{ NSLocalizedDescriptionKey: @"The update has a public (Ed)DSA key, but the public key shipped with the update doesn't match the signature. To prevent future problems, the update will be rejected.", NSUnderlyingErrorKey: innerError }];
}
+2 -2
View File
@@ -83,7 +83,7 @@ SU_EXPORT @interface SUUpdater : NSObject
/*!
Checks for updates, but does not display any UI unless an update is found.
This is meant for programmatically initating a check for updates. That is,
This is meant for programmatically initiating a check for updates. That is,
it will display no UI unless it actually finds an update, in which case it
proceeds as usual.
@@ -160,7 +160,7 @@ SU_EXPORT @interface SUUpdater : NSObject
/*!
The user agent used when checking for and downloading updates.
The default implementation can be overrided.
The default implementation can be overridden.
*/
@property (nonatomic, copy) NSString *userAgentString;
+1 -1
View File
@@ -196,7 +196,7 @@ static NSMutableDictionary *sharedUpdaters = nil;
{
if (_delayShowingUserUpdate) {
// We don't know if SUUpdater delegate will call checkForUpdates: or checkForUpdatesInBackground
// to bring a deffered update alert back in 1.x.
// to bring a deferred update alert back in 1.x.
// So if checkForUpdatesInBackground is called we will bring the update back in focus
[self checkForUpdates:nil];
} else {
+1 -1
View File
@@ -156,7 +156,7 @@ __deprecated_msg("Deprecated in Sparkle 2. See SPUUpdaterDelegate instead")
- (void)updater:(SUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request;
/*!
Called immediately after succesfull download of the specified update.
Called immediately after successful download of the specified update.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that has been downloaded.
+4 -1
View File
@@ -2,7 +2,7 @@
"%@ %@ is currently the newest version available." = "%1$@ %2$@ es la versión más nueva disponible.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ es la versión más nueva disponible.\n(You are currently running version %3$@.)";
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ es la versión más nueva disponible.\n(Actualmente estás corriendo la versió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$@ ya está disponible (tienes la %3$@). ¿Quisieras descargarla ahora?";
@@ -88,5 +88,8 @@
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Usa Finder para copiar %1$@ a la carpeta Aplicaciones, vuélvela a abrir desde ahí e inténtalo de nuevo.";
/* No comment provided by engineer. */
"Version History" = "Historial de versiones";
/* 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!" = "¡Está actualizado!";
+1 -1
View File
@@ -5,7 +5,7 @@
"170.title" = "リリースノート:";
/* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */
"171.title" = "後で通知";
"171.title" = "あとで通知";
/* Class = "NSButtonCell"; title = "Skip This Version"; ObjectID = "172"; */
"172.title" = "このバージョンはスキップ";
+3
View File
@@ -18,3 +18,6 @@
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "OhZ-1K-DmA"; */
"OhZ-1K-DmA.title" = "自動で確認";
/* Class = "NSButtonCell"; title = "Automatically download and install updates"; ObjectID = "AUc-33-qGN"; */
"AUc-33-qGN.title" = "アップデートを自動でダウンロードしてインストール";
+3 -3
View File
@@ -29,7 +29,7 @@
"%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$@がダウンロードされました! これは重要なアップデートです。今すぐ%1$@をインストールして再起動しますか?";
/* 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$@ %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$@までしか対応していません。";
@@ -38,10 +38,10 @@
"%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$@に適用できません。";
"%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$@は読み出し専用またはテンポラリな場所で開かれているためアップデートできません。";
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@は読み出し専用または一時的な場所で開かれているためアップデートできません。";
/* No comment provided by engineer. */
"A new version of %@ is available!" = "新しいバージョンの%@が入手できます!";
+3 -3
View File
@@ -1,8 +1,8 @@
/* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */
"5.title" = "Software Update";
"5.title" = "소프트웨어 업데이트";
/* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */
"170.title" = "배포 정보:";
"170.title" = "릴리즈 노트:";
/* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */
"171.title" = "나중에";
@@ -14,4 +14,4 @@
"173.title" = "업데이트 설치";
/* Class = "NSButtonCell"; title = "Automatically download and install updates in the future"; ObjectID = "175"; */
"175.title" = "나중에 업데이트 자동으로 다운로드 및 설치";
"175.title" = "향후 업데이트 자동 다운로드 및 설치";
+11 -8
View File
@@ -4,17 +4,20 @@
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "45"; */
"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아래 정보가 전송될 것입니다.";
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "176"; */
"OhZ-1K-DmA.title" = "자동으로 확인";
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "cCJ-V0-aTi"; */
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "177"; */
"cCJ-V0-aTi.title" = "취소";
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "gmh-T4-BO0"; */
"gmh-T4-BO0.title" = "자동으로 업데이트 확인할까요?";
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "178"; */
"gmh-T4-BO0.title" = "업데이트를 자동으로 확인할까요?";
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "gz7-LM-gNf"; */
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "180"; */
"gz7-LM-gNf.title" = "익명 시스템 정보 포함";
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "OhZ-1K-DmA"; */
"OhZ-1K-DmA.title" = "자동으로 확인";
/* Class = "NSButtonCell"; title = "Automatically download and install updates"; ObjectID = "AUc-33-qGN"; */
"AUc-33-qGN.title" = "업데이트 자동 다운로드 및 설치";
/* 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아래 정보가 전송될 것입니다.";
+89 -17
View File
@@ -1,23 +1,47 @@
/* No comment provided by engineer. */
"%@ %@ 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$@.)";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ 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" = "%@ 다운로드 완료";
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
"%@ of %@" = "%1$@ / %2$@";
/* 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$@ 이(가) 다운로드 되었습니다. 프로그램을 업데이트하고 재실행 하시겠습니까?\n이 업데이트는 중요한 업데이트입니다.";
/* 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$@이(가) 다운로드 되었습니다. 프로그램을 업데이트하고 재실행 하시겠습니까?";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트 할 수 없습니다.";
"%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 %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 %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$@ 이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트할 수 없습니다.";
/* No comment provided by engineer. */
"%@ %@ 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(현재 실행 중인 버전 : %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$@ 업데이트를 설치할 수 있습니다. 다운로드 하시겠습니까?\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$@)";
/* 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$@ 이(가) 업데이트 되었습니다. 업데이트에 대한 더 많은 정보를 확인하시겠습니까? (현재 버전 : %3$@)";
/* The download progress in a unit of bytes, e.g. 100 KB */
"%@ downloaded" = "%@ 다운로드 완료";
/* No comment provided by engineer. */
"%@ is now updated to version %@!" = "%1$@ 이(가) %2$@ 버전으로 업데이트 되었습니다!";
/* No comment provided by engineer. */
"%@ is now updated!" = "%@ 이(가) 업데이트 되었습니다!";
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
"%@ of %@" = "%1$@ / %2$@";
/* No comment provided by engineer. */
"A new version of %@ is available!" = "%@ 새 버전이 있습니다.";
@@ -28,15 +52,30 @@
/* No comment provided by engineer. */
"An error occurred in retrieving update information. Please try again later." = "업데이트 정보를 수집하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
/* No comment provided by engineer. */
"An error occurred while connecting to the installer. Please try again later." = "설치 프로그램에 연결하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
/* No comment provided by engineer. */
"An error occurred while downloading the update. Please try again later." = "업데이트를 다운로드 하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
/* No comment provided by engineer. */
"An error occurred while extracting the archive. Please try again later." = "압축 파일을 푸는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
/* No comment provided by engineer. */
"An error occurred while launching the installer. Please try again later." = "설치 프로그램을 실행하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
/* No comment provided by engineer. */
"An error occurred while parsing the update feed." = "업데이트 피드를 분석하는 중 오류가 발생하였습니다.";
/* No comment provided by engineer. */
"An error occurred while running the updater. Please try again later." = "업데이트를 진행하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
/* No comment provided by engineer. */
"An error occurred while starting the installer. Please try again later." = "설치 프로그램을 시작하는 중 오류가 발생하였습니다. 나중에 다시 시도해 주십시오.";
/* No comment provided by engineer. */
"An important update to %@ is ready to install" = "(중요 업데이트) %@ 을(를) 설치할 준비가 완료되었습니다.";
/* No comment provided by engineer. */
"Cancel" = "취소";
@@ -52,29 +91,62 @@
/* Take care not to overflow the status window. */
"Extracting update…" = "압축 푸는 중…";
/* No comment provided by engineer. */
"Failed to resume installing update." = "업데이트 설치를 재개하지 못했습니다.";
/* No comment provided by engineer. */
"Install and Relaunch" = "설치 & 재실행";
/* Alternate title for 'Remind Me Later' button when downloaded updates can be resumed */
"Install on Quit" = "종료 시 설치";
/* Take care not to overflow the status window. */
"Installing update…" = "설치 중…";
/* Alternate title for 'Install Update' button when there's no download in RSS feed. */
"Learn More…" = "더 알아보기…";
/* No comment provided by engineer. */
"OK" = "확인";
/* No comment provided by engineer. */
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "%1$@ 을(를) 종료하고, 응용 프로그램 폴더로 옮긴 다음 다시 실행해 주십시오.";
/* No comment provided by engineer. */
"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. */
"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!" = "업데이트 오류!";
/* No comment provided by engineer. */
"Update Installed" = "업데이트가 설치되었습니다.";
/* No comment provided by engineer. */
"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$@ 을(를) 응용 프로그램 폴더로 옮긴 다음 다시 실행해 주십시오.";
/* 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!" = "최신 버전입니다.";
+18
View File
@@ -0,0 +1,18 @@
/* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */
"5.title" = "Programoppdatering";
/* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */
"170.title" = "Om oppdateringen:";
/* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */
"171.title" = "Utsett";
/* Class = "NSButtonCell"; title = "Skip This Version"; ObjectID = "172"; */
"172.title" = "Hopp over";
/* Class = "NSButtonCell"; title = "Install Update"; ObjectID = "173"; */
"173.title" = "Installer";
/* Class = "NSButtonCell"; title = "Automatically download and install updates in the future"; ObjectID = "175"; */
"175.title" = "Last ned og installer automatisk i framtida";
+24
View File
@@ -0,0 +1,24 @@
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "43"; */
"43.title" = "Text Cell";
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "45"; */
"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" = "Den anonyme systemprofilen hjelper oss med å planleggja framtidig utviklingsarbeid. Ta gjerne kontakt med oss om du har spørsmål om dette.
\nFølgjande innhald vil bli sendt:";
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "cCJ-V0-aTi"; */
"cCJ-V0-aTi.title" = "Ikkje sjå etter";
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "gmh-T4-BO0"; */
"gmh-T4-BO0.title" = "Sjå etter etter oppdateringar automatisk?";
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "gz7-LM-gNf"; */
"gz7-LM-gNf.title" = "Inkluder anonym systemprofil";
/* Class = "NSButtonCell"; title = "Automatically download and install updates"; ObjectID = "AUc-33-qGN"; */
"AUc-33-qGN.title" = "Last ned og installer automatisk";
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "OhZ-1K-DmA"; */
"OhZ-1K-DmA.title" = "Sjå etter automatisk";
+90
View File
@@ -0,0 +1,90 @@
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ er nyaste versjon.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ er nyaste versjon.\n(Du køyrer versjon %3$@ akkurat no.)";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ er no tilgjengeleg — du har %3$@. Ynskjer du å lasta ned og installera no?";
/* The download progress in a unit of bytes, e.g. 100 KB */
"%@ downloaded" = "%@ nedlasta";
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
"%@ of %@" = "%1$@ av %2$@";
/* 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$@ er lasta ned og er klar til bruk! Dette er ei viktig oppdatering; ynskjer du å installera og starta om att %1$@ no?";
/* 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$@ er lasta ned og er klar til bruk! Ynskjer du å installera og starta om att %1$@ no?";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ kan ikkje oppdaterast frå ei eining som berre kan lesast, t.d. frå ein cd";
/* No comment provided by engineer. */
"A new version of %@ is available!" = "Ein ny versjon av %@ er tilgjengeleg!";
/* No comment provided by engineer. */
"A new version of %@ is ready to install!" = "Ein ny versjon av %@ er klar for installering!";
/* No comment provided by engineer. */
"An error occurred in retrieving update information. Please try again later." = "Ein feil oppstod ved henting av oppdateringsinformasjon. Ver greid og prøv igjen seinare.";
/* No comment provided by engineer. */
"An error occurred while downloading the update. Please try again later." = "Ein feil oppstod under nedlasting av oppdateringa. Ver greid og prøv igjen seinare.";
/* No comment provided by engineer. */
"An error occurred while extracting the archive. Please try again later." = "Ein feil oppstod under utpakking av oppdateringa. Ver greid og prøv igjen seinare.";
/* No comment provided by engineer. */
"An error occurred while parsing the update feed." = "Ein feil oppstod under lesing av oppdateringsstraumen.";
/* No comment provided by engineer. */
"An important update to %@ is ready to install" = "Ei viktig oppdatering for %@ er klar til å verta installert";
/* No comment provided by engineer. */
"Cancel" = "Avbryt";
/* No comment provided by engineer. */
"Cancel Update" = "Avbryt oppdateringa";
/* No comment provided by engineer. */
"Checking for updates…" = "Ser etter oppdateringar…";
/* Take care not to overflow the status window. */
"Downloading update…" = "Lastar ned oppdateringa…";
/* Take care not to overflow the status window. */
"Extracting update…" = "Pakkar ut oppdateringa…";
/* No comment provided by engineer. */
"Install and Relaunch" = "Installer og start på nytt";
/* Take care not to overflow the status window. */
"Installing update…" = "Installerer oppdateringa…";
/* Alternate title for 'Install Update' button when there's no download in RSS feed. */
"Learn More…" = "Meir info…";
/* No comment provided by engineer. */
"OK" = "Greitt";
/* No comment provided by engineer. */
"Ready to Install" = "Klar til å installera";
/* No comment provided by engineer. */
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Skal %1$@ sjå automatisk etter oppdateringar? Du kan når som helst sjå etter manuelt i %1$@-menyen.";
/* No comment provided by engineer. */
"Update Error!" = "Feil ved oppdateringa!";
/* No comment provided by engineer. */
"Updating %@" = "Oppdaterer %@";
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Flytt %1$@ til Programmer-mappa, start på nytt og prøv igjen.";
/* 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!" = "Ingen nye oppdateringar";
+6 -6
View File
@@ -1,17 +1,17 @@
/* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */
"5.title" = "Software-Aktualisierung";
"5.title" = "Yazılım Güncelleme";
/* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */
"170.title" = "Sürüm Hakkında:";
"170.title" = "Sürüm notları:";
/* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */
"171.title" = "Sonra Hatırlat";
"171.title" = "Daha Sonra Anımsat";
/* Class = "NSButtonCell"; title = "Skip This Version"; ObjectID = "172"; */
"172.title" = "Bu Sürümü Geç";
"172.title" = "Bu Sürümü Atla";
/* Class = "NSButtonCell"; title = "Install Update"; ObjectID = "173"; */
"173.title" = "Kur";
"173.title" = "Yükle";
/* Class = "NSButtonCell"; title = "Automatically download and install updates in the future"; ObjectID = "175"; */
"175.title" = "Bundan sonra güncellemeleri kendiliğinden indir ve kur";
"175.title" = "Gelecekte güncellemeleri otomatik olarak indir ve yükle";
+6 -6
View File
@@ -5,19 +5,19 @@
"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" = "Gönderdiğiniz anonim sistem bilgileri bu yazılımın geliştirilmesi için kullanılacaktır. Konu ile ilgili ayrıntılı bilgi için lütfen bizimle bağlantıya geçiniz. Göndereceğiniz Bilgiler:";
"183.title" = "Gönderdiğiniz anonim sistem bilgileri bu yazılımın geliştirilmesi için kullanılacaktır. Konu ile ilgili ayrıntılı bilgi için lütfen bizimle iletişime geçin. Gönderilecek bilgiler:";
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "cCJ-V0-aTi"; */
"cCJ-V0-aTi.title" = "Arama";
"cCJ-V0-aTi.title" = "Denetleme";
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "gmh-T4-BO0"; */
"gmh-T4-BO0.title" = "Güncellemeler otomatik olarak aransın mı?";
"gmh-T4-BO0.title" = "Güncellemeler otomatik olarak denetlensin mi?";
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "gz7-LM-gNf"; */
"gz7-LM-gNf.title" = "Sistem bilgilerini kimlik gizlenmiş olarak gönder";
"gz7-LM-gNf.title" = "Anonim sistem profilini içer";
/* Class = "NSButtonCell"; title = "Automatically download and install updates"; ObjectID = "AUc-33-qGN"; */
"AUc-33-qGN.title" = "Güncellemeleri kendiliğinden indir ve kur";
"AUc-33-qGN.title" = "Güncellemeleri otomatik olarak indir ve yükle";
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "OhZ-1K-DmA"; */
"OhZ-1K-DmA.title" = "Otomatik Olarak Ara";
"OhZ-1K-DmA.title" = "Otomatik Olarak Denetle";
+17 -17
View File
@@ -1,11 +1,11 @@
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ mevcut en yeni sürümdür.";
"%@ %@ is currently the newest version available." = "%1$@ %2$@, kullanılabilir en yeni sürümdür.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ mevcut en yeni sürümdür.\n(Şu anda %3$@ sürümünü kullanıyorsunuz.)";
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@, kullanılabilir en yeni sürümdür.\n(Şu anda %3$@ sürümünü kullanıyorsunuz.)";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ çıktı (Kullandığınız Sürüm: %3$@). Şimdi yeni sürümü indirmek ister misiniz?";
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ çıktı (kullandığınız sürüm: %3$@). Şimdi yeni sürümü indirmek ister misiniz?";
/* 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$@ çıktı (kullandığınız sürüm: %3$@). Bu güncelleme ile ilgili olarak web sayfasından daha fazla bilgi almak ister misiniz?";
@@ -20,43 +20,43 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ indirildi ve kullanıma hazır! Şimdi yüklemek ister misiniz? Uygulama yeniden başlatılacaktır.";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ uygulaması geçici veya salt okunur bir konumdan açıldığı için güncellenemedi.";
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ uygulaması geçici veya salt okunur bir konumdan açıldığı için güncellenemiyor.";
/* No comment provided by engineer. */
"A new version of %@ is available!" = "%@ uygulaması için yeni bir sürüm var!";
"A new version of %@ is available!" = "%@ uygulaması için yeni bir sürüm kullanılabilir!";
/* No comment provided by engineer. */
"A new version of %@ is ready to install!" = "%@ uygulamasının yeni bir sürümü yüklenmeye hazır!";
/* No comment provided by engineer. */
"An error occurred in retrieving update information. Please try again later." = "Güncelleme bilgilerini alırken bir hata oluştu. Lütfen daha sonra tekrar deneyiniz.";
"An error occurred in retrieving update information. Please try again later." = "Güncelleme bilgilerini alırken bir hata oluştu. Lütfen daha sonra yeniden deneyin.";
/* No comment provided by engineer. */
"An error occurred while downloading the update. Please try again later." = "Güncelleme indirilirken bir hata oluştu. Lütfen sonra tekrar deneyiniz.";
"An error occurred while downloading the update. Please try again later." = "Güncelleme indirilirken bir hata oluştu. Lütfen daha sonra yeniden deneyin.";
/* No comment provided by engineer. */
"An error occurred while extracting the archive. Please try again later." = "İndirilen arşivi açarken bir hata oluştu. Lütfen daha sonra tekrar deneyiniz.";
"An error occurred while extracting the archive. Please try again later." = "İndirilen arşivi açarken bir hata oluştu. Lütfen daha sonra yeniden deneyin.";
/* No comment provided by engineer. */
"An error occurred while parsing the update feed." = "Güncelleme kaynağını incelerken bir hata oluştu.";
"An error occurred while parsing the update feed." = "Güncelleme kaynağı ayrıştırılırken bir hata oluştu.";
/* No comment provided by engineer. */
"Cancel" = "Vazgeç";
/* No comment provided by engineer. */
"Cancel Update" = "Güncellemeyi iptal et";
"Cancel Update" = "Güncellemeden Vazgeç";
/* No comment provided by engineer. */
"Checking for updates…" = "Güncellemelere bakılıyor…";
"Checking for updates…" = "Güncellemeler denetleniyor…";
/* Take care not to overflow the status window. */
"Downloading update…" = "Güncelleme indiriliyor…";
/* Take care not to overflow the status window. */
"Extracting update…" = "Güncelleme ayıklanıyor…";
"Extracting update…" = "Güncelleme çıkarılıyor…";
/* No comment provided by engineer. */
"Install and Relaunch" = "Kur ve yeniden başlat";
"Install and Relaunch" = "Yükle ve Yeniden Başlat";
/* Take care not to overflow the status window. */
"Installing update…" = "Güncelleme kuruluyor…";
@@ -65,19 +65,19 @@
"OK" = "Tamam";
/* No comment provided by engineer. */
"Ready to Install" = "Kuruluma hazır";
"Ready to Install" = "Yüklemeye Hazır";
/* No comment provided by engineer. */
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "%1$@ uygulaması için güncellemeler otomatik olarak aransın mı? Güncelleme işlemini el ile uygulama menüsünden de başlatabilirsiniz.";
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "%1$@ uygulaması güncellemeleri otomatik olarak denetlensin mi? Güncelleme işlemini el ile uygulama menüsünden de başlatabilirsiniz.";
/* No comment provided by engineer. */
"Update Error!" = "Güncelleme hatası.";
"Update Error!" = "Güncelleme Hatası!";
/* No comment provided by engineer. */
"Updating %@" = "%@ güncelleniyor";
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Lütfen %1$@ uygulamasını Uygulamalar dizinine kopyalayıp yeniden başlatınız.";
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ uygulamasını Uygulamalar klasörüne kopyalamak için Finder'ı kullanın, onu oradan başlatın ve yeniden deneyin.";
/* 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!" = "Uygulama güncel!";
+162
View File
@@ -0,0 +1,162 @@
/* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */
"5.title" = "Bring All to Front";
/* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */
"19.title" = "Window";
/* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */
"23.title" = "Minimize";
/* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */
"24.title" = "Window";
/* Class = "NSMenu"; title = "MainMenu"; ObjectID = "29"; */
"29.title" = "MainMenu";
/* Class = "NSMenuItem"; title = "Sparkle Test App"; ObjectID = "56"; */
"56.title" = "Sparkle Test App";
/* Class = "NSMenu"; title = "Sparkle Test App"; ObjectID = "57"; */
"57.title" = "Sparkle Test App";
/* Class = "NSMenuItem"; title = "About Sparkle Test App"; ObjectID = "58"; */
"58.title" = "About Sparkle Test App";
/* Class = "NSMenuItem"; title = "Open..."; ObjectID = "72"; */
"72.title" = "Open...";
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
"73.title" = "Close";
/* Class = "NSMenuItem"; title = "Save"; ObjectID = "75"; */
"75.title" = "Save";
/* Class = "NSMenuItem"; title = "Page Setup…"; ObjectID = "77"; */
"77.title" = "Page Setup…";
/* Class = "NSMenuItem"; title = "Print…"; ObjectID = "78"; */
"78.title" = "Print…";
/* Class = "NSMenuItem"; title = "Save As…"; ObjectID = "80"; */
"80.title" = "Save As…";
/* Class = "NSMenu"; title = "File"; ObjectID = "81"; */
"81.title" = "File";
/* Class = "NSMenuItem"; title = "New"; ObjectID = "82"; */
"82.title" = "New";
/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */
"83.title" = "File";
/* Class = "NSMenuItem"; title = "Help"; ObjectID = "103"; */
"103.title" = "Help";
/* Class = "NSMenu"; title = "Help"; ObjectID = "106"; */
"106.title" = "Help";
/* Class = "NSMenuItem"; title = "Sparkle Test App Help"; ObjectID = "111"; */
"111.title" = "Sparkle Test App Help";
/* Class = "NSMenuItem"; title = "Revert"; ObjectID = "112"; */
"112.title" = "Revert";
/* Class = "NSMenuItem"; title = "Open Recent"; ObjectID = "124"; */
"124.title" = "Open Recent";
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
"125.title" = "Open Recent";
/* Class = "NSMenuItem"; title = "Clear Menu"; ObjectID = "126"; */
"126.title" = "Clear Menu";
/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */
"130.title" = "Services";
/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */
"131.title" = "Services";
/* Class = "NSMenuItem"; title = "Hide Sparkle Test App"; ObjectID = "134"; */
"134.title" = "Hide Sparkle Test App";
/* Class = "NSMenuItem"; title = "Quit Sparkle Test App"; ObjectID = "136"; */
"136.title" = "Quit Sparkle Test App";
/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */
"145.title" = "Hide Others";
/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */
"150.title" = "Show All";
/* Class = "NSMenuItem"; title = "Find…"; ObjectID = "154"; */
"154.title" = "Find…";
/* Class = "NSMenuItem"; title = "Jump to Selection"; ObjectID = "155"; */
"155.title" = "Jump to Selection";
/* Class = "NSMenuItem"; title = "Copy"; ObjectID = "157"; */
"157.title" = "Copy";
/* Class = "NSMenuItem"; title = "Undo"; ObjectID = "158"; */
"158.title" = "Undo";
/* Class = "NSMenu"; title = "Find"; ObjectID = "159"; */
"159.title" = "Find";
/* Class = "NSMenuItem"; title = "Cut"; ObjectID = "160"; */
"160.title" = "Cut";
/* Class = "NSMenuItem"; title = "Use Selection for Find"; ObjectID = "161"; */
"161.title" = "Use Selection for Find";
/* Class = "NSMenuItem"; title = "Find Previous"; ObjectID = "162"; */
"162.title" = "Find Previous";
/* Class = "NSMenuItem"; title = "Edit"; ObjectID = "163"; */
"163.title" = "Edit";
/* Class = "NSMenuItem"; title = "Delete"; ObjectID = "164"; */
"164.title" = "Delete";
/* Class = "NSMenuItem"; title = "Find Next"; ObjectID = "167"; */
"167.title" = "Find Next";
/* Class = "NSMenuItem"; title = "Find"; ObjectID = "168"; */
"168.title" = "Find";
/* Class = "NSMenu"; title = "Edit"; ObjectID = "169"; */
"169.title" = "Edit";
/* Class = "NSMenuItem"; title = "Paste"; ObjectID = "171"; */
"171.title" = "Paste";
/* Class = "NSMenuItem"; title = "Select All"; ObjectID = "172"; */
"172.title" = "Select All";
/* Class = "NSMenuItem"; title = "Redo"; ObjectID = "173"; */
"173.title" = "Redo";
/* Class = "NSMenuItem"; title = "Spelling"; ObjectID = "184"; */
"184.title" = "Spelling";
/* Class = "NSMenu"; title = "Spelling"; ObjectID = "185"; */
"185.title" = "Spelling";
/* Class = "NSMenuItem"; title = "Spelling…"; ObjectID = "187"; */
"187.title" = "Spelling…";
/* Class = "NSMenuItem"; title = "Check Spelling"; ObjectID = "189"; */
"189.title" = "Check Spelling";
/* Class = "NSMenuItem"; title = "Check Spelling as You Type"; ObjectID = "191"; */
"191.title" = "Check Spelling as You Type";
/* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "197"; */
"197.title" = "Zoom";
/* Class = "NSMenuItem"; title = "Paste and Match Style"; ObjectID = "204"; */
"204.title" = "Paste and Match Style";
/* Class = "NSMenuItem"; title = "Check for Updates…"; ObjectID = "207"; */
"207.title" = "Check for Updates…";
+3 -3
View File
@@ -71,10 +71,10 @@ class SUAppcastTest: XCTestCase {
XCTAssertEqual(latestDeltaItem!.fileURL!.lastPathComponent, "3.0_from_2.0.patch")
// Test a delta item that does not exist
var nonexistantDeltaItem: SUAppcastItem?
SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcastItems, getDeltaItem: &nonexistantDeltaItem, withHostVersion: "2.1", comparator: SUStandardVersionComparator())
var nonexistentDeltaItem: SUAppcastItem?
SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcastItems, getDeltaItem: &nonexistentDeltaItem, withHostVersion: "2.1", comparator: SUStandardVersionComparator())
XCTAssertNil(nonexistantDeltaItem)
XCTAssertNil(nonexistentDeltaItem)
} catch let err as NSError {
NSLog("%@", err)
XCTFail(err.localizedDescription)
+5 -5
View File
@@ -225,7 +225,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
}];
}
- (void)testSameNonexistantSymlinkDiff
- (void)testSameNonexistentSymlinkDiff
{
[self createAndApplyPatchWithHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
@@ -246,7 +246,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
}];
}
- (void)testDifferentNonexistantSymlinkDiff
- (void)testDifferentNonexistentSymlinkDiff
{
[self createAndApplyPatchWithHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
@@ -267,7 +267,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
}];
}
- (void)testNonexistantSymlinkPermissionDiff
- (void)testNonexistentSymlinkPermissionDiff
{
[self createAndApplyPatchWithBeforeDiffHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
@@ -309,7 +309,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
}];
}
- (void)testNonexistantSymlinkPermissionBadDiff
- (void)testNonexistentSymlinkPermissionBadDiff
{
// Even though destination has a 0777 symlink permission, we only respect 0755 for symlinks
[self createAndApplyPatchWithBeforeDiffHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
@@ -962,7 +962,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
NSNumber *permissionAttribute = attributes[NSFilePosixPermissions];
XCTAssertNotNil(permissionAttribute);
// Test default symlink permissons are correct
// Test default symlink permissions are correct
unsigned short permissions = permissionAttribute.unsignedShortValue & PERMISSION_FLAGS;
XCTAssertEqual(permissions, VALID_SYMBOLIC_LINK_PERMISSIONS);
}];
+15 -14
View File
@@ -140,7 +140,7 @@
#endif
];
return [v verifyFileAtPath:aFile signatures:sig error:error];
return [v verifyFileAtPath:aFile signatures:sig verifierInformation:nil error:error];
}
static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
@@ -167,7 +167,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
SUSignatures *sig = _createSignatures(sigString, nil);
return [v verifyFileAtPath:aFile signatures:sig error:error];
return [v verifyFileAtPath:aFile signatures:sig verifierInformation:nil error:error];
}
- (void)testVerifyFileWithBothKeys
@@ -180,10 +180,10 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
NSError *error = nil;
XCTAssertFalse([v verifyFileAtPath:_testFile
signatures:_createSignatures(nil, nil) error:&error],
signatures:_createSignatures(nil, nil) verifierInformation:nil error:&error],
@"Fail if no signatures are provided: %@", error);
XCTAssertFalse([v verifyFileAtPath:_testFile
signatures:_createSignatures(@"lol", @"lol") error:&error],
signatures:_createSignatures(@"lol", @"lol") verifierInformation:nil error:&error],
@"Fail if both signatures are invalid: %@", error);
NSString *dsaSig = @"MCwCFCIHCIYYkfZavNzTitTW5tlRp/k5AhQ40poFytqcVhIYdCxQznaXeJPJDQ==";
@@ -192,27 +192,27 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
NSString *wrongEdSig = @"wTcpXCgWoa4NrJpsfzS61FXJIbv963//12U2ef9xstzVOLPHYK2N4/ojgpDV5N1/NGG1uWMBgK+kEWp0Z5zMDQ==";
XCTAssertFalse([v verifyFileAtPath:_testFile
signatures:_createSignatures(nil, dsaSig) error:&error],
signatures:_createSignatures(nil, dsaSig) verifierInformation:nil error:&error],
@"EdDSA signature must be present if app has EdDSA key: %@", error);
XCTAssertTrue([v verifyFileAtPath:_testFile
signatures:_createSignatures(edSig, nil) error:&error],
signatures:_createSignatures(edSig, nil) verifierInformation:nil error:&error],
@"Allow just an EdDSA signature if that's all that's available: %@", error);
XCTAssertFalse([v verifyFileAtPath:_testFile
signatures:_createSignatures(wrongEdSig, dsaSig) error:&error],
signatures:_createSignatures(wrongEdSig, dsaSig) verifierInformation:nil error:&error],
@"Fail on a bad Ed25519 signature regardless: %@", error);
XCTAssertTrue([v verifyFileAtPath:_testFile
signatures:_createSignatures(edSig, wrongDSASig) error:&error],
signatures:_createSignatures(edSig, wrongDSASig) verifierInformation:nil error:&error],
@"Allow bad DSA signature if EdDSA signature is good: %@", error);
XCTAssertFalse([v verifyFileAtPath:_testFile
signatures:_createSignatures(@"lol", dsaSig) error:&error],
signatures:_createSignatures(@"lol", dsaSig) verifierInformation:nil error:&error],
@"Fail if the Ed25519 signature is invalid: %@", error);
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
XCTAssertFalse([v verifyFileAtPath:_testFile
signatures:_createSignatures(edSig, @"lol") error:&error],
signatures:_createSignatures(edSig, @"lol") verifierInformation:nil error:&error],
@"Fail if invalid DSA signature is used even if EdDSA signature is good: %@", error);
#else
XCTAssertTrue([v verifyFileAtPath:_testFile
@@ -221,7 +221,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
#endif
XCTAssertTrue([v verifyFileAtPath:_testFile
signatures:_createSignatures(edSig, dsaSig) error:&error],
signatures:_createSignatures(edSig, dsaSig) verifierInformation:nil error:&error],
@"Pass if both are valid: %@", error);
}
@@ -239,7 +239,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
SUSignatureVerifier *dsaOnlyVerifier = [[SUSignatureVerifier alloc] initWithPublicKeys:dsaOnlyKeys];
XCTAssertFalse([dsaOnlyVerifier verifyFileAtPath:_testFile
signatures:_createSignatures(edSig, nil) error:&error],
signatures:_createSignatures(edSig, nil) verifierInformation:nil error:&error],
@"DSA cannot verify an Ed signature: %@", error);
SUPublicKeys *edOnlyKeys = [[SUPublicKeys alloc] initWithEd:_pubEdKey
@@ -250,6 +250,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
SUSignatures *signatures = _createSignatures(nil, dsaSig);
XCTAssertFalse([edOnlyVerifier verifyFileAtPath:_testFile
signatures:signatures
verifierInformation:nil
error:&error],
@"Ed cannot verify an DSA signature: %@", error);
}
@@ -272,9 +273,9 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
NSError *error = nil;
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
XCTAssertTrue([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys error:&error], @"Expected valid signature: %@", error);
XCTAssertTrue([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys verifierInformation:nil error:&error], @"Expected valid signature: %@", error);
#else
XCTAssertFalse([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys error:&error], @"Expected verification to fail due to disabling DSA: %@", error);
XCTAssertFalse([SUSignatureVerifier validatePath:_testFile withSignatures:sig withPublicKeys:pubkeys verifierInformation:nil error:&error], @"Expected verification to fail due to disabling DSA: %@", error);
#endif
}
+6 -11
View File
@@ -24,10 +24,9 @@ class SUUnarchiverTest: XCTestCase
let unarchivedSuccessExpectation = super.expectation(description: "Unarchived Success (format: \(archiveExtension))")
let unarchivedFailureExpectation = super.expectation(description: "Unarchived Failure (format: \(archiveExtension))")
let tempArchiveURL = tempDirectoryURL.appendingPathComponent(archiveResourceURL.lastPathComponent)
let extractedAppURL = tempDirectoryURL.appendingPathComponent(extractedAppName).appendingPathExtension("app")
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, tempArchiveURL: tempArchiveURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
self.unarchiveNonExistentFileTestFailureAppWithExtension(archiveExtension, tempDirectoryURL: tempDirectoryURL, password: password, expectingInstallationType: installationType, testExpectation: unarchivedFailureExpectation)
super.waitForExpectations(timeout: 30.0, handler: nil)
@@ -40,7 +39,7 @@ class SUUnarchiverTest: XCTestCase
func unarchiveNonExistentFileTestFailureAppWithExtension(_ archiveExtension: String, tempDirectoryURL: URL, password: String?, expectingInstallationType installationType: String, testExpectation: XCTestExpectation) {
let tempArchiveURL = tempDirectoryURL.appendingPathComponent("error-invalid").appendingPathExtension(archiveExtension)
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
XCTAssertNotNil(error)
@@ -49,13 +48,9 @@ class SUUnarchiverTest: XCTestCase
}
// swiftlint:disable function_parameter_count
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, tempArchiveURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
let fileManager = FileManager.default
try! fileManager.copyItem(at: archiveResourceURL, to: tempArchiveURL)
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
let unarchiver = SUUnarchiver.unarchiver(forPath: archiveResourceURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
if expectingSuccess {
@@ -133,7 +128,7 @@ class SUUnarchiverTest: XCTestCase
#endif
#if SPARKLE_BUILD_PACKAGE_SUPPORT
func testUnarchivingFlatPackage()
func testUnarchivingBarePackage()
{
self.unarchiveTestAppWithExtension("pkg", resourceName: "test", expectingInstallationType: SPUInstallationTypeGuidedPackage)
+2 -2
View File
@@ -106,7 +106,7 @@ class SUUpdateValidatorTest: XCTestCase {
func testPrevalidation(bundle bundleConfig: BundleConfig, signatures signatureConfig: SignatureConfig, expectedResult: Bool, line: UInt = #line) {
let host = SUHost(bundle: self.bundle(bundleConfig))
let signatures = self.signatures(signatureConfig)
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host)
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host, verifierInformation: nil)
let result = (try? validator.validateDownloadPath()) != nil
XCTAssertEqual(result, expectedResult, "bundle: \(bundleConfig), signatures: \(signatureConfig)", line: line)
@@ -136,7 +136,7 @@ class SUUpdateValidatorTest: XCTestCase {
let host = SUHost(bundle: oldBundle)
let signatures = self.signatures(signatureConfig)
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host)
let validator = SUUpdateValidator(downloadPath: self.signedTestFilePath, signatures: signatures, host: host, verifierInformation: nil)
let updateDirectory = temporaryDirectory("SUUpdateValidatorTest")!
defer { try! FileManager.default.removeItem(atPath: updateDirectory) }
@@ -16,6 +16,7 @@
#import "SUVersionComparisonProtocol.h"
#import "SUStandardVersionComparator.h"
#import "SUUpdateValidator.h"
#import "SPUVerifierInformation.h"
#import "SUHost.h"
#import "SPUSkippedUpdate.h"
#import "SUSignatures.h"
+47
View File
@@ -0,0 +1,47 @@
//
// secret.swift
// Sparkle
//
// Created on 11/19/23.
// Copyright © 2023 Sparkle Project. All rights reserved.
//
import Foundation
func secretUsesRegularSeed(secret: Data) -> Bool {
return (secret.count == 32)
}
func secretUsesOldHashedSeed(secret: Data) -> Bool {
return (secret.count == 64 + 32)
}
// Secret is the data we store in the keychain
// For newer generated keys, secret is the private seed
// For older generated keys, secret is the private orlp/Ed25519 key concatenated with the public key
// If the secret is of invalid length, this returns nil
func decodePrivateAndPublicKeys(secret: Data) -> (privateKey: Data, publicKey: Data)? {
let privateKey: Data
let publicKey: Data
if secretUsesRegularSeed(secret: secret) {
let seed = secret
var privateEdKey = Array<UInt8>(repeating: 0, count: 64)
var publicEdKey = Array<UInt8>(repeating: 0, count: 32)
seed.withUnsafeBytes { seedBytes in
let seedBuffer: UnsafePointer<UInt8> = seedBytes.baseAddress!.assumingMemoryBound(to: UInt8.self)
ed25519_create_keypair(&publicEdKey, &privateEdKey, seedBuffer)
}
privateKey = Data(privateEdKey)
publicKey = Data(publicEdKey)
} else if secretUsesOldHashedSeed(secret: secret) {
privateKey = secret[0..<64]
publicKey = secret[64...]
} else {
return nil
}
return (privateKey, publicKey)
}
+1 -1
View File
@@ -44,7 +44,7 @@ extension FileHandle {
extension URL {
/// Calculates the SHA-256 hash of the file referened by the URL.
/// Calculates the SHA-256 hash of the file referenced by the URL.
///
/// - Returns: The SHA-256 hash of the file (as a hexadecimal string), or `nil` if
/// the URL doesn't point to a file.
+10 -33
View File
@@ -6,40 +6,17 @@
import Foundation
func unarchive(itemPath: URL, archiveDestDir: URL, callback: @escaping (Error?) -> Void) {
let fileManager = FileManager.default
let tempDir = archiveDestDir.appendingPathExtension("tmp")
let itemCopy = tempDir.appendingPathComponent(itemPath.lastPathComponent)
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemPath.path, extractionDirectory: archiveDestDir.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
unarchiver.unarchive(completionBlock: { (error: Error?) in
if error != nil {
callback(error)
return
}
_ = try? fileManager.createDirectory(at: tempDir, withIntermediateDirectories: true, attributes: [:])
do {
do {
try fileManager.linkItem(at: itemPath, to: itemCopy)
} catch {
try fileManager.copyItem(at: itemPath, to: itemCopy)
}
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemCopy.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
unarchiver.unarchive(completionBlock: { (error: Error?) in
if error != nil {
callback(error)
return
}
_ = try? fileManager.removeItem(at: itemCopy)
do {
try fileManager.moveItem(at: tempDir, to: archiveDestDir)
callback(nil)
} catch {
callback(error)
}
}, progressBlock: nil)
} else {
_ = try? fileManager.removeItem(at: itemCopy)
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemCopy)"))
}
} catch {
_ = try? fileManager.removeItem(at: tempDir)
callback(error)
callback(nil)
}, progressBlock: nil)
} else {
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemPath)"))
}
}
+40 -14
View File
@@ -9,18 +9,29 @@
import Foundation
import ArgumentParser
func loadPrivateKeys(_ account: String, _ privateDSAKey: SecKey?, _ privateEdString: String?) -> PrivateKeys {
func loadPrivateKeys(_ account: String, _ privateDSAKey: SecKey?, _ privateEdString: String?, allowNewPrivateKey: Bool) -> PrivateKeys? {
var privateEdKey: Data?
var publicEdKey: Data?
var item: CFTypeRef?
var keys: Data?
var secret: Data?
// private + public key is provided as argument
if let privateEdString = privateEdString {
if privateEdString.count == 128, let data = Data(base64Encoded: privateEdString) {
keys = data
// private + public key is provided as argument (for older format)
if let privateEdString {
if let data = Data(base64Encoded: privateEdString) {
if allowNewPrivateKey || secretUsesOldHashedSeed(secret: data) {
// We always allow the old format without private seed
secret = data
} else if !allowNewPrivateKey && secretUsesRegularSeed(secret: data) {
// Don't support deprecated option for newly generated keys
print("Error: specifying private key as the argument is no longer supported.")
return nil
} else {
print("Error: Private key not found in decoded argument, which has \(data.count) bytes. Please provide a valid key.")
return nil
}
} else {
print("Warning: Private key not found in the argument. Please provide a valid key.")
print("Error: Private key not found in the argument. Please provide a valid key.")
return nil
}
}
// get keys from kechain instead
@@ -32,16 +43,25 @@ func loadPrivateKeys(_ account: String, _ privateDSAKey: SecKey?, _ privateEdStr
kSecAttrProtocol as String: kSecAttrProtocolSSH,
kSecReturnData as String: kCFBooleanTrue!,
] as CFDictionary, &item)
if res == errSecSuccess, let encoded = item as? Data, let data = Data(base64Encoded: encoded) {
keys = data
if res == errSecSuccess, let encoded = item as? Data {
if let data = Data(base64Encoded: encoded) {
secret = data
} else {
print("Error: Failed to base64 decode secret data from keychain")
return nil
}
} else {
print("Warning: Private key for account \(account) not found in the Keychain (\(res)). Please run the generate_keys tool")
}
}
if let keys = keys {
privateEdKey = keys[0..<64]
publicEdKey = keys[64...]
if let secret {
guard let (privateKey, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
print("Error: Failed to decode private and public keys from secret data")
return nil
}
privateEdKey = privateKey
publicEdKey = publicKey
}
return PrivateKeys(privateDSAKey: privateDSAKey, privateEdKey: privateEdKey, publicEdKey: publicEdKey)
}
@@ -71,7 +91,7 @@ struct GenerateAppcast: ParsableCommand {
var privateDSAKeyName: String?
#endif
@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"))
@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. This option is no longer supported for newly generated keys.", valueName: "private-EdDSA-key"))
var privateEdString : String?
#if GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT
@@ -252,11 +272,13 @@ struct GenerateAppcast: ParsableCommand {
privateDSAKey = nil
#endif
let allowNewPrivateKey: Bool
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.")
allowNewPrivateKey = false
} else if let privateEdKeyPath = privateEdKeyPath {
do {
let privateKeyString: String
@@ -272,15 +294,19 @@ struct GenerateAppcast: ParsableCommand {
}
privateEdKeyString = privateKeyString
allowNewPrivateKey = true
} catch {
print("Unable to load EdDSA private key from", privateEdKeyPath, "\n", error)
throw ExitCode(1)
}
} else {
privateEdKeyString = nil
allowNewPrivateKey = true
}
let keys = loadPrivateKeys(account, privateDSAKey, privateEdKeyString)
guard let keys = loadPrivateKeys(account, privateDSAKey, privateEdKeyString, allowNewPrivateKey: allowNewPrivateKey) else {
throw ExitCode(1)
}
do {
let appcastsByFeed = try makeAppcasts(archivesSourceDir: archivesSourceDir, outputPathURL: outputPathURL, cacheDirectory: GenerateAppcast.cacheDirectory, keys: keys, versions: versions, maxVersionsPerBranchInFeed: maxVersionsPerBranchInFeed, newChannel: channel, majorVersion: majorVersion, maximumDeltas: maximumDeltas, deltaCompressionModeDescription: deltaCompression, deltaCompressionLevel: deltaCompressionLevel, disableNestedCodeCheck: disableNestedCodeCheck, downloadURLPrefix: downloadURLPrefix, releaseNotesURLPrefix: releaseNotesURLPrefix, verbose: verbose)
+32 -28
View File
@@ -40,7 +40,7 @@ private func failure(_ message: String) -> Never {
exit(1)
}
func findKeyPair(account: String) -> Data? {
func findSecret(account: String) -> Data? {
var item: CFTypeRef?
let res = SecItemCopyMatching(commonKeychainItemAttributes(account: account).merging([
/// Return a matched item's value as a CFData object.
@@ -49,8 +49,8 @@ func findKeyPair(account: String) -> Data? {
switch res {
case errSecSuccess:
if let keys = (item as? Data).flatMap({ Data(base64Encoded: $0) }) {
return keys
if let secret = (item as? Data).flatMap({ Data(base64Encoded: $0) }) {
return secret
} else {
failure("""
Item found, but is corrupt or has been overwritten!
@@ -89,7 +89,7 @@ func findKeyPair(account: String) -> Data? {
exit(1)
}
func generateKeyPair() -> (publicEdKey: Data, privateEdKey: Data) {
func generatePublicKeyAndSeed() -> (publicEdKey: Data, seed: Data) {
var seed = Array<UInt8>(repeating: 0, count: 32)
var publicEdKey = Array<UInt8>(repeating: 0, count: 32)
var privateEdKey = Array<UInt8>(repeating: 0, count: 64)
@@ -99,10 +99,10 @@ func generateKeyPair() -> (publicEdKey: Data, privateEdKey: Data) {
}
ed25519_create_keypair(&publicEdKey, &privateEdKey, seed)
return (Data(publicEdKey), Data(privateEdKey))
return (Data(publicEdKey), Data(seed))
}
func storeKeyPair(account: String, publicEdKey: Data, privateEdKey: Data) {
func storeSecret(account: String, publicEdKey: Data, secret: Data) {
let query = commonKeychainItemAttributes(account: account).merging([
/// Mark the new item as sensitive (requires keychain password to export - e.g. a private key).
kSecAttrIsSensitive as String: kCFBooleanTrue!,
@@ -121,7 +121,7 @@ func storeKeyPair(account: String, publicEdKey: Data, privateEdKey: Data) {
kSecAttrDescription as String: "private key",
/// The actual data content of the new item.
kSecValueData as String: (privateEdKey + publicEdKey).base64EncodedData() as CFData
kSecValueData as String: secret.base64EncodedData() as CFData
], uniquingKeysWith: { $1 }) as CFDictionary
@@ -163,7 +163,7 @@ struct GenerateKeys: ParsableCommand {
@Flag(name: .customShort("p"), help: ArgumentHelp("Looks up and just prints the existing public key stored in the Keychain."))
var lookUpPublicKey: Bool = false
@Option(name: .customShort("x"), help: ArgumentHelp("Exports your private key from your login keychain and writes it to private-key-file. Note the contents of this sensitive exported file are the same as the password to the \"\(PRIVATE_KEY_LABEL)\" item in your keychain.", valueName: "private-key-file"))
@Option(name: .customShort("x"), help: ArgumentHelp("Exports your private key from your login keychain and writes it to private-key-file. Note the contents of this sensitive exported file are the same as the password to the \"\(PRIVATE_KEY_LABEL)\" item in your keychain. For advanced usage if the private key is generated in the new format (i.e. the key file after base64 decoding is 32 bytes), then the exported key file is the base64 encoding of the private seed. The seed can be used to create the private/public keypair with other tools that support EdDSA signing.", valueName: "private-key-file"))
var exportedPrivateKeyFile: String?
@Option(name: .customShort("f"), help: ArgumentHelp("Imports the private key from private-key-file into your keychain instead of generating a new key. This file has likely been exported via -x option from another machine. Any existing \"\(PRIVATE_KEY_LABEL)\" items listed in Keychain Access may need to be removed manually first before proceeding.", valueName: "private-key-file"))
@@ -206,8 +206,10 @@ struct GenerateKeys: ParsableCommand {
func run() throws {
if lookUpPublicKey {
/// Lookup mode - print just the pubkey and exit
if let keyPair = findKeyPair(account: account) {
let pubKey = keyPair[64...]
if let secret = findSecret(account: account) {
guard let (_, pubKey) = decodePrivateAndPublicKeys(secret: secret) else {
failure("Stored private key must be 32 or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
}
print(pubKey.base64EncodedString())
} else {
failure("No existing signing key found!")
@@ -219,45 +221,45 @@ struct GenerateKeys: ParsableCommand {
failure("private-key-file already exists: \(exportURL.path)")
}
guard let keyPair = findKeyPair(account: account) else {
guard let secret = findSecret(account: account) else {
failure("No existing signing key found!")
}
do {
try keyPair.base64EncodedString().write(to: exportURL, atomically: true, encoding: .utf8)
try secret.base64EncodedString().write(to: exportURL, atomically: true, encoding: .utf8)
} catch {
failure("Failed to write exported file: \(error)")
}
} else if let importedPrivateKeyFile = importedPrivateKeyFile {
/// Import mode - import the specifed key-pair file
let privateAndPublicBase64KeyFile = importedPrivateKeyFile
let privateAndPublicBase64Key: String
/// Import mode - import the specified key-pair file
let secretBase64File = importedPrivateKeyFile
let secretBase64: String
do {
privateAndPublicBase64Key = try String(contentsOfFile: privateAndPublicBase64KeyFile)
secretBase64 = try String(contentsOfFile: secretBase64File)
} catch {
failure("Failed to read private-key-file: \(error)")
}
guard let privateAndPublicKey = Data(base64Encoded: privateAndPublicBase64Key.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
failure("Failed to decode base64 encoded key data from: \(privateAndPublicBase64Key)")
guard let secret = Data(base64Encoded: secretBase64.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
failure("Failed to decode base64 encoded key data from: \(secretBase64)")
}
guard privateAndPublicKey.count == 64 + 32 else {
failure("Imported key must be 96 bytes decoded. Instead it is \(privateAndPublicKey.count) bytes decoded.")
guard let (_, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
failure("Imported key must be 32 or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
}
print("Importing signing key..\n")
let publicKey = privateAndPublicKey[64...]
let privateKey = privateAndPublicKey[0..<64]
storeKeyPair(account: account, publicEdKey: publicKey, privateEdKey: privateKey)
storeSecret(account: account, publicEdKey: publicKey, secret: secret)
printNewPublicKeyUsage(publicKey)
} else {
/// Default mode - find an existing public key and print its usage, or generate new keys
if let keyPair = findKeyPair(account: account) {
let pubKey = keyPair[64...]
if let secret = findSecret(account: account) {
guard let (_, pubKey) = decodePrivateAndPublicKeys(secret: secret) else {
failure("Stored private key must be 32 or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
}
print("""
A pre-existing signing key was found. This is how it should appear in your Info.plist:
@@ -268,8 +270,10 @@ struct GenerateKeys: ParsableCommand {
} else {
print("Generating a new signing key. This may take a moment, depending on your machine.")
let (pubKey, privKey) = generateKeyPair()
storeKeyPair(account: account, publicEdKey: pubKey, privateEdKey: privKey)
let (pubKey, seed) = generatePublicKeyAndSeed()
// New keys that are generated only store the seed as the secret
// Old keys store private orlp/Ed25519 key + public key
storeSecret(account: account, publicEdKey: pubKey, secret: seed)
printNewPublicKeyUsage(pubKey)
}
+34 -17
View File
@@ -19,8 +19,23 @@ func findKeysInKeychain(account: String) throws -> (Data, Data) {
kSecAttrProtocol as String: kSecAttrProtocolSSH,
kSecReturnData as String: kCFBooleanTrue!,
] as CFDictionary, &item)
if res == errSecSuccess, let encoded = item as? Data, let keys = Data(base64Encoded: encoded) {
return (keys[0..<64], keys[64..<(64+32)])
if res == errSecSuccess {
guard let encoded = item as? Data else {
print("ERROR! Unable to decode data from Keychain")
throw ExitCode.failure
}
guard let secret = Data(base64Encoded: encoded) else {
print("ERROR! Unable to decode data from Keychain as base64")
throw ExitCode.failure
}
guard let (privateKey, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
print("ERROR! Key pair data stored in keychain has \(secret.count) bytes which is invalid")
throw ExitCode.failure
}
return (privateKey, publicKey)
} else if res == errSecItemNotFound {
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 {
@@ -36,34 +51,36 @@ func findKeysInKeychain(account: String) throws -> (Data, Data) {
throw ExitCode.failure
}
func findKeys(inFile privateAndPublicBase64KeyFile: String) throws -> (Data, Data) {
let privateAndPublicBase64Key: String
if privateAndPublicBase64KeyFile == "-" && !FileManager.default.fileExists(atPath: privateAndPublicBase64KeyFile) {
func findKeys(inFile secretFile: String) throws -> (Data, Data) {
let secretString: String
if secretFile == "-" && !FileManager.default.fileExists(atPath: secretFile) {
if let line = readLine(strippingNewline: true) {
privateAndPublicBase64Key = line
secretString = line
} else {
print("ERROR! Unable to read EdDSA private key from standard input")
throw ExitCode(1)
}
} else {
privateAndPublicBase64Key = try String(contentsOfFile: privateAndPublicBase64KeyFile)
secretString = try String(contentsOfFile: secretFile)
}
return try findKeys(inString: privateAndPublicBase64Key)
return try findKeys(inString: secretString, allowNewFormat: true)
}
func findKeys(inString privateAndPublicBase64Key: String) throws -> (Data, Data) {
guard let privateAndPublicKey = Data(base64Encoded: privateAndPublicBase64Key.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
print("ERROR! Failed to decode base64 encoded key data from: \(privateAndPublicBase64Key)")
func findKeys(inString secretBase64String: String, allowNewFormat: Bool) throws -> (Data, Data) {
guard let secret = Data(base64Encoded: secretBase64String.trimmingCharacters(in: .whitespacesAndNewlines), options: .init()) else {
print("ERROR! Failed to decode base64 encoded key data from: \(secretBase64String)")
throw ExitCode.failure
}
guard privateAndPublicKey.count == 64 + 32 else {
print("ERROR! Imported key must be 96 bytes decoded. Instead it is \(privateAndPublicKey.count) bytes decoded.")
guard allowNewFormat || !secretUsesRegularSeed(secret: secret) else {
print("ERROR! Specifying private key as an argument is no longer supported.")
throw ExitCode.failure
}
let publicKey = privateAndPublicKey[64...]
let privateKey = privateAndPublicKey[0..<64]
guard let (privateKey, publicKey) = decodePrivateAndPublicKeys(secret: secret) else {
print("ERROR! Imported key must be 64 bytes or 96 bytes (for the older format) decoded. Instead it is \(secret.count) bytes decoded.")
throw ExitCode.failure
}
return (privateKey, publicKey)
}
@@ -100,7 +117,7 @@ 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"))
@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. This option is no longer supported for newly generated keys. ", valueName: "private-key"))
var privateKey: String?
static var configuration: CommandConfiguration = CommandConfiguration(
@@ -127,7 +144,7 @@ struct SignUpdate: ParsableCommand {
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)
(priv, pub) = try findKeys(inString: privateKey, allowNewFormat: false)
} else if let privateKeyFile = privateKeyFile {
(priv, pub) = try findKeys(inFile: privateKeyFile)
} else {