mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-28 05:14:34 +00:00
Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5a9c0a1f1 | ||
|
|
57c3732f7d | ||
|
|
0155c78a99 | ||
|
|
d41b8652ee | ||
|
|
821b0ff37f | ||
|
|
c9c08b7f42 | ||
|
|
7c8fe1d427 | ||
|
|
5528d7f9ec | ||
|
|
419552a7d3 | ||
|
|
c23d74d8e0 | ||
|
|
456a3d4275 | ||
|
|
87e4fcbac3 | ||
|
|
2af0fa916c | ||
|
|
8039288f64 | ||
|
|
4ca2e2eb21 | ||
|
|
f7567e5a69 | ||
|
|
7907f058bc | ||
|
|
4a322e0ab4 | ||
|
|
270582b2e7 | ||
|
|
91a2c1c100 | ||
|
|
53d58921ef | ||
|
|
e15324773f |
No files matched your search
@@ -10,18 +10,18 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
xcode: ['xcode14.2', 'xcode13.4.1']
|
xcode: ['xcode14.3.1', 'xcode15']
|
||||||
include:
|
include:
|
||||||
- xcode: 'xcode13.4.1'
|
- xcode: 'xcode15'
|
||||||
xcode-path: '/Applications/Xcode_13.4.1.app/Contents/Developer'
|
xcode-path: '/Applications/Xcode_15.0.app/Contents/Developer'
|
||||||
upload-dist: false
|
upload-dist: false
|
||||||
run-analyzer: true
|
run-analyzer: true
|
||||||
macos: 'macos-12'
|
macos: 'macos-13'
|
||||||
- xcode: 'xcode14.2'
|
- xcode: 'xcode14.3.1'
|
||||||
xcode-path: '/Applications/Xcode_14.2.app/Contents/Developer'
|
xcode-path: '/Applications/Xcode_14.3.1.app/Contents/Developer'
|
||||||
upload-dist: true
|
upload-dist: true
|
||||||
run-analyzer: false
|
run-analyzer: false
|
||||||
macos: 'macos-12'
|
macos: 'macos-13'
|
||||||
|
|
||||||
name: Build and Test Sparkle
|
name: Build and Test Sparkle
|
||||||
runs-on: ${{ matrix.macos }}
|
runs-on: ${{ matrix.macos }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: "Create Draft Release"
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
BUILDDIR: "build"
|
BUILDDIR: "build"
|
||||||
DEVELOPER_DIR: "/Applications/Xcode_14.2.app/Contents/Developer"
|
DEVELOPER_DIR: "/Applications/Xcode_14.3.1.app/Contents/Developer"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -29,7 +29,7 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: "Publish binaries for release"
|
name: "Publish binaries for release"
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout sources"
|
- name: "Checkout sources"
|
||||||
|
|||||||
@@ -350,12 +350,55 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resolve the bookmark data for the downloaded update
|
||||||
|
|
||||||
|
BOOL isStale = NO;
|
||||||
|
NSError *bookmarkError = nil;
|
||||||
|
NSURL *downloadURL = [NSURL URLByResolvingBookmarkData:installationData.updateURLBookmarkData options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:&isStale error:&bookmarkError];
|
||||||
|
if (downloadURL == nil) {
|
||||||
|
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Error: Failed to resolve bookmark data from downloaded update", NSUnderlyingErrorKey: bookmarkError }]];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate the download URL before moving it
|
||||||
|
{
|
||||||
|
NSArray<NSString *> *downloadURLPathComponents = downloadURL.URLByResolvingSymlinksInPath.pathComponents;
|
||||||
|
if (downloadURLPathComponents == nil) {
|
||||||
|
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Error: Failed to retrieve path components from download URL" }]];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([downloadURLPathComponents containsObject:@".."]) {
|
||||||
|
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Error: download URL path components contains '..' which is unsafe" }]];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![downloadURLPathComponents containsObject:@SPARKLE_BUNDLE_IDENTIFIER] || ![downloadURLPathComponents containsObject:@"PersistentDownloads"]) {
|
||||||
|
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Error: download URL path components does not contain PersistentDownloads or "@SPARKLE_BUNDLE_IDENTIFIER }]];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isStale) {
|
||||||
|
SULog(SULogLevelError, @"Error: bookmark data for update download is stale.. but still continuing.");
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *downloadName = downloadURL.lastPathComponent;
|
||||||
|
if (downloadName == nil) {
|
||||||
|
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Error: Failed to retrieve download name from download URL" }]];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Move the download archive to somewhere where probably only we will be touching it
|
// Move the download archive to somewhere where probably only we will be touching it
|
||||||
// This prevents eg: if a bug exists in the updater that removes files we are trying to install
|
// This prevents eg: if a bug exists in the updater that removes files we are trying to install
|
||||||
// When this tool is ran as root, we are moving it into a directory that only root will have access to
|
// When this tool is ran as root, we are moving it into a directory that only root will have access to
|
||||||
NSURL *downloadURL = [[NSURL fileURLWithPath:installationData.updateDirectoryPath] URLByAppendingPathComponent:installationData.downloadName];
|
|
||||||
|
|
||||||
NSURL *downloadDestinationURL = [[NSURL fileURLWithPath:cacheInstallationPath] URLByAppendingPathComponent:installationData.downloadName];
|
NSURL *downloadDestinationURL = [[NSURL fileURLWithPath:cacheInstallationPath] URLByAppendingPathComponent:downloadName];
|
||||||
|
|
||||||
NSError *moveError = nil;
|
NSError *moveError = nil;
|
||||||
if (![[[SUFileManager alloc] init] moveItemAtURL:downloadURL toURL:downloadDestinationURL error:&moveError]) {
|
if (![[[SUFileManager alloc] init] moveItemAtURL:downloadURL toURL:downloadDestinationURL error:&moveError]) {
|
||||||
@@ -389,7 +432,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
// Some of our properties may slightly differ than our input and we don't want to make the mistake of using one of those
|
// 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->_installationType = installationType;
|
||||||
self->_relaunchPath = installationData.relaunchPath;
|
self->_relaunchPath = installationData.relaunchPath;
|
||||||
self->_downloadName = installationData.downloadName;
|
self->_downloadName = downloadName;
|
||||||
self->_signatures = installationData.signatures;
|
self->_signatures = installationData.signatures;
|
||||||
self->_updateDirectoryPath = cacheInstallationPath;
|
self->_updateDirectoryPath = cacheInstallationPath;
|
||||||
self->_host = [[SUHost alloc] initWithBundle:hostBundle];
|
self->_host = [[SUHost alloc] initWithBundle:hostBundle];
|
||||||
|
|||||||
@@ -22,12 +22,11 @@ SPU_OBJC_DIRECT_MEMBERS @interface SPUInstallationInputData : NSObject <NSSecure
|
|||||||
* signatures - signatures for the update that came from the appcast item
|
* signatures - signatures for the update that came from the appcast item
|
||||||
* decryptionPassword - optional decryption password for dmg archives
|
* decryptionPassword - optional decryption password for dmg archives
|
||||||
*/
|
*/
|
||||||
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateDirectoryPath:(NSString *)updateDirectoryPath downloadName:(NSString *)downloadName 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;
|
||||||
|
|
||||||
@property (nonatomic, copy, readonly) NSString *relaunchPath;
|
@property (nonatomic, copy, readonly) NSString *relaunchPath;
|
||||||
@property (nonatomic, copy, readonly) NSString *hostBundlePath;
|
@property (nonatomic, copy, readonly) NSString *hostBundlePath;
|
||||||
@property (nonatomic, copy, readonly) NSString *updateDirectoryPath;
|
@property (nonatomic, copy, readonly) NSData *updateURLBookmarkData;
|
||||||
@property (nonatomic, copy, readonly) NSString *downloadName;
|
|
||||||
@property (nonatomic, copy, readonly) NSString *installationType;
|
@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, 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 *decryptionPassword;
|
||||||
|
|||||||
@@ -14,8 +14,7 @@
|
|||||||
|
|
||||||
static NSString *SURelaunchPathKey = @"SURelaunchPath";
|
static NSString *SURelaunchPathKey = @"SURelaunchPath";
|
||||||
static NSString *SUHostBundlePathKey = @"SUHostBundlePath";
|
static NSString *SUHostBundlePathKey = @"SUHostBundlePath";
|
||||||
static NSString *SUUpdateDirectoryPathKey = @"SUUpdateDirectoryPath";
|
static NSString *SUUpdateURLBookmarkDataKey = @"SUUpdateURLBookmarkData";
|
||||||
static NSString *SUDownloadNameKey = @"SUDownloadName";
|
|
||||||
static NSString *SUSignaturesKey = @"SUSignatures";
|
static NSString *SUSignaturesKey = @"SUSignatures";
|
||||||
static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword";
|
static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword";
|
||||||
static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
||||||
@@ -24,20 +23,18 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
|||||||
|
|
||||||
@synthesize relaunchPath = _relaunchPath;
|
@synthesize relaunchPath = _relaunchPath;
|
||||||
@synthesize hostBundlePath = _hostBundlePath;
|
@synthesize hostBundlePath = _hostBundlePath;
|
||||||
@synthesize updateDirectoryPath = _updateDirectoryPath;
|
@synthesize updateURLBookmarkData = _updateURLBookmarkData;
|
||||||
@synthesize downloadName = _downloadName;
|
|
||||||
@synthesize signatures = _signatures;
|
@synthesize signatures = _signatures;
|
||||||
@synthesize decryptionPassword = _decryptionPassword;
|
@synthesize decryptionPassword = _decryptionPassword;
|
||||||
@synthesize installationType = _installationType;
|
@synthesize installationType = _installationType;
|
||||||
|
|
||||||
- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateDirectoryPath:(NSString *)updateDirectoryPath downloadName:(NSString *)downloadName 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
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_relaunchPath = [relaunchPath copy];
|
_relaunchPath = [relaunchPath copy];
|
||||||
_hostBundlePath = [hostBundlePath copy];
|
_hostBundlePath = [hostBundlePath copy];
|
||||||
_updateDirectoryPath = [updateDirectoryPath copy];
|
_updateURLBookmarkData = updateURLBookmarkData;
|
||||||
_downloadName = [downloadName copy];
|
|
||||||
|
|
||||||
_installationType = [installationType copy];
|
_installationType = [installationType copy];
|
||||||
assert(SPUValidInstallationType(_installationType));
|
assert(SPUValidInstallationType(_installationType));
|
||||||
@@ -60,13 +57,8 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *updateDirectoryPath = [decoder decodeObjectOfClass:[NSString class] forKey:SUUpdateDirectoryPathKey];
|
NSData *updateURLBookmarkData = [decoder decodeObjectOfClass:[NSData class] forKey:SUUpdateURLBookmarkDataKey];
|
||||||
if (updateDirectoryPath == nil) {
|
if (updateURLBookmarkData == nil) {
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString *downloadName = [decoder decodeObjectOfClass:[NSString class] forKey:SUDownloadNameKey];
|
|
||||||
if (downloadName == nil) {
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,16 +74,15 @@ static NSString *SUInstallationTypeKey = @"SUInstallationType";
|
|||||||
|
|
||||||
NSString *decryptionPassword = [decoder decodeObjectOfClass:[NSString class] forKey:SUDecryptionPasswordKey];
|
NSString *decryptionPassword = [decoder decodeObjectOfClass:[NSString class] forKey:SUDecryptionPasswordKey];
|
||||||
|
|
||||||
return [self initWithRelaunchPath:relaunchPath hostBundlePath:hostBundlePath updateDirectoryPath:updateDirectoryPath downloadName:downloadName installationType:installationType signatures:signatures decryptionPassword:decryptionPassword];
|
return [self initWithRelaunchPath:relaunchPath hostBundlePath:hostBundlePath updateURLBookmarkData:updateURLBookmarkData installationType:installationType signatures:signatures decryptionPassword:decryptionPassword];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)encodeWithCoder:(NSCoder *)coder
|
- (void)encodeWithCoder:(NSCoder *)coder
|
||||||
{
|
{
|
||||||
[coder encodeObject:_relaunchPath forKey:SURelaunchPathKey];
|
[coder encodeObject:_relaunchPath forKey:SURelaunchPathKey];
|
||||||
[coder encodeObject:_hostBundlePath forKey:SUHostBundlePathKey];
|
[coder encodeObject:_hostBundlePath forKey:SUHostBundlePathKey];
|
||||||
[coder encodeObject:_updateDirectoryPath forKey:SUUpdateDirectoryPathKey];
|
[coder encodeObject:_updateURLBookmarkData forKey:SUUpdateURLBookmarkDataKey];
|
||||||
[coder encodeObject:_installationType forKey:SUInstallationTypeKey];
|
[coder encodeObject:_installationType forKey:SUInstallationTypeKey];
|
||||||
[coder encodeObject:_downloadName forKey:SUDownloadNameKey];
|
|
||||||
[coder encodeObject:_signatures forKey:SUSignaturesKey];
|
[coder encodeObject:_signatures forKey:SUSignaturesKey];
|
||||||
if (_decryptionPassword != nil) {
|
if (_decryptionPassword != nil) {
|
||||||
[coder encodeObject:_decryptionPassword forKey:SUDecryptionPasswordKey];
|
[coder encodeObject:_decryptionPassword forKey:SUDecryptionPasswordKey];
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
|||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Diffing code signed extended attributes are not supported. Detected extended attribute in before-tree on file %@", @(ent->fts_path)] }];
|
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Diffing code signed extended attributes are not supported. Detected extended attribute in before-tree on file %@. For removing code signed extended attributes and improving your bundle's structure, please see https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle", @(ent->fts_path)] }];
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
@@ -616,7 +616,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
|||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Diffing code signed extended attributes are not supported. Detected extended attribute in after-tree on file %@", @(ent->fts_path)] }];
|
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Diffing code signed extended attributes are not supported. Detected extended attribute in after-tree on file %@. For removing code signed extended attributes and improving your bundle's structure, please see https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle", @(ent->fts_path)] }];
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,18 +62,8 @@
|
|||||||
NSArray *contents = nil;
|
NSArray *contents = nil;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Using NSUUID would make creating UUIDs be done in Cocoa,
|
NSString *uuidString = [[NSUUID UUID] UUIDString];
|
||||||
// and thus managed under ARC. Sadly, the class is in 10.8 and later.
|
mountPoint = [@"/Volumes" stringByAppendingPathComponent:uuidString];
|
||||||
CFUUIDRef uuid = CFUUIDCreate(NULL);
|
|
||||||
if (uuid)
|
|
||||||
{
|
|
||||||
NSString *uuidString = CFBridgingRelease(CFUUIDCreateString(NULL, uuid));
|
|
||||||
if (uuidString)
|
|
||||||
{
|
|
||||||
mountPoint = [@"/Volumes" stringByAppendingPathComponent:uuidString];
|
|
||||||
}
|
|
||||||
CFRelease(uuid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Note: this check does not follow symbolic links, which is what we want
|
// Note: this check does not follow symbolic links, which is what we want
|
||||||
while ([[NSURL fileURLWithPath:mountPoint] checkResourceIsReachableAndReturnError:NULL]);
|
while ([[NSURL fileURLWithPath:mountPoint] checkResourceIsReachableAndReturnError:NULL]);
|
||||||
|
|||||||
@@ -1,3 +1,26 @@
|
|||||||
|
# 2.5.0
|
||||||
|
|
||||||
|
* Add ability to adapt release notes based on the currently installed version (#2373) (Nathan Manceaux-Panot)
|
||||||
|
* Allow developers to use custom URL schemes in the release notes view (#2393) (Zorg)
|
||||||
|
* Adopt cooperative app activation APIs in macOS 14 Sonoma (#2409) (Zorg)
|
||||||
|
* Replace CFUUID* with NSUUID (#2395) (Eitot)
|
||||||
|
* Fix KVO usage for updaterController.updater.* (#2404) (Zorg)
|
||||||
|
* Report an error when detecting duplicate updates in generate_appcast (#2407) (Zorg)
|
||||||
|
* Improve error for rejecting xattr based code signing for delta updates (#2408) (Zorg)
|
||||||
|
|
||||||
|
# 2.4.2
|
||||||
|
|
||||||
|
* Ignore release notes download when we shouldn't show release notes (#2381) (Zorg)
|
||||||
|
* Fix NSKeyedUnarchiver warning for not specifying keyed NSString class (#2381) (Zorg)
|
||||||
|
* Harden verification of Sparkle update download (#2392) (Zorg)
|
||||||
|
|
||||||
|
# 2.4.1
|
||||||
|
|
||||||
|
* Remove auxiliary apps and relocate symbols in SPM package to resolve missing AvailableLibraries warnings (#2356) (Zorg)
|
||||||
|
* Add -Wno-declaration-after-statement to silence warnings that only apply to pre-C99 (#2345) (Kent Sutherland)
|
||||||
|
* Fix compile error when setting SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE=0 (#2346) (Zorg)
|
||||||
|
* Improve how downloaded update is passed to the installer (#2359) (Zorg)
|
||||||
|
|
||||||
# 2.4.0
|
# 2.4.0
|
||||||
|
|
||||||
* Reduce code size
|
* Reduce code size
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "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"}
|
{"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"}
|
||||||
@@ -60,6 +60,7 @@ ARCHS = $(ARCHS_STANDARD)
|
|||||||
SPARKLE_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle
|
SPARKLE_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle
|
||||||
SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate
|
SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate
|
||||||
SPARKLE_INSTALLER_PROGRESS_TOOL_NAME = Updater
|
SPARKLE_INSTALLER_PROGRESS_TOOL_NAME = Updater
|
||||||
|
SPARKLE_INSTALLER_PROGRESS_TOOL_BUNDLE_ID = $(SPARKLE_BUNDLE_IDENTIFIER).$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)
|
||||||
|
|
||||||
// Set these if you want to use custom name for the XPC Services
|
// Set these if you want to use custom name for the XPC Services
|
||||||
// For the Installer one in particular, this name may show up in an authorization prompt
|
// For the Installer one in particular, this name may show up in an authorization prompt
|
||||||
@@ -90,13 +91,13 @@ SPARKLE_ICON_NAME = AppIcon
|
|||||||
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
|
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
|
||||||
// These variables must have a space after the '=' too
|
// These variables must have a space after the '=' too
|
||||||
SPARKLE_VERSION_MAJOR = 2
|
SPARKLE_VERSION_MAJOR = 2
|
||||||
SPARKLE_VERSION_MINOR = 4
|
SPARKLE_VERSION_MINOR = 5
|
||||||
SPARKLE_VERSION_PATCH = 0
|
SPARKLE_VERSION_PATCH = 0
|
||||||
|
|
||||||
// This should be in SemVer format or empty, ie. "-beta.1"
|
// This should be in SemVer format or empty, ie. "-beta.1"
|
||||||
// These variables must have a space after the '=' too
|
// These variables must have a space after the '=' too
|
||||||
SPARKLE_VERSION_SUFFIX =
|
SPARKLE_VERSION_SUFFIX = -beta.1
|
||||||
CURRENT_PROJECT_VERSION = 2025
|
CURRENT_PROJECT_VERSION = 2029
|
||||||
|
|
||||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO
|
ALWAYS_SEARCH_USER_PATHS = NO
|
||||||
@@ -106,7 +107,7 @@ GCC_INLINES_ARE_PRIVATE_EXTERN = YES
|
|||||||
PRODUCT_NAME = ${TARGET_NAME}
|
PRODUCT_NAME = ${TARGET_NAME}
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier}
|
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier}
|
||||||
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPU_OBJC_DIRECT=__attribute__((objc_direct)) SPU_OBJC_DIRECT_MEMBERS=__attribute__((objc_direct_members)) SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_BUILD_UI_BITS=$(SPARKLE_BUILD_UI_BITS) SPARKLE_COPY_LOCALIZATIONS=$(SPARKLE_COPY_LOCALIZATIONS) SPARKLE_BUILD_LEGACY_SUUPDATER=$(SPARKLE_BUILD_LEGACY_SUUPDATER) SPARKLE_BUILD_PACKAGE_SUPPORT=$(SPARKLE_BUILD_PACKAGE_SUPPORT) SPARKLE_BUILD_DMG_SUPPORT=$(SPARKLE_BUILD_DMG_SUPPORT) SPARKLE_BUILD_LEGACY_DELTA_SUPPORT=$(SPARKLE_BUILD_LEGACY_DELTA_SUPPORT) SPARKLE_BUILD_BZIP2_DELTA_SUPPORT=$(SPARKLE_BUILD_BZIP2_DELTA_SUPPORT) SPARKLE_BUILD_LEGACY_DSA_SUPPORT=$(SPARKLE_BUILD_LEGACY_DSA_SUPPORT) GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT=$(GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" CURRENT_PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\" MARKETING_VERSION=\"$(MARKETING_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_NAME=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)\" SPARKLE_ICON_NAME=\"$(SPARKLE_ICON_NAME)\" INSTALLER_LAUNCHER_NAME=\"${INSTALLER_LAUNCHER_NAME}\" INSTALLER_LAUNCHER_BUNDLE_ID=\"${INSTALLER_LAUNCHER_BUNDLE_ID}\" INSTALLER_LAUNCHER_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_INSTALLER_LAUNCHER_XPC_SERVICE) INSTALLER_CONNECTION_NAME=\"${INSTALLER_CONNECTION_NAME}\" INSTALLER_CONNECTION_BUNDLE_ID=\"${INSTALLER_CONNECTION_BUNDLE_ID}\" INSTALLER_CONNECTION_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_INSTALLER_CONNECTION_XPC_SERVICE) INSTALLER_STATUS_NAME=\"${INSTALLER_STATUS_NAME}\" INSTALLER_STATUS_BUNDLE_ID=\"${INSTALLER_STATUS_BUNDLE_ID}\" INSTALLER_STATUS_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_INSTALLER_STATUS_XPC_SERVICE) DOWNLOADER_NAME=\"${DOWNLOADER_NAME}\" DOWNLOADER_BUNDLE_ID=\"${DOWNLOADER_BUNDLE_ID}\" DOWNLOADER_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE)
|
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPU_OBJC_DIRECT=__attribute__((objc_direct)) SPU_OBJC_DIRECT_MEMBERS=__attribute__((objc_direct_members)) SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_BUILD_UI_BITS=$(SPARKLE_BUILD_UI_BITS) SPARKLE_COPY_LOCALIZATIONS=$(SPARKLE_COPY_LOCALIZATIONS) SPARKLE_BUILD_LEGACY_SUUPDATER=$(SPARKLE_BUILD_LEGACY_SUUPDATER) SPARKLE_BUILD_PACKAGE_SUPPORT=$(SPARKLE_BUILD_PACKAGE_SUPPORT) SPARKLE_BUILD_DMG_SUPPORT=$(SPARKLE_BUILD_DMG_SUPPORT) SPARKLE_BUILD_LEGACY_DELTA_SUPPORT=$(SPARKLE_BUILD_LEGACY_DELTA_SUPPORT) SPARKLE_BUILD_BZIP2_DELTA_SUPPORT=$(SPARKLE_BUILD_BZIP2_DELTA_SUPPORT) SPARKLE_BUILD_LEGACY_DSA_SUPPORT=$(SPARKLE_BUILD_LEGACY_DSA_SUPPORT) GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT=$(GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" CURRENT_PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\" MARKETING_VERSION=\"$(MARKETING_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_NAME=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_BUNDLE_ID=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_BUNDLE_ID)\" SPARKLE_ICON_NAME=\"$(SPARKLE_ICON_NAME)\" INSTALLER_LAUNCHER_NAME=\"${INSTALLER_LAUNCHER_NAME}\" INSTALLER_LAUNCHER_BUNDLE_ID=\"${INSTALLER_LAUNCHER_BUNDLE_ID}\" INSTALLER_LAUNCHER_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_INSTALLER_LAUNCHER_XPC_SERVICE) INSTALLER_CONNECTION_NAME=\"${INSTALLER_CONNECTION_NAME}\" INSTALLER_CONNECTION_BUNDLE_ID=\"${INSTALLER_CONNECTION_BUNDLE_ID}\" INSTALLER_CONNECTION_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_INSTALLER_CONNECTION_XPC_SERVICE) INSTALLER_STATUS_NAME=\"${INSTALLER_STATUS_NAME}\" INSTALLER_STATUS_BUNDLE_ID=\"${INSTALLER_STATUS_BUNDLE_ID}\" INSTALLER_STATUS_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_INSTALLER_STATUS_XPC_SERVICE) DOWNLOADER_NAME=\"${DOWNLOADER_NAME}\" DOWNLOADER_BUNDLE_ID=\"${DOWNLOADER_BUNDLE_ID}\" DOWNLOADER_XPC_SERVICE_EMBEDDED=$(SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE)
|
||||||
|
|
||||||
CODE_SIGN_IDENTITY = -
|
CODE_SIGN_IDENTITY = -
|
||||||
SDKROOT = macosx
|
SDKROOT = macosx
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
INFOPLIST_FILE = Sparkle/InstallerProgress/InstallerProgress-Info.plist
|
INFOPLIST_FILE = Sparkle/InstallerProgress/InstallerProgress-Info.plist
|
||||||
PRODUCT_NAME = $(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)
|
PRODUCT_NAME = $(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = $(SPARKLE_INSTALLER_PROGRESS_TOOL_BUNDLE_ID)
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE=0 BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE=0 BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||||
SKIP_INSTALL = YES
|
SKIP_INSTALL = YES
|
||||||
CLANG_ENABLE_MODULES = NO
|
CLANG_ENABLE_MODULES = NO
|
||||||
@@ -5,6 +5,7 @@ set -e
|
|||||||
# This guards against our archives being corrupt / created incorrectly.
|
# This guards against our archives being corrupt / created incorrectly.
|
||||||
function verify_code_signatures() {
|
function verify_code_signatures() {
|
||||||
verification_directory="$1"
|
verification_directory="$1"
|
||||||
|
check_aux_apps="$2"
|
||||||
|
|
||||||
if [[ -z "$verification_directory" ]]; then
|
if [[ -z "$verification_directory" ]]; then
|
||||||
echo "Provided verification directory does not exist" >&2
|
echo "Provided verification directory does not exist" >&2
|
||||||
@@ -13,8 +14,11 @@ function verify_code_signatures() {
|
|||||||
|
|
||||||
# Search the current directory for all instances of the framework to verify them (XCFrameworks can have multiple copies of a framework for different platforms).
|
# Search the current directory for all instances of the framework to verify them (XCFrameworks can have multiple copies of a framework for different platforms).
|
||||||
find "${verification_directory}" -name "Sparkle.framework" -type d -exec codesign --verify -vvv --deep {} \;
|
find "${verification_directory}" -name "Sparkle.framework" -type d -exec codesign --verify -vvv --deep {} \;
|
||||||
codesign --verify -vvv --deep "${verification_directory}/sparkle.app"
|
|
||||||
codesign --verify -vvv --deep "${verification_directory}/Sparkle Test App.app"
|
if [ "$check_aux_apps" = true ] ; then
|
||||||
|
codesign --verify -vvv --deep "${verification_directory}/sparkle.app"
|
||||||
|
codesign --verify -vvv --deep "${verification_directory}/Sparkle Test App.app"
|
||||||
|
fi
|
||||||
codesign --verify -vvv --deep "${verification_directory}/bin/BinaryDelta"
|
codesign --verify -vvv --deep "${verification_directory}/bin/BinaryDelta"
|
||||||
codesign --verify -vvv --deep "${verification_directory}/bin/generate_appcast"
|
codesign --verify -vvv --deep "${verification_directory}/bin/generate_appcast"
|
||||||
codesign --verify -vvv --deep "${verification_directory}/bin/sign_update"
|
codesign --verify -vvv --deep "${verification_directory}/bin/sign_update"
|
||||||
@@ -38,9 +42,7 @@ if [ "$ACTION" = "" ] ; then
|
|||||||
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||||
cp "$CONFIGURATION_BUILD_DIR/sign_update" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
cp "$CONFIGURATION_BUILD_DIR/sign_update" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
|
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app" "$CONFIGURATION_BUILD_DIR/staging"
|
cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app" "$CONFIGURATION_BUILD_DIR/staging"
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$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"
|
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.xcframework" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||||
|
|
||||||
@@ -58,19 +60,28 @@ if [ "$ACTION" = "" ] ; then
|
|||||||
# because missing dSYMs in a release build SHOULD trigger a build failure
|
# because missing dSYMs in a release build SHOULD trigger a build failure
|
||||||
if [ "$CONFIGURATION" = "Release" ] ; then
|
if [ "$CONFIGURATION" = "Release" ] ; then
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/generate_keys.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/generate_keys.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/sign_update.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/sign_update.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Autoupdate.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/Autoupdate.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Updater.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/Updater.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/${INSTALLER_LAUNCHER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/${INSTALLER_LAUNCHER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
|
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/${DOWNLOADER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
cp -R "$CONFIGURATION_BUILD_DIR/${DOWNLOADER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
|
||||||
fi
|
fi
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/staging/Symbols" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
|
||||||
|
|
||||||
cd "$CONFIGURATION_BUILD_DIR/staging"
|
cd "$CONFIGURATION_BUILD_DIR/staging"
|
||||||
|
|
||||||
@@ -102,7 +113,7 @@ if [ "$ACTION" = "" ] ; then
|
|||||||
|
|
||||||
# Test code signing validity of the extracted products
|
# Test code signing validity of the extracted products
|
||||||
# This guards against our archives being corrupt / created incorrectly
|
# This guards against our archives being corrupt / created incorrectly
|
||||||
verify_code_signatures "/tmp/sparkle-extract"
|
verify_code_signatures "/tmp/sparkle-extract" true
|
||||||
|
|
||||||
rm -rf "/tmp/sparkle-extract"
|
rm -rf "/tmp/sparkle-extract"
|
||||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
|
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
|
||||||
@@ -122,7 +133,7 @@ if [ "$ACTION" = "" ] ; then
|
|||||||
# Test code signing validity of the extracted Swift package
|
# Test code signing validity of the extracted Swift package
|
||||||
# This guards against our archives being corrupt / created incorrectly
|
# This guards against our archives being corrupt / created incorrectly
|
||||||
ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract"
|
ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract"
|
||||||
verify_code_signatures "/tmp/sparkle-spm-extract"
|
verify_code_signatures "/tmp/sparkle-spm-extract" false
|
||||||
|
|
||||||
rm -rf "/tmp/sparkle-spm-extract"
|
rm -rf "/tmp/sparkle-spm-extract"
|
||||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deleting old products
|
||||||
|
rm -rd "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive"
|
||||||
|
rm -rd "$BUILT_PRODUCTS_DIR/Sparkle.xcframework"
|
||||||
|
|
||||||
|
xcodebuild archive -scheme Sparkle -archivePath "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO
|
||||||
|
|
||||||
|
if [ $XCODE_VERSION_MAJOR -ge "1200" ]; then
|
||||||
|
xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Autoupdate.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Updater.app.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Installer.xpc.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Downloader.xpc.dSYM" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework"
|
||||||
|
else
|
||||||
|
echo "warning: Your Xcode version does not support bundling dSYMs in XCFrameworks directly. You should copy them manually into the XCFramework."
|
||||||
|
echo "note: cp '$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM' '$BUILT_PRODUCTS_DIR/Sparkle.xcframework/your_architecture/dSYMs'"
|
||||||
|
xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework"
|
||||||
|
fi
|
||||||
@@ -106,20 +106,21 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
|
|||||||
|
|
||||||
- (NSString *)rootPersistentDownloadCachePathForBundleIdentifier:(NSString *)bundleIdentifier SPU_OBJC_DIRECT
|
- (NSString *)rootPersistentDownloadCachePathForBundleIdentifier:(NSString *)bundleIdentifier SPU_OBJC_DIRECT
|
||||||
{
|
{
|
||||||
|
// Note: The installer verifies this "PersistentDownloads" path component
|
||||||
return [[SPULocalCacheDirectory cachePathForBundleIdentifier:bundleIdentifier] stringByAppendingPathComponent:@"PersistentDownloads"];
|
return [[SPULocalCacheDirectory cachePathForBundleIdentifier:bundleIdentifier] stringByAppendingPathComponent:@"PersistentDownloads"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)removeDownloadDirectory:(NSString *)directoryName bundleIdentifier:(NSString *)bundleIdentifier
|
- (void)removeDownloadDirectoryWithDownloadToken:(NSString *)downloadToken bundleIdentifier:(NSString *)bundleIdentifier
|
||||||
{
|
{
|
||||||
// Only take the directory name and compute most of the base path ourselves
|
// Only take the directory name (from the download token) and compute most of the base path ourselves
|
||||||
// This way we do not have to send/trust an absolute path
|
// This way we do not have to send/trust an absolute path
|
||||||
// The downloader instance that creates this temp directory isn't necessarily the same as the one
|
// The downloader instance that creates this temp directory isn't necessarily the same as the one
|
||||||
// that clears it (eg upon skipping an already downloaded update), so we can't just preserve it here too
|
// that clears it (eg upon skipping an already downloaded update), so we can't just preserve it here too
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
NSString *rootPersistentDownloadCachePath = [self rootPersistentDownloadCachePathForBundleIdentifier:bundleIdentifier];
|
NSString *rootPersistentDownloadCachePath = [self rootPersistentDownloadCachePathForBundleIdentifier:bundleIdentifier];
|
||||||
if (rootPersistentDownloadCachePath != nil) {
|
if (rootPersistentDownloadCachePath != nil) {
|
||||||
NSString *sanitizedDirectoryName = directoryName.lastPathComponent;
|
NSString *sanitizedDownloadToken = downloadToken.lastPathComponent;
|
||||||
NSString *tempDir = [rootPersistentDownloadCachePath stringByAppendingPathComponent:sanitizedDirectoryName];
|
NSString *tempDir = [rootPersistentDownloadCachePath stringByAppendingPathComponent:sanitizedDownloadToken];
|
||||||
|
|
||||||
[[NSFileManager defaultManager] removeItemAtPath:tempDir error:NULL];
|
[[NSFileManager defaultManager] removeItemAtPath:tempDir error:NULL];
|
||||||
}
|
}
|
||||||
@@ -201,8 +202,23 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
|
|||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
if ([[NSFileManager defaultManager] moveItemAtPath:fromPath toPath:toPath error:&error]) {
|
if ([[NSFileManager defaultManager] moveItemAtPath:fromPath toPath:toPath error:&error]) {
|
||||||
_downloadFilename = toPath;
|
_downloadFilename = toPath;
|
||||||
[_delegate downloaderDidSetDestinationName:name temporaryDirectory:downloadFileNameDirectory];
|
|
||||||
[self downloadDidFinish];
|
// Create a bookmark for the download
|
||||||
|
// Don't pass any options (we don't want a persistent security scoped bookmark)
|
||||||
|
|
||||||
|
NSURL *downloadURL = [NSURL fileURLWithPath:toPath isDirectory:NO];
|
||||||
|
|
||||||
|
NSError *bookmarkError = nil;
|
||||||
|
NSData *bookmarkData = [downloadURL bookmarkDataWithOptions:0 includingResourceValuesForKeys:@[] relativeToURL:nil error:&bookmarkError];
|
||||||
|
if (bookmarkData == nil) {
|
||||||
|
[_delegate downloaderDidFailWithError:bookmarkError];
|
||||||
|
} else {
|
||||||
|
// The download token may be provided later to the downloader for removing a download
|
||||||
|
// and its temporary directory
|
||||||
|
NSString *downloadToken = tempDir.lastPathComponent;
|
||||||
|
[_delegate downloaderDidSetDownloadBookmarkData:bookmarkData downloadToken:downloadToken];
|
||||||
|
[self downloadDidFinish];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
[_delegate downloaderDidFailWithError:error];
|
[_delegate downloaderDidFailWithError:error];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@protocol SPUDownloaderDelegate <NSObject>
|
@protocol SPUDownloaderDelegate <NSObject>
|
||||||
|
|
||||||
// This is only invoked for persistent downloads
|
// This is only invoked for persistent downloads
|
||||||
- (void)downloaderDidSetDestinationName:(NSString *)destinationName temporaryDirectory:(NSString *)temporaryDirectory;
|
- (void)downloaderDidSetDownloadBookmarkData:(NSData *)downloadBookmarkData downloadToken:(NSString *)downloadToken;
|
||||||
|
|
||||||
// Under rare cases, this may be called more than once, in which case the current progress should be reset back to 0
|
// Under rare cases, this may be called more than once, in which case the current progress should be reset back to 0
|
||||||
// This is only invoked for persistent downloads
|
// This is only invoked for persistent downloads
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
- (void)startTemporaryDownloadWithRequest:(NSURLRequest *)request;
|
- (void)startTemporaryDownloadWithRequest:(NSURLRequest *)request;
|
||||||
|
|
||||||
- (void)removeDownloadDirectory:(NSString *)directoryName bundleIdentifier:(NSString *)bundleIdentifier;
|
- (void)removeDownloadDirectoryWithDownloadToken:(NSString *)downloadToken bundleIdentifier:(NSString *)bundleIdentifier;
|
||||||
|
|
||||||
- (void)cleanup:(void (^)(void))completionHandler;
|
- (void)cleanup:(void (^)(void))completionHandler;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -2,10 +2,10 @@
|
|||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
// Version is technically not required here, SPM doesn't check
|
// Version is technically not required here, SPM doesn't check
|
||||||
let version = "2.4.0"
|
let version = "2.5.0-beta.1"
|
||||||
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
// 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.4.0"
|
let tag = "2.5.0-beta.1"
|
||||||
let checksum = "44c1a2da814ab922aaf754ed53cd9acb183fe61d43615d1ee83b5744d1533263"
|
let checksum = "cfd39886db2d1c9b84e23e5127fad0a41f216e40af97fa7ff063feb0211b6e61"
|
||||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = "Sparkle"
|
s.name = "Sparkle"
|
||||||
s.version = "2.4.0"
|
s.version = "2.5.0-beta.1"
|
||||||
s.summary = "A software update framework for macOS"
|
s.summary = "A software update framework for macOS"
|
||||||
s.description = "Sparkle is an easy-to-use software update framework for macOS."
|
s.description = "Sparkle is an easy-to-use software update framework for macOS."
|
||||||
s.homepage = "https://sparkle-project.org"
|
s.homepage = "https://sparkle-project.org"
|
||||||
|
|||||||
@@ -1086,6 +1086,7 @@
|
|||||||
722FB7E4260EE53F00EB571C /* SUNormalization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUNormalization.m; sourceTree = "<group>"; };
|
722FB7E4260EE53F00EB571C /* SUNormalization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUNormalization.m; sourceTree = "<group>"; };
|
||||||
72316BD11E0DA8430039EFD9 /* SUUnarchiverNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUnarchiverNotifier.h; path = Autoupdate/SUUnarchiverNotifier.h; sourceTree = SOURCE_ROOT; };
|
72316BD11E0DA8430039EFD9 /* SUUnarchiverNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUnarchiverNotifier.h; path = Autoupdate/SUUnarchiverNotifier.h; sourceTree = SOURCE_ROOT; };
|
||||||
72316BD21E0DA8430039EFD9 /* SUUnarchiverNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUnarchiverNotifier.m; path = Autoupdate/SUUnarchiverNotifier.m; sourceTree = SOURCE_ROOT; };
|
72316BD21E0DA8430039EFD9 /* SUUnarchiverNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUnarchiverNotifier.m; path = Autoupdate/SUUnarchiverNotifier.m; sourceTree = SOURCE_ROOT; };
|
||||||
|
7235B75E29DFC0120081FE4E /* make-xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "make-xcframework.sh"; sourceTree = "<group>"; };
|
||||||
723ABCD7259A9A9D00BDB4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
723ABCD7259A9A9D00BDB4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
723ABD37259A9BA500BDB4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
723ABD37259A9BA500BDB4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
||||||
723ABD4C259A9BB900BDB4FA /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
|
723ABD4C259A9BB900BDB4FA /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
|
||||||
@@ -2495,6 +2496,7 @@
|
|||||||
EA1E285722B6622E004AA304 /* ed25519-Release.xcconfig */,
|
EA1E285722B6622E004AA304 /* ed25519-Release.xcconfig */,
|
||||||
EA1E285922B6622E004AA304 /* ed25519-Shared.xcconfig */,
|
EA1E285922B6622E004AA304 /* ed25519-Shared.xcconfig */,
|
||||||
14732BC91960F70A00593899 /* make-release-package.sh */,
|
14732BC91960F70A00593899 /* make-release-package.sh */,
|
||||||
|
7235B75E29DFC0120081FE4E /* make-xcframework.sh */,
|
||||||
14652F7919A93E5F00959E44 /* set-git-version-info.sh */,
|
14652F7919A93E5F00959E44 /* set-git-version-info.sh */,
|
||||||
72045CE426FEE708004F96E5 /* strip-framework.sh */,
|
72045CE426FEE708004F96E5 /* strip-framework.sh */,
|
||||||
720C192827127A3800740C8E /* release-move-tag.sh */,
|
720C192827127A3800740C8E /* release-move-tag.sh */,
|
||||||
@@ -3321,7 +3323,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "# Deleting old products\nrm -rd \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive\"\nrm -rd \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\n\nxcodebuild archive -scheme Sparkle -archivePath \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive\" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO\n\nif [ $XCODE_VERSION_MAJOR -ge \"1200\" ]; then\nxcodebuild -create-xcframework -framework \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework\" -debug-symbols \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM\" -output \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\nelse\necho \"warning: Your Xcode version does not support bundling dSYMs in XCFrameworks directly. You should copy them manually into the XCFramework.\"\necho \"note: cp '$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM' '$BUILT_PRODUCTS_DIR/Sparkle.xcframework/your_architecture/dSYMs'\"\nxcodebuild -create-xcframework -framework \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework\" -output \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\nfi\n";
|
shellScript = "\"$SRCROOT/Configurations/make-xcframework.sh\"\n";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
<deployment identifier="macosx"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
<deployment identifier="macosx"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
|
|||||||
+11
-1
@@ -29,6 +29,12 @@
|
|||||||
*/
|
*/
|
||||||
static const NSTimeInterval SUTerminationTimeDelay = 0.3;
|
static const NSTimeInterval SUTerminationTimeDelay = 0.3;
|
||||||
|
|
||||||
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 140000
|
||||||
|
@interface NSApplication (ActivationAPIs)
|
||||||
|
- (void)activate;
|
||||||
|
@end
|
||||||
|
#endif
|
||||||
|
|
||||||
@interface InstallerProgressAppController () <NSApplicationDelegate, SPUInstallerAgentProtocol>
|
@interface InstallerProgressAppController () <NSApplicationDelegate, SPUInstallerAgentProtocol>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -367,7 +373,11 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
|
|||||||
self->_application.applicationIconImage = [SUApplicationInfo bestIconForHost:self->_oldHost];
|
self->_application.applicationIconImage = [SUApplicationInfo bestIconForHost:self->_oldHost];
|
||||||
|
|
||||||
// Activate ourselves otherwise we will probably be in the background
|
// Activate ourselves otherwise we will probably be in the background
|
||||||
[self->_application activateIgnoringOtherApps:YES];
|
if (@available(macOS 14, *)) {
|
||||||
|
[self->_application activate];
|
||||||
|
} else {
|
||||||
|
[self->_application activateIgnoringOtherApps:YES];
|
||||||
|
}
|
||||||
|
|
||||||
[self->_delegate installerProgressShouldDisplayWithHost:self->_oldHost];
|
[self->_delegate installerProgressShouldDisplayWithHost:self->_oldHost];
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+9
-13
@@ -35,8 +35,8 @@
|
|||||||
SUAppcastItem *_updateItem;
|
SUAppcastItem *_updateItem;
|
||||||
SUAppcastItem * _Nullable _secondaryUpdateItem;
|
SUAppcastItem * _Nullable _secondaryUpdateItem;
|
||||||
SUHost *_host;
|
SUHost *_host;
|
||||||
NSString *_temporaryDirectory;
|
NSData *_downloadBookmarkData;
|
||||||
NSString *_downloadName;
|
NSString *_downloadToken;
|
||||||
|
|
||||||
__weak id<SPUDownloadDriverDelegate> _delegate;
|
__weak id<SPUDownloadDriverDelegate> _delegate;
|
||||||
|
|
||||||
@@ -169,12 +169,7 @@
|
|||||||
NSString *bundleIdentifier = _host.bundle.bundleIdentifier;
|
NSString *bundleIdentifier = _host.bundle.bundleIdentifier;
|
||||||
assert(bundleIdentifier != nil);
|
assert(bundleIdentifier != nil);
|
||||||
|
|
||||||
if (bundleIdentifier != nil) {
|
[_downloader removeDownloadDirectoryWithDownloadToken:downloadedUpdate.downloadToken bundleIdentifier:bundleIdentifier];
|
||||||
// Grab eg "0bCSun8tj" from org.sparkle-project.Sparkle/PersistentDownloads/0bCSun8tj/Sparkle Test App 2.0/
|
|
||||||
NSString *tempDirectoryName = downloadedUpdate.temporaryDirectory.stringByDeletingLastPathComponent.lastPathComponent;
|
|
||||||
|
|
||||||
[_downloader removeDownloadDirectory:tempDirectoryName bundleIdentifier:bundleIdentifier];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)cleanup:(void (^)(void))completionHandler
|
- (void)cleanup:(void (^)(void))completionHandler
|
||||||
@@ -188,7 +183,8 @@
|
|||||||
self->_connection = nil;
|
self->_connection = nil;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
self->_downloadName = nil;
|
self->_downloadBookmarkData = nil;
|
||||||
|
self->_downloadToken = nil;
|
||||||
self->_downloader = nil;
|
self->_downloader = nil;
|
||||||
|
|
||||||
completionHandler();
|
completionHandler();
|
||||||
@@ -216,7 +212,7 @@
|
|||||||
SULog(SULogLevelError, @"Warning: Downloader's expected content length (%llu) != Appcast item's length (%llu)", self->_expectedContentLength, self->_updateItem.contentLength);
|
SULog(SULogLevelError, @"Warning: Downloader's expected content length (%llu) != Appcast item's length (%llu)", self->_expectedContentLength, self->_updateItem.contentLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
SPUDownloadedUpdate *downloadedUpdate = [[SPUDownloadedUpdate alloc] initWithAppcastItem:self->_updateItem secondaryAppcastItem:self->_secondaryUpdateItem downloadName:self->_downloadName temporaryDirectory:self->_temporaryDirectory];
|
SPUDownloadedUpdate *downloadedUpdate = [[SPUDownloadedUpdate alloc] initWithAppcastItem:self->_updateItem secondaryAppcastItem:self->_secondaryUpdateItem downloadBookmarkData:self->_downloadBookmarkData downloadToken:self->_downloadToken];
|
||||||
|
|
||||||
if ([delegate respondsToSelector:@selector(downloadDriverDidDownloadUpdate:)]) {
|
if ([delegate respondsToSelector:@selector(downloadDriverDidDownloadUpdate:)]) {
|
||||||
[delegate downloadDriverDidDownloadUpdate:downloadedUpdate];
|
[delegate downloadDriverDidDownloadUpdate:downloadedUpdate];
|
||||||
@@ -254,11 +250,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)downloaderDidSetDestinationName:(NSString *)destinationName temporaryDirectory:(NSString *)temporaryDirectory
|
- (void)downloaderDidSetDownloadBookmarkData:(NSData *)downloadBookmarkData downloadToken:(NSString *)downloadToken
|
||||||
{
|
{
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
self->_downloadName = destinationName;
|
self->_downloadBookmarkData = downloadBookmarkData;
|
||||||
self->_temporaryDirectory = temporaryDirectory;
|
self->_downloadToken = [downloadToken copy];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -13,10 +13,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
SPU_OBJC_DIRECT_MEMBERS @interface SPUDownloadedUpdate : NSObject <SPUResumableUpdate>
|
SPU_OBJC_DIRECT_MEMBERS @interface SPUDownloadedUpdate : NSObject <SPUResumableUpdate>
|
||||||
|
|
||||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem secondaryAppcastItem:(SUAppcastItem * _Nullable)secondaryItem downloadName:(NSString *)downloadName temporaryDirectory:(NSString *)temporaryDirectory;
|
- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem secondaryAppcastItem:(SUAppcastItem * _Nullable)secondaryItem downloadBookmarkData:(NSData *)downloadBookmarkData downloadToken:(NSString *)downloadToken;
|
||||||
|
|
||||||
@property (nonatomic, copy, readonly) NSString *downloadName;
|
@property (nonatomic, readonly) NSData *downloadBookmarkData;
|
||||||
@property (nonatomic, copy, readonly) NSString *temporaryDirectory;
|
@property (nonatomic, readonly) NSString *downloadToken;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
Vendored
+5
-5
@@ -18,17 +18,17 @@
|
|||||||
@synthesize updateItem = _updateItem;
|
@synthesize updateItem = _updateItem;
|
||||||
@synthesize secondaryUpdateItem = _secondaryUpdateItem;
|
@synthesize secondaryUpdateItem = _secondaryUpdateItem;
|
||||||
|
|
||||||
@synthesize downloadName = _downloadName;
|
@synthesize downloadBookmarkData = _downloadBookmarkData;
|
||||||
@synthesize temporaryDirectory = _temporaryDirectory;
|
@synthesize downloadToken = _downloadToken;
|
||||||
|
|
||||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem secondaryAppcastItem:(SUAppcastItem * _Nullable)secondaryUpdateItem downloadName:(NSString *)downloadName temporaryDirectory:(NSString *)temporaryDirectory
|
- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem secondaryAppcastItem:(SUAppcastItem * _Nullable)secondaryUpdateItem downloadBookmarkData:(NSData *)downloadBookmarkData downloadToken:(NSString *)downloadToken
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_updateItem = updateItem;
|
_updateItem = updateItem;
|
||||||
_secondaryUpdateItem = secondaryUpdateItem;
|
_secondaryUpdateItem = secondaryUpdateItem;
|
||||||
_downloadName = [downloadName copy];
|
_downloadBookmarkData = downloadBookmarkData;
|
||||||
_temporaryDirectory = [temporaryDirectory copy];
|
_downloadToken = [downloadToken copy];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+76
-10
@@ -40,6 +40,17 @@
|
|||||||
@end
|
@end
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Note: we don't want to directly pull in AppKit here especially if the main application does not need it
|
||||||
|
@interface NSObject (ActivationAPIs)
|
||||||
|
// NSApplication
|
||||||
|
+ (id)sharedApplication;
|
||||||
|
- (void)yieldActivationToApplication:(id)application;
|
||||||
|
|
||||||
|
// NSRunningApplication
|
||||||
|
+ (NSArray *)runningApplicationsWithBundleIdentifier:(NSString *)bundleIdentifier;
|
||||||
|
- (NSURL *)bundleURL;
|
||||||
|
@end
|
||||||
|
|
||||||
@interface SPUInstallerDriver () <SUInstallerCommunicationProtocol>
|
@interface SPUInstallerDriver () <SUInstallerCommunicationProtocol>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -49,8 +60,7 @@
|
|||||||
NSBundle *_applicationBundle;
|
NSBundle *_applicationBundle;
|
||||||
id<SUInstallerConnectionProtocol> _installerConnection;
|
id<SUInstallerConnectionProtocol> _installerConnection;
|
||||||
SUAppcastItem *_updateItem;
|
SUAppcastItem *_updateItem;
|
||||||
NSString *_downloadName;
|
NSData *_updateURLBookmarkData;
|
||||||
NSString *_temporaryDirectory;
|
|
||||||
NSError *_installerError;
|
NSError *_installerError;
|
||||||
|
|
||||||
__weak id _updater;
|
__weak id _updater;
|
||||||
@@ -66,6 +76,7 @@
|
|||||||
BOOL _relaunch;
|
BOOL _relaunch;
|
||||||
BOOL _systemDomain;
|
BOOL _systemDomain;
|
||||||
BOOL _aborted;
|
BOOL _aborted;
|
||||||
|
BOOL _notifiedDelegateInstallationWillFinish;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater updaterDelegate:(id<SPUUpdaterDelegate>)updaterDelegate delegate:(nullable id<SPUInstallerDriverDelegate>)delegate
|
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater updaterDelegate:(id<SPUUpdaterDelegate>)updaterDelegate delegate:(nullable id<SPUInstallerDriverDelegate>)delegate
|
||||||
@@ -191,8 +202,7 @@
|
|||||||
- (void)extractDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently completion:(void (^)(NSError * _Nullable))completionHandler
|
- (void)extractDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently completion:(void (^)(NSError * _Nullable))completionHandler
|
||||||
{
|
{
|
||||||
_updateItem = downloadedUpdate.updateItem;
|
_updateItem = downloadedUpdate.updateItem;
|
||||||
_temporaryDirectory = downloadedUpdate.temporaryDirectory;
|
_updateURLBookmarkData = downloadedUpdate.downloadBookmarkData;
|
||||||
_downloadName = downloadedUpdate.downloadName;
|
|
||||||
|
|
||||||
_currentStage = SPUInstallerNotStarted;
|
_currentStage = SPUInstallerNotStarted;
|
||||||
|
|
||||||
@@ -237,11 +247,13 @@
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SPUInstallationInputData *installationData = [[SPUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch hostBundlePath:_host.bundlePath updateDirectoryPath:_temporaryDirectory downloadName:_downloadName installationType:_updateItem.installationType signatures:_updateItem.signatures decryptionPassword:decryptionPassword];
|
id<SPUInstallerDriverDelegate> delegate = _delegate;
|
||||||
|
|
||||||
|
SPUInstallationInputData *installationData = [[SPUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch hostBundlePath:_host.bundlePath updateURLBookmarkData:_updateURLBookmarkData installationType:_updateItem.installationType signatures:_updateItem.signatures decryptionPassword:decryptionPassword];
|
||||||
|
|
||||||
NSData *archivedData = SPUArchiveRootObjectSecurely(installationData);
|
NSData *archivedData = SPUArchiveRootObjectSecurely(installationData);
|
||||||
if (archivedData == nil) {
|
if (archivedData == nil) {
|
||||||
[_delegate installerIsRequestingAbortInstallWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey:@"An error occurred while encoding the installer parameters. Please try again later." }]];
|
[delegate installerIsRequestingAbortInstallWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey:@"An error occurred while encoding the installer parameters. Please try again later." }]];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +350,13 @@
|
|||||||
hasTargetTerminated = (BOOL)*((const uint8_t *)data.bytes);
|
hasTargetTerminated = (BOOL)*((const uint8_t *)data.bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
[delegate installerWillFinishInstallationAndRelaunch:_relaunch];
|
// If the target was already terminated this may be the first time we notify delegate that installation is about to happen
|
||||||
|
// Otherwise if the target was requested to be terminated/relaunched by the user this may be the second time
|
||||||
|
// Avoid re-notifying the delegate twice
|
||||||
|
if (!_notifiedDelegateInstallationWillFinish) {
|
||||||
|
_notifiedDelegateInstallationWillFinish = YES;
|
||||||
|
[delegate installerWillFinishInstallationAndRelaunch:_relaunch];
|
||||||
|
}
|
||||||
|
|
||||||
[delegate installerDidStartInstallingWithApplicationTerminated:hasTargetTerminated];
|
[delegate installerDidStartInstallingWithApplicationTerminated:hasTargetTerminated];
|
||||||
} else if (identifier == SPUInstallationFinishedStage3) {
|
} else if (identifier == SPUInstallationFinishedStage3) {
|
||||||
@@ -493,9 +511,11 @@
|
|||||||
{
|
{
|
||||||
assert(_updateItem);
|
assert(_updateItem);
|
||||||
|
|
||||||
|
id<SPUInstallerDriverDelegate> delegate = _delegate;
|
||||||
|
|
||||||
if (![self mayUpdateAndRestart])
|
if (![self mayUpdateAndRestart])
|
||||||
{
|
{
|
||||||
[_delegate installerIsRequestingAbortInstallWithError:nil];
|
[delegate installerIsRequestingAbortInstallWithError:nil];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,12 +547,58 @@
|
|||||||
|
|
||||||
_relaunch = relaunch;
|
_relaunch = relaunch;
|
||||||
|
|
||||||
|
// If AppKit is loaded, we will yield to our Sparkle progress app
|
||||||
|
// This will let the system know it should be okay for the progress agent to activate itself (if necessary)
|
||||||
|
// Note we don't want to directly pull in AppKit here especially if the main application does not need it
|
||||||
|
if (showUI) {
|
||||||
|
if (@available(macOS 14, *)) {
|
||||||
|
// Make sure we are not root before using AppKit API
|
||||||
|
if (geteuid() != 0) {
|
||||||
|
Class applicationClass = NSClassFromString(@"NSApplication");
|
||||||
|
if ([applicationClass respondsToSelector:@selector(sharedApplication)]) {
|
||||||
|
NSObject *application = [applicationClass sharedApplication];
|
||||||
|
|
||||||
|
if ([application respondsToSelector:@selector(yieldActivationToApplication:)]) {
|
||||||
|
Class runningApplicationClass = NSClassFromString(@"NSRunningApplication");
|
||||||
|
if ([runningApplicationClass respondsToSelector:@selector(runningApplicationsWithBundleIdentifier:)]) {
|
||||||
|
NSArray *runningApplications = [runningApplicationClass runningApplicationsWithBundleIdentifier:@SPARKLE_INSTALLER_PROGRESS_TOOL_BUNDLE_ID];
|
||||||
|
|
||||||
|
NSString *hostBundleIdentifier = _host.bundle.bundleIdentifier;
|
||||||
|
|
||||||
|
id targetRunningApplication = nil;
|
||||||
|
for (id runningApplication in runningApplications) {
|
||||||
|
if ([(NSObject *)runningApplication respondsToSelector:@selector(bundleURL)]) {
|
||||||
|
NSURL *bundleURL = [(NSObject *)runningApplication bundleURL];
|
||||||
|
|
||||||
|
if (hostBundleIdentifier != nil && [bundleURL.pathComponents containsObject:hostBundleIdentifier]) {
|
||||||
|
targetRunningApplication = runningApplication;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetRunningApplication != nil) {
|
||||||
|
[application yieldActivationToApplication:targetRunningApplication];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The user can request trying to relaunch/quit the app multiple times
|
||||||
|
// Avoid re-notifying the delegate twice
|
||||||
|
if (!_notifiedDelegateInstallationWillFinish) {
|
||||||
|
_notifiedDelegateInstallationWillFinish = YES;
|
||||||
|
[delegate installerWillFinishInstallationAndRelaunch:relaunch];
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t response[2] = {(uint8_t)relaunch, (uint8_t)showUI};
|
uint8_t response[2] = {(uint8_t)relaunch, (uint8_t)showUI};
|
||||||
NSData *responseData = [NSData dataWithBytes:response length:sizeof(response)];
|
NSData *responseData = [NSData dataWithBytes:response length:sizeof(response)];
|
||||||
|
|
||||||
[_installerConnection handleMessageWithIdentifier:SPUResumeInstallationToStage2 data:responseData];
|
|
||||||
|
|
||||||
// the installer will send us SPUInstallationFinishedStage2 when stage 2 is done
|
// the installer will send us SPUInstallationFinishedStage2 when stage 2 is done
|
||||||
|
[_installerConnection handleMessageWithIdentifier:SPUResumeInstallationToStage2 data:responseData];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)cancelUpdate
|
- (void)cancelUpdate
|
||||||
|
|||||||
+7
-1
@@ -22,6 +22,10 @@
|
|||||||
// programmatically.
|
// programmatically.
|
||||||
|
|
||||||
@interface SPUStandardUpdaterController () <NSMenuItemValidation>
|
@interface SPUStandardUpdaterController () <NSMenuItemValidation>
|
||||||
|
|
||||||
|
// Needed for KVO
|
||||||
|
@property (nonatomic) SPUUpdater *updater;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation SPUStandardUpdaterController
|
@implementation SPUStandardUpdaterController
|
||||||
@@ -45,7 +49,9 @@
|
|||||||
NSBundle *hostBundle = [NSBundle mainBundle];
|
NSBundle *hostBundle = [NSBundle mainBundle];
|
||||||
SPUStandardUserDriver *userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:hostBundle delegate:self->userDriverDelegate];
|
SPUStandardUserDriver *userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:hostBundle delegate:self->userDriverDelegate];
|
||||||
|
|
||||||
_updater = [[SPUUpdater alloc] initWithHostBundle:hostBundle applicationBundle:hostBundle userDriver:userDriver delegate:self->updaterDelegate];
|
SPUUpdater *updater = [[SPUUpdater alloc] initWithHostBundle:hostBundle applicationBundle:hostBundle userDriver:userDriver delegate:self->updaterDelegate];
|
||||||
|
[self setUpdater:updater];
|
||||||
|
|
||||||
_userDriver = userDriver;
|
_userDriver = userDriver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+23
-8
@@ -32,6 +32,12 @@
|
|||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 140000
|
||||||
|
@interface NSApplication (ActivationAPIs)
|
||||||
|
- (void)activate;
|
||||||
|
@end
|
||||||
|
#endif
|
||||||
|
|
||||||
// The amount of time the app is allowed to be idle for us to consider showing an update prompt right away when the app is active
|
// The amount of time the app is allowed to be idle for us to consider showing an update prompt right away when the app is active
|
||||||
static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 30.0 : 5 * 60.0;
|
static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 30.0 : 5 * 60.0;
|
||||||
|
|
||||||
@@ -118,12 +124,21 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
|
|||||||
|
|
||||||
#pragma mark Update Permission
|
#pragma mark Update Permission
|
||||||
|
|
||||||
|
- (void)_activateApplication SPU_OBJC_DIRECT
|
||||||
|
{
|
||||||
|
if (@available(macOS 14, *)) {
|
||||||
|
[NSApp activate];
|
||||||
|
} else {
|
||||||
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply
|
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply
|
||||||
{
|
{
|
||||||
assert(NSThread.isMainThread);
|
assert(NSThread.isMainThread);
|
||||||
|
|
||||||
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
[self _activateApplication];
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak __typeof__(self) weakSelf = self;
|
__weak __typeof__(self) weakSelf = self;
|
||||||
@@ -169,7 +184,7 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
|
|||||||
if (![NSApp isActive]) {
|
if (![NSApp isActive]) {
|
||||||
// If the user initiated an update check, we should make the app active,
|
// If the user initiated an update check, we should make the app active,
|
||||||
// regardless if it's a background running app or not
|
// regardless if it's a background running app or not
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[self _activateApplication];
|
||||||
}
|
}
|
||||||
|
|
||||||
[_activeUpdateAlert showWindow:nil];
|
[_activeUpdateAlert showWindow:nil];
|
||||||
@@ -301,7 +316,7 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
|
|||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
||||||
} else {
|
} else {
|
||||||
if (activatingApp) {
|
if (activatingApp) {
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[self _activateApplication];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showingUpdateInBack) {
|
if (showingUpdateInBack) {
|
||||||
@@ -465,7 +480,7 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
|
|||||||
|
|
||||||
if (mayNeedToActivateApp && ![NSApp isActive]) {
|
if (mayNeedToActivateApp && ![NSApp isActive]) {
|
||||||
// Make the app active if it's not already active, e.g, from a menu bar extra
|
// Make the app active if it's not already active, e.g, from a menu bar extra
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[self _activateApplication];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,14 +542,14 @@ static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 3
|
|||||||
[[_checkingController window] center]; // Force the checking controller to load its window.
|
[[_checkingController window] center]; // Force the checking controller to load its window.
|
||||||
[_checkingController beginActionWithTitle:SULocalizedStringFromTableInBundle(@"Checking for updates…", SPARKLE_TABLE, sparkleBundle, nil) maxProgressValue:0.0 statusText:nil];
|
[_checkingController beginActionWithTitle:SULocalizedStringFromTableInBundle(@"Checking for updates…", SPARKLE_TABLE, sparkleBundle, nil) maxProgressValue:0.0 statusText:nil];
|
||||||
[_checkingController setButtonTitle:SULocalizedStringFromTableInBundle(@"Cancel", SPARKLE_TABLE, sparkleBundle, nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO];
|
[_checkingController setButtonTitle:SULocalizedStringFromTableInBundle(@"Cancel", SPARKLE_TABLE, sparkleBundle, nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO];
|
||||||
[_checkingController showWindow:self];
|
|
||||||
|
|
||||||
// For background applications, obtain focus.
|
// For background applications, obtain focus.
|
||||||
// Useful if the update check is requested from another app like System Preferences.
|
// Useful if the update check is requested from another app like System Preferences.
|
||||||
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]])
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||||
{
|
[self _activateApplication];
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[_checkingController showWindow:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)closeCheckingWindow SPU_OBJC_DIRECT
|
- (void)closeCheckingWindow SPU_OBJC_DIRECT
|
||||||
|
|||||||
Vendored
+1
-1
@@ -96,7 +96,7 @@ static NSString *SUAppcastItemDeltaFromSparkleLocalesKey = @"SUAppcastItemDeltaF
|
|||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_deltaUpdates = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [SUAppcastItem class]]] forKey:SUAppcastItemDeltaUpdatesKey];
|
_deltaUpdates = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [SUAppcastItem class], [NSString class]]] forKey:SUAppcastItemDeltaUpdatesKey];
|
||||||
_deltaFromSparkleExecutableSize = [decoder decodeObjectOfClass:[NSNumber class] forKey:SUAppcastItemDeltaFromSparkleExecutableSizeKey];
|
_deltaFromSparkleExecutableSize = [decoder decodeObjectOfClass:[NSNumber class] forKey:SUAppcastItemDeltaFromSparkleExecutableSizeKey];
|
||||||
_deltaFromSparkleLocales = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [NSString class]]] forKey:SUAppcastItemDeltaFromSparkleLocalesKey];
|
_deltaFromSparkleLocales = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [NSString class]]] forKey:SUAppcastItemDeltaFromSparkleLocalesKey];
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
@@ -62,6 +62,7 @@ extern NSString *const SULastProfileSubmitDateKey;
|
|||||||
extern NSString *const SUPromptUserOnFirstLaunchKey;
|
extern NSString *const SUPromptUserOnFirstLaunchKey;
|
||||||
extern NSString *const SUDefaultsDomainKey;
|
extern NSString *const SUDefaultsDomainKey;
|
||||||
extern NSString *const SUEnableJavaScriptKey;
|
extern NSString *const SUEnableJavaScriptKey;
|
||||||
|
extern NSString *const SUAllowedURLSchemesKey;
|
||||||
extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This key is obsolete and has no effect.")));
|
extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This key is obsolete and has no effect.")));
|
||||||
extern NSString *const SUAppendVersionNumberKey __attribute__((deprecated("This key is obsolete. See SPARKLE_APPEND_VERSION_NUMBER.")));
|
extern NSString *const SUAppendVersionNumberKey __attribute__((deprecated("This key is obsolete. See SPARKLE_APPEND_VERSION_NUMBER.")));
|
||||||
extern NSString *const SUEnableAutomatedDowngradesKey __attribute__((deprecated("This key is obsolete. See SPARKLE_AUTOMATED_DOWNGRADES.")));
|
extern NSString *const SUEnableAutomatedDowngradesKey __attribute__((deprecated("This key is obsolete. See SPARKLE_AUTOMATED_DOWNGRADES.")));
|
||||||
|
|||||||
Vendored
+1
@@ -57,6 +57,7 @@ NSString *const SUUpdateGroupIdentifierKey = @"SUUpdateGroupIdentifier";
|
|||||||
NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
|
NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
|
||||||
NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch";
|
NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch";
|
||||||
NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript";
|
NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript";
|
||||||
|
NSString *const SUAllowedURLSchemesKey = @"SUAllowedURLSchemes";
|
||||||
NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize";
|
NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize";
|
||||||
NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain";
|
NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain";
|
||||||
NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain";
|
NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain";
|
||||||
|
|||||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
SPU_OBJC_DIRECT_MEMBERS @interface SULegacyWebView : NSObject <SUReleaseNotesView>
|
SPU_OBJC_DIRECT_MEMBERS @interface SULegacyWebView : NSObject <SUReleaseNotesView>
|
||||||
|
|
||||||
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled;
|
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled customAllowedURLSchemes:(NSArray<NSString *> *)customAllowedURLSchemes;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
Vendored
+5
-2
@@ -22,11 +22,12 @@
|
|||||||
@implementation SULegacyWebView
|
@implementation SULegacyWebView
|
||||||
{
|
{
|
||||||
WebView *_webView;
|
WebView *_webView;
|
||||||
|
NSArray<NSString *> *_customAllowedURLSchemes;
|
||||||
|
|
||||||
void (^_completionHandler)(NSError * _Nullable);
|
void (^_completionHandler)(NSError * _Nullable);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled
|
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled customAllowedURLSchemes:(NSArray<NSString *> *)customAllowedURLSchemes
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
@@ -53,6 +54,8 @@
|
|||||||
_webView.policyDelegate = self;
|
_webView.policyDelegate = self;
|
||||||
_webView.frameLoadDelegate = self;
|
_webView.frameLoadDelegate = self;
|
||||||
_webView.UIDelegate = self;
|
_webView.UIDelegate = self;
|
||||||
|
|
||||||
|
_customAllowedURLSchemes = customAllowedURLSchemes;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -110,7 +113,7 @@
|
|||||||
{
|
{
|
||||||
NSURL *requestURL = request.URL;
|
NSURL *requestURL = request.URL;
|
||||||
BOOL isAboutBlank = NO;
|
BOOL isAboutBlank = NO;
|
||||||
BOOL safeURL = SUReleaseNotesIsSafeURL(requestURL, &isAboutBlank);
|
BOOL safeURL = SUReleaseNotesIsSafeURL(requestURL, _customAllowedURLSchemes, &isAboutBlank);
|
||||||
|
|
||||||
// Do not allow redirects to dangerous protocols such as file://
|
// Do not allow redirects to dangerous protocols such as file://
|
||||||
if (!safeURL) {
|
if (!safeURL) {
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
SPU_OBJC_DIRECT_MEMBERS @interface SUPlainTextReleaseNotesView : NSObject <SUReleaseNotesView>
|
SPU_OBJC_DIRECT_MEMBERS @interface SUPlainTextReleaseNotesView : NSObject <SUReleaseNotesView>
|
||||||
|
|
||||||
- (instancetype)initWithFontPointSize:(int)fontPointSize;
|
- (instancetype)initWithFontPointSize:(int)fontPointSize customAllowedURLSchemes:(NSArray<NSString *> *)customAllowedURLSchemes;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -22,10 +22,11 @@
|
|||||||
{
|
{
|
||||||
NSScrollView *_scrollView;
|
NSScrollView *_scrollView;
|
||||||
NSTextView *_textView;
|
NSTextView *_textView;
|
||||||
|
NSArray<NSString *> *_customAllowedURLSchemes;
|
||||||
int _fontPointSize;
|
int _fontPointSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithFontPointSize:(int)fontPointSize
|
- (instancetype)initWithFontPointSize:(int)fontPointSize customAllowedURLSchemes:(NSArray<NSString *> *)customAllowedURLSchemes
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
_textView.delegate = self;
|
_textView.delegate = self;
|
||||||
_scrollView.documentView = _textView;
|
_scrollView.documentView = _textView;
|
||||||
_fontPointSize = fontPointSize;
|
_fontPointSize = fontPointSize;
|
||||||
|
_customAllowedURLSchemes = customAllowedURLSchemes;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -125,7 +127,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOL isAboutBlankURL;
|
BOOL isAboutBlankURL;
|
||||||
if (!SUReleaseNotesIsSafeURL(linkURL, &isAboutBlankURL)) {
|
if (!SUReleaseNotesIsSafeURL(linkURL, _customAllowedURLSchemes, &isAboutBlankURL)) {
|
||||||
SULog(SULogLevelDefault, @"Blocked display of %@ URL which may be dangerous", linkURL.scheme);
|
SULog(SULogLevelDefault, @"Blocked display of %@ URL which may be dangerous", linkURL.scheme);
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
BOOL SUReleaseNotesIsSafeURL(NSURL *url, BOOL *isAboutBlankURL);
|
BOOL SUReleaseNotesIsSafeURL(NSURL *url, NSArray<NSString *> *customAllowedURLSchemes, BOOL *isAboutBlankURL);
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -13,15 +13,15 @@
|
|||||||
|
|
||||||
#include "AppKitPrevention.h"
|
#include "AppKitPrevention.h"
|
||||||
|
|
||||||
BOOL SUReleaseNotesIsSafeURL(NSURL *url, BOOL *isAboutBlankURL)
|
BOOL SUReleaseNotesIsSafeURL(NSURL *url, NSArray<NSString *> *customAllowedURLSchemes, BOOL *isAboutBlankURL)
|
||||||
{
|
{
|
||||||
NSString *scheme = url.scheme;
|
NSString *scheme = url.scheme;
|
||||||
BOOL isAboutBlank = [url.absoluteString isEqualToString:@"about:blank"] || [url.absoluteString isEqualToString:@"about:srcdoc"];
|
BOOL isAboutBlank = [url.absoluteString isEqualToString:@"about:blank"] || [url.absoluteString isEqualToString:@"about:srcdoc"];
|
||||||
BOOL whitelistedSafe = isAboutBlank || [@[@"http", @"https", @"macappstore", @"macappstores", @"itms-apps", @"itms-appss"] containsObject:scheme];
|
BOOL safeURL = isAboutBlank || [@[@"http", @"https", @"macappstore", @"macappstores", @"itms-apps", @"itms-appss"] containsObject:scheme] || [customAllowedURLSchemes containsObject:scheme.lowercaseString];
|
||||||
|
|
||||||
*isAboutBlankURL = isAboutBlank;
|
*isAboutBlankURL = isAboutBlank;
|
||||||
|
|
||||||
return whitelistedSafe;
|
return safeURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
<deployment identifier="macosx"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
|
|||||||
Vendored
+30
-3
@@ -241,6 +241,13 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
|||||||
|
|
||||||
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData
|
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData
|
||||||
{
|
{
|
||||||
|
if (![self showsReleaseNotes]) {
|
||||||
|
if ([_host.bundle isEqual:NSBundle.mainBundle]) {
|
||||||
|
SULog(SULogLevelError, @"Warning: '%@' is configured to not show release notes but release notes for version %@ were downloaded. Consider either removing release notes from your appcast or implementing -[SPUUpdaterDelegate updater:shouldDownloadReleaseNotesForUpdate:]", _host.name, _updateItem.displayVersionString);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NSURL *releaseNotesURL = _updateItem.releaseNotesURL;
|
NSURL *releaseNotesURL = _updateItem.releaseNotesURL;
|
||||||
NSURL *baseURL = releaseNotesURL.URLByDeletingLastPathComponent;
|
NSURL *baseURL = releaseNotesURL.URLByDeletingLastPathComponent;
|
||||||
// If a MIME type isn't provided, we will pick html as the default, as opposed to plain text. Questionable decision..
|
// If a MIME type isn't provided, we will pick html as the default, as opposed to plain text. Questionable decision..
|
||||||
@@ -315,8 +322,28 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSArray<NSString *> *customAllowedURLSchemes;
|
||||||
|
{
|
||||||
|
NSMutableArray<NSString *> *allowedSchemes = [NSMutableArray array];
|
||||||
|
id hostAllowedURLSchemes = [_host objectForInfoDictionaryKey:SUAllowedURLSchemesKey];
|
||||||
|
if ([(NSObject *)hostAllowedURLSchemes isKindOfClass:[NSArray class]]) {
|
||||||
|
for (id urlScheme in (NSArray *)hostAllowedURLSchemes) {
|
||||||
|
if ([(NSObject *)urlScheme isKindOfClass:[NSString class]]) {
|
||||||
|
NSString *allowedURLScheme = [(NSString *)urlScheme lowercaseString];
|
||||||
|
if (![allowedURLScheme isEqualToString:@"file"]) {
|
||||||
|
[allowedSchemes addObject:allowedURLScheme];
|
||||||
|
} else {
|
||||||
|
SULog(SULogLevelError, @"Error: Found 'file' scheme in %@. Ignoring because this scheme is unsafe.", SUAllowedURLSchemesKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
customAllowedURLSchemes = [allowedSchemes copy];
|
||||||
|
}
|
||||||
|
|
||||||
if (usesPlainText) {
|
if (usesPlainText) {
|
||||||
_releaseNotesView = [[SUPlainTextReleaseNotesView alloc] initWithFontPointSize:defaultFontSize];
|
_releaseNotesView = [[SUPlainTextReleaseNotesView alloc] initWithFontPointSize:defaultFontSize customAllowedURLSchemes:customAllowedURLSchemes];
|
||||||
} else {
|
} else {
|
||||||
NSURL *colorStyleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"ReleaseNotesColorStyle" withExtension:@"css"];
|
NSURL *colorStyleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"ReleaseNotesColorStyle" withExtension:@"css"];
|
||||||
|
|
||||||
@@ -330,11 +357,11 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
|||||||
// (In theory it is possible for a non-sandboxed app or sandboxed app with outgoing network entitlement to use the XPC service, it's just pretty unlikely. And falling back to a legacy web view would not be too harmful in those cases).
|
// (In theory it is possible for a non-sandboxed app or sandboxed app with outgoing network entitlement to use the XPC service, it's just pretty unlikely. And falling back to a legacy web view would not be too harmful in those cases).
|
||||||
BOOL useWKWebView = !SPUXPCServiceIsEnabled(SUEnableDownloaderServiceKey);
|
BOOL useWKWebView = !SPUXPCServiceIsEnabled(SUEnableDownloaderServiceKey);
|
||||||
if (!useWKWebView) {
|
if (!useWKWebView) {
|
||||||
_releaseNotesView = [[SULegacyWebView alloc] initWithColorStyleSheetLocation:colorStyleURL fontFamily:defaultFontFamily fontPointSize:defaultFontSize javaScriptEnabled:javaScriptEnabled];
|
_releaseNotesView = [[SULegacyWebView alloc] initWithColorStyleSheetLocation:colorStyleURL fontFamily:defaultFontFamily fontPointSize:defaultFontSize javaScriptEnabled:javaScriptEnabled customAllowedURLSchemes:customAllowedURLSchemes];
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
_releaseNotesView = [[SUWKWebView alloc] initWithColorStyleSheetLocation:colorStyleURL fontFamily:defaultFontFamily fontPointSize:defaultFontSize javaScriptEnabled:javaScriptEnabled];
|
_releaseNotesView = [[SUWKWebView alloc] initWithColorStyleSheetLocation:colorStyleURL fontFamily:defaultFontFamily fontPointSize:defaultFontSize javaScriptEnabled:javaScriptEnabled customAllowedURLSchemes:customAllowedURLSchemes installedVersion: _host.version];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
SPU_OBJC_DIRECT_MEMBERS @interface SUWKWebView : NSObject <SUReleaseNotesView>
|
SPU_OBJC_DIRECT_MEMBERS @interface SUWKWebView : NSObject <SUReleaseNotesView>
|
||||||
|
|
||||||
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled;
|
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled customAllowedURLSchemes:(NSArray<NSString *> *)customAllowedURLSchemes installedVersion:(NSString *)installedVersion;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
Vendored
+39
-3
@@ -28,6 +28,7 @@
|
|||||||
{
|
{
|
||||||
WKWebView *_webView;
|
WKWebView *_webView;
|
||||||
WKNavigation *_currentNavigation;
|
WKNavigation *_currentNavigation;
|
||||||
|
NSArray<NSString *> *_customAllowedURLSchemes;
|
||||||
|
|
||||||
void (^_completionHandler)(NSError * _Nullable);
|
void (^_completionHandler)(NSError * _Nullable);
|
||||||
|
|
||||||
@@ -52,7 +53,27 @@ static WKUserScript *_userScriptWithInjectedStyleSource(NSString *styleSource)
|
|||||||
return [[WKUserScript alloc] initWithSource:scriptSource injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
|
return [[WKUserScript alloc] initWithSource:scriptSource injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled
|
static WKUserScript *_userScriptForExposingCurrentRelease(NSString *releaseString)
|
||||||
|
{
|
||||||
|
// Check that release string can be safely injected
|
||||||
|
NSMutableCharacterSet *allowedCharacterSet = [NSMutableCharacterSet alphanumericCharacterSet];
|
||||||
|
[allowedCharacterSet addCharactersInString:@"_.- "];
|
||||||
|
if ([releaseString rangeOfCharacterFromSet:allowedCharacterSet.invertedSet].location != NSNotFound) {
|
||||||
|
SULog(SULogLevelDefault, @"warning: App version '%@' has characters unsafe for injection. The version number will not be exposed to the release notes CSS. Only [a-zA-Z0-9._- ] is allowed.", releaseString);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This script adds the `sparkle-installed-version` class to all elements which have a matching `data-sparkle-version` attribute
|
||||||
|
NSString *scriptSource = [NSString stringWithFormat:
|
||||||
|
@"document.querySelectorAll(\'[data-sparkle-version=\"%@\"]\')\n"
|
||||||
|
@".forEach(installedVersionElement =>\n"
|
||||||
|
@"installedVersionElement.classList.add('sparkle-installed-version')\n"
|
||||||
|
@");", releaseString];
|
||||||
|
|
||||||
|
return [[WKUserScript alloc] initWithSource:scriptSource injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled customAllowedURLSchemes:(NSArray<NSString *> *)customAllowedURLSchemes installedVersion:(NSString *)installedVersion
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
@@ -91,11 +112,26 @@ static WKUserScript *_userScriptWithInjectedStyleSource(NSString *styleSource)
|
|||||||
// In fact, we must execute javascript to properly inject our default CSS style into the DOM
|
// In fact, we must execute javascript to properly inject our default CSS style into the DOM
|
||||||
// Legacy WebView has exposed methods for custom stylesheets and default fonts,
|
// Legacy WebView has exposed methods for custom stylesheets and default fonts,
|
||||||
// but WKWebView seems to forgo that type of API surface in favor of user scripts like this
|
// but WKWebView seems to forgo that type of API surface in favor of user scripts like this
|
||||||
[userContentController addUserScript:_userScriptWithInjectedStyleSource(finalStyleContents)];
|
WKUserScript *userScriptWithInjectedStyleSource = _userScriptWithInjectedStyleSource(finalStyleContents);
|
||||||
|
if (userScriptWithInjectedStyleSource == nil) {
|
||||||
|
SULog(SULogLevelError, @"Failed to create script for injecting style");
|
||||||
|
} else {
|
||||||
|
[userContentController addUserScript:userScriptWithInjectedStyleSource];
|
||||||
|
}
|
||||||
|
|
||||||
|
WKUserScript *userScriptForExposingCurrentRelease = _userScriptForExposingCurrentRelease(installedVersion);
|
||||||
|
if (userScriptForExposingCurrentRelease == nil) {
|
||||||
|
SULog(SULogLevelDefault, @"warning: Failed to create script for injecting version %@", installedVersion);
|
||||||
|
} else {
|
||||||
|
[userContentController addUserScript:userScriptForExposingCurrentRelease];
|
||||||
|
}
|
||||||
|
|
||||||
configuration.userContentController = userContentController;
|
configuration.userContentController = userContentController;
|
||||||
|
|
||||||
_webView = [[WKWebView alloc] initWithFrame:NSZeroRect configuration:configuration];
|
_webView = [[WKWebView alloc] initWithFrame:NSZeroRect configuration:configuration];
|
||||||
_webView.navigationDelegate = self;
|
_webView.navigationDelegate = self;
|
||||||
|
|
||||||
|
_customAllowedURLSchemes = customAllowedURLSchemes;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -179,7 +215,7 @@ static WKUserScript *_userScriptWithInjectedStyleSource(NSString *styleSource)
|
|||||||
NSURLRequest *request = navigationAction.request;
|
NSURLRequest *request = navigationAction.request;
|
||||||
NSURL *requestURL = request.URL;
|
NSURL *requestURL = request.URL;
|
||||||
BOOL isAboutBlank = NO;
|
BOOL isAboutBlank = NO;
|
||||||
BOOL safeURL = SUReleaseNotesIsSafeURL(requestURL, &isAboutBlank);
|
BOOL safeURL = SUReleaseNotesIsSafeURL(requestURL, _customAllowedURLSchemes, &isAboutBlank);
|
||||||
|
|
||||||
// Do not allow redirects to dangerous protocols such as file://
|
// Do not allow redirects to dangerous protocols such as file://
|
||||||
if (!safeURL) {
|
if (!safeURL) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
<deployment identifier="macosx"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
|
|||||||
@@ -52,12 +52,14 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, disableNeste
|
|||||||
|
|
||||||
let fileManager = FileManager.default
|
let fileManager = FileManager.default
|
||||||
|
|
||||||
var unarchived: [ArchiveItem] = []
|
// Create a dictionary of archive destination directories -> archive source path
|
||||||
|
// so we can ignore duplicate archive entries before trying to unarchive archives in parallel
|
||||||
|
var fileEntries: [URL: URL] = [:]
|
||||||
let dir = try fileManager.contentsOfDirectory(atPath: archivesSourceDir.path)
|
let dir = try fileManager.contentsOfDirectory(atPath: archivesSourceDir.path)
|
||||||
var running = 0
|
|
||||||
for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") && !$0.hasSuffix(".html") && !$0.hasSuffix(".txt") }) {
|
for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") && !$0.hasSuffix(".html") && !$0.hasSuffix(".txt") }) {
|
||||||
let itemPath = archivesSourceDir.appendingPathComponent(item)
|
let itemPath = archivesSourceDir.appendingPathComponent(item)
|
||||||
|
|
||||||
|
// Ignore directories
|
||||||
var isDir: ObjCBool = false
|
var isDir: ObjCBool = false
|
||||||
if fileManager.fileExists(atPath: itemPath.path, isDirectory: &isDir) && isDir.boolValue {
|
if fileManager.fileExists(atPath: itemPath.path, isDirectory: &isDir) && isDir.boolValue {
|
||||||
continue
|
continue
|
||||||
@@ -69,7 +71,20 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, disableNeste
|
|||||||
} else {
|
} else {
|
||||||
archiveDestDir = archivesDestDir.appendingPathComponent(itemPath.lastPathComponent)
|
archiveDestDir = archivesDestDir.appendingPathComponent(itemPath.lastPathComponent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ignore duplicate archives
|
||||||
|
if let existingItemPath = fileEntries[archiveDestDir] {
|
||||||
|
throw makeError(code: .appcastError, "Duplicate update archives are not supported. Found '\(existingItemPath.lastPathComponent)' and '\(itemPath.lastPathComponent)'. Please remove one of them from the appcast generation directory.")
|
||||||
|
}
|
||||||
|
|
||||||
|
fileEntries[archiveDestDir] = itemPath
|
||||||
|
}
|
||||||
|
|
||||||
|
var unarchived: [String: ArchiveItem] = [:]
|
||||||
|
var updateParseError: Error? = nil
|
||||||
|
|
||||||
|
var running = 0
|
||||||
|
for (archiveDestDir, itemPath) in fileEntries {
|
||||||
let addItem = { (validateBundle: Bool) in
|
let addItem = { (validateBundle: Bool) in
|
||||||
do {
|
do {
|
||||||
let item = try ArchiveItem(fromArchive: itemPath, unarchivedDir: archiveDestDir, validateBundle: validateBundle, disableNestedCodeCheck: disableNestedCodeCheck)
|
let item = try ArchiveItem(fromArchive: itemPath, unarchivedDir: archiveDestDir, validateBundle: validateBundle, disableNestedCodeCheck: disableNestedCodeCheck)
|
||||||
@@ -77,10 +92,15 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, disableNeste
|
|||||||
print("Found archive", item)
|
print("Found archive", item)
|
||||||
}
|
}
|
||||||
objc_sync_enter(unarchived)
|
objc_sync_enter(unarchived)
|
||||||
unarchived.append(item)
|
// Make sure different archives don't contain the same update too
|
||||||
|
if let existingArchive = unarchived[item.version] {
|
||||||
|
updateParseError = makeError(code: .appcastError, "Duplicate updates are not supported. Found archives '\(existingArchive.archivePath.lastPathComponent)' and '\(itemPath.lastPathComponent)' which contain the same bundle version. Please remove one of these archives from the appcast generation directory.")
|
||||||
|
} else {
|
||||||
|
unarchived[item.version] = item
|
||||||
|
}
|
||||||
objc_sync_exit(unarchived)
|
objc_sync_exit(unarchived)
|
||||||
} catch {
|
} catch {
|
||||||
print("Skipped", item, error)
|
print("Skipped", itemPath.lastPathComponent, error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +127,10 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, disableNeste
|
|||||||
}
|
}
|
||||||
|
|
||||||
group.wait()
|
group.wait()
|
||||||
|
|
||||||
|
if let updateParseError = updateParseError {
|
||||||
|
throw updateParseError
|
||||||
|
}
|
||||||
|
|
||||||
return unarchived
|
return Array(unarchived.values)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user