mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0066846648 | ||
|
|
47fb37e55d | ||
|
|
c0bb61cc8f | ||
|
|
80c8c1ff3d | ||
|
|
464e269922 | ||
|
|
bb1e4d0907 | ||
|
|
8e27997de0 | ||
|
|
ff6418d3cd | ||
|
|
c263b969c0 | ||
|
|
3c0ebbf570 | ||
|
|
743e15cce8 | ||
|
|
77bf6ad890 | ||
|
|
f6b7693b75 | ||
|
|
f410960ac0 | ||
|
|
0b0a751d82 |
No files matched your search
@@ -2,9 +2,9 @@ name: Build & Tests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ 2.x, master ]
|
branches: [ 2.x, 2.2.x, master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ 2.x, master ]
|
branches: [ 2.x, 2.2.x, master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
@property (nonatomic, readonly) NSString *userName;
|
@property (nonatomic, readonly) NSString *userName;
|
||||||
@property (nonatomic) SUHost *host;
|
@property (nonatomic) SUHost *host;
|
||||||
@property (nonatomic, copy) NSString *updateDirectoryPath;
|
@property (nonatomic, copy) NSString *updateDirectoryPath;
|
||||||
|
@property (nonatomic, copy) NSString *extractionDirectory;
|
||||||
@property (nonatomic, copy) NSString *downloadName;
|
@property (nonatomic, copy) NSString *downloadName;
|
||||||
@property (nonatomic, copy) NSString *decryptionPassword;
|
@property (nonatomic, copy) NSString *decryptionPassword;
|
||||||
@property (nonatomic, strong) SUSignatures *signatures;
|
@property (nonatomic, strong) SUSignatures *signatures;
|
||||||
@@ -94,6 +95,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
@synthesize updateValidator = _updateValidator;
|
@synthesize updateValidator = _updateValidator;
|
||||||
@synthesize host = _host;
|
@synthesize host = _host;
|
||||||
@synthesize updateDirectoryPath = _updateDirectoryPath;
|
@synthesize updateDirectoryPath = _updateDirectoryPath;
|
||||||
|
@synthesize extractionDirectory = _extractionDirectory;
|
||||||
@synthesize downloadName = _downloadName;
|
@synthesize downloadName = _downloadName;
|
||||||
@synthesize decryptionPassword = _decryptionPassword;
|
@synthesize decryptionPassword = _decryptionPassword;
|
||||||
@synthesize signatures = _signatures;
|
@synthesize signatures = _signatures;
|
||||||
@@ -193,7 +195,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
[self.communicator handleMessageWithIdentifier:SPUExtractionStarted data:[NSData data]];
|
[self.communicator handleMessageWithIdentifier:SPUExtractionStarted data:[NSData data]];
|
||||||
|
|
||||||
NSString *archivePath = [self.updateDirectoryPath stringByAppendingPathComponent:self.downloadName];
|
NSString *archivePath = [self.updateDirectoryPath stringByAppendingPathComponent:self.downloadName];
|
||||||
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath updatingHostBundlePath:self.host.bundlePath decryptionPassword:self.decryptionPassword expectingInstallationType:self.installationType];
|
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath extractionDirectory:self.extractionDirectory updatingHostBundlePath:self.host.bundlePath decryptionPassword:self.decryptionPassword expectingInstallationType:self.installationType];
|
||||||
|
|
||||||
NSError *unarchiverError = nil;
|
NSError *unarchiverError = nil;
|
||||||
BOOL success = NO;
|
BOOL success = NO;
|
||||||
@@ -226,7 +228,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
[self.communicator handleMessageWithIdentifier:SPUValidationStarted data:[NSData data]];
|
[self.communicator handleMessageWithIdentifier:SPUValidationStarted data:[NSData data]];
|
||||||
|
|
||||||
NSError *validationError = nil;
|
NSError *validationError = nil;
|
||||||
BOOL validationSuccess = [self.updateValidator validateWithUpdateDirectory:self.updateDirectoryPath error:&validationError];
|
BOOL validationSuccess = [self.updateValidator validateWithUpdateDirectory:self.extractionDirectory error:&validationError];
|
||||||
|
|
||||||
if (!validationSuccess) {
|
if (!validationSuccess) {
|
||||||
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Update validation was a failure", NSUnderlyingErrorKey: validationError }]];
|
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Update validation was a failure", NSUnderlyingErrorKey: validationError }]];
|
||||||
@@ -276,6 +278,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
// but may as well set other fields to nil too
|
// but may as well set other fields to nil too
|
||||||
[self clearUpdateDirectory];
|
[self clearUpdateDirectory];
|
||||||
self.downloadName = nil;
|
self.downloadName = nil;
|
||||||
|
self.extractionDirectory = nil;
|
||||||
self.decryptionPassword = nil;
|
self.decryptionPassword = nil;
|
||||||
self.signatures = nil;
|
self.signatures = nil;
|
||||||
self.relaunchPath = nil;
|
self.relaunchPath = nil;
|
||||||
@@ -407,6 +410,13 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSString *extractionDirectory = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:cacheInstallationPath];
|
||||||
|
if (extractionDirectory == nil) {
|
||||||
|
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Failed to create installation extraction directory in %@", cacheInstallationPath] }]];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Carry these properities separately rather than using the SUInstallationInputData object
|
// Carry these properities separately rather than using the SUInstallationInputData object
|
||||||
// Some of our properties may slightly differ than our input and we don't want to make the mistake of using one of those
|
// 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;
|
||||||
@@ -414,6 +424,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
self.downloadName = installationData.downloadName;
|
self.downloadName = installationData.downloadName;
|
||||||
self.signatures = installationData.signatures;
|
self.signatures = installationData.signatures;
|
||||||
self.updateDirectoryPath = cacheInstallationPath;
|
self.updateDirectoryPath = cacheInstallationPath;
|
||||||
|
self.extractionDirectory = extractionDirectory;
|
||||||
self.host = [[SUHost alloc] initWithBundle:hostBundle];
|
self.host = [[SUHost alloc] initWithBundle:hostBundle];
|
||||||
|
|
||||||
[self extractAndInstallUpdate];
|
[self extractAndInstallUpdate];
|
||||||
@@ -463,7 +474,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
|||||||
|
|
||||||
dispatch_async(self.installerQueue, ^{
|
dispatch_async(self.installerQueue, ^{
|
||||||
NSError *installerError = nil;
|
NSError *installerError = nil;
|
||||||
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self.host expectedInstallationType:self.installationType updateDirectory:self.updateDirectoryPath homeDirectory:self.homeDirectory userName:self.userName error:&installerError];
|
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self.host expectedInstallationType:self.installationType updateDirectory:self.extractionDirectory homeDirectory:self.homeDirectory userName:self.userName error:&installerError];
|
||||||
|
|
||||||
if (installer == nil) {
|
if (installer == nil) {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
|
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||||
|
|
||||||
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath;
|
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
@property (nonatomic, copy, readonly) NSString *archivePath;
|
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||||
@property (nonatomic, copy, readonly) NSString *updateHostBundlePath;
|
@property (nonatomic, copy, readonly) NSString *updateHostBundlePath;
|
||||||
|
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
|
|
||||||
@synthesize archivePath = _archivePath;
|
@synthesize archivePath = _archivePath;
|
||||||
@synthesize updateHostBundlePath = _updateHostBundlePath;
|
@synthesize updateHostBundlePath = _updateHostBundlePath;
|
||||||
|
@synthesize extractionDirectory = _extractionDirectory;
|
||||||
|
|
||||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||||
{
|
{
|
||||||
@@ -73,12 +75,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath
|
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_archivePath = [archivePath copy];
|
_archivePath = [archivePath copy];
|
||||||
_updateHostBundlePath = [updateHostBundlePath copy];
|
_updateHostBundlePath = [updateHostBundlePath copy];
|
||||||
|
_extractionDirectory = [extractionDirectory copy];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -96,7 +99,7 @@
|
|||||||
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
|
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
|
||||||
{
|
{
|
||||||
NSString *sourcePath = self.updateHostBundlePath;
|
NSString *sourcePath = self.updateHostBundlePath;
|
||||||
NSString *targetPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
NSString *targetPath = [self.extractionDirectory stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||||
|
|
||||||
NSError *applyDiffError = nil;
|
NSError *applyDiffError = nil;
|
||||||
BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, ^(double progress){
|
BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, ^(double progress){
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@interface SUDiskImageUnarchiver : NSObject <SUUnarchiverProtocol>
|
@interface SUDiskImageUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||||
|
|
||||||
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword;
|
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
@property (nonatomic, copy, readonly) NSString *archivePath;
|
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||||
@property (nullable, nonatomic, copy, readonly) NSString *decryptionPassword;
|
@property (nullable, nonatomic, copy, readonly) NSString *decryptionPassword;
|
||||||
|
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@
|
|||||||
|
|
||||||
@synthesize archivePath = _archivePath;
|
@synthesize archivePath = _archivePath;
|
||||||
@synthesize decryptionPassword = _decryptionPassword;
|
@synthesize decryptionPassword = _decryptionPassword;
|
||||||
|
@synthesize extractionDirectory = _extractionDirectory;
|
||||||
|
|
||||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||||
{
|
{
|
||||||
@@ -35,12 +37,13 @@
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword
|
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_archivePath = [archivePath copy];
|
_archivePath = [archivePath copy];
|
||||||
_decryptionPassword = [decryptionPassword copy];
|
_decryptionPassword = [decryptionPassword copy];
|
||||||
|
_extractionDirectory = [extractionDirectory copy];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -189,7 +192,7 @@
|
|||||||
for (NSString *item in contents)
|
for (NSString *item in contents)
|
||||||
{
|
{
|
||||||
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
||||||
NSString *toPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
|
NSString *toPath = [self.extractionDirectory stringByAppendingPathComponent:item];
|
||||||
|
|
||||||
itemsCopied += 1.0;
|
itemsCopied += 1.0;
|
||||||
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
|
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
// An unarchiver for flat packages that doesn't really do any unarchiving
|
// An unarchiver for flat packages that doesn't really do any unarchiving
|
||||||
@interface SUFlatPackageUnarchiver : NSObject <SUUnarchiverProtocol>
|
@interface SUFlatPackageUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||||
|
|
||||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType;
|
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
@property (nonatomic, readonly) NSString *flatPackagePath;
|
@property (nonatomic, readonly) NSString *flatPackagePath;
|
||||||
@property (nonatomic, readonly) NSString *expectedInstallationType;
|
@property (nonatomic, readonly) NSString *expectedInstallationType;
|
||||||
|
@property (nonatomic, readonly) NSString *extractionDirectory;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
|
|
||||||
@synthesize flatPackagePath = _flatPackagePath;
|
@synthesize flatPackagePath = _flatPackagePath;
|
||||||
@synthesize expectedInstallationType = _expectedInstallationType;
|
@synthesize expectedInstallationType = _expectedInstallationType;
|
||||||
|
@synthesize extractionDirectory = _extractionDirectory;
|
||||||
|
|
||||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||||
{
|
{
|
||||||
@@ -36,12 +38,13 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType
|
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_flatPackagePath = [flatPackagePath copy];
|
_flatPackagePath = [flatPackagePath copy];
|
||||||
_expectedInstallationType = [installationType copy];
|
_expectedInstallationType = [installationType copy];
|
||||||
|
_extractionDirectory = [extractionDirectory copy];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -57,8 +60,20 @@
|
|||||||
} else if (![[NSFileManager defaultManager] fileExistsAtPath:self.flatPackagePath isDirectory:&isDirectory] || isDirectory) {
|
} else if (![[NSFileManager defaultManager] fileExistsAtPath:self.flatPackagePath isDirectory:&isDirectory] || isDirectory) {
|
||||||
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package does not exist at %@", self.flatPackagePath]}]];
|
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package does not exist at %@", self.flatPackagePath]}]];
|
||||||
} else {
|
} else {
|
||||||
[notifier notifyProgress:1.0];
|
// Copying the flat package should be very fast, especially on APFS
|
||||||
[notifier notifySuccess];
|
NSError *copyError = nil;
|
||||||
|
if (![[NSFileManager defaultManager] copyItemAtPath:self.flatPackagePath toPath:[self.extractionDirectory stringByAppendingPathComponent:self.flatPackagePath.lastPathComponent] error:©Error]) {
|
||||||
|
NSMutableDictionary *userInfoDictionary = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package (%@) cannot be copied to extraction directory (%@)", self.flatPackagePath, self.extractionDirectory]}];
|
||||||
|
|
||||||
|
if (copyError != nil) {
|
||||||
|
userInfoDictionary[NSUnderlyingErrorKey] = copyError;
|
||||||
|
}
|
||||||
|
|
||||||
|
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:userInfoDictionary]];
|
||||||
|
} else {
|
||||||
|
[notifier notifyProgress:1.0];
|
||||||
|
[notifier notifySuccess];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+28
-13
@@ -22,15 +22,6 @@
|
|||||||
|
|
||||||
@implementation SUInstaller
|
@implementation SUInstaller
|
||||||
|
|
||||||
+ (BOOL)isAliasFolderAtPath:(NSString *)path
|
|
||||||
{
|
|
||||||
NSNumber *aliasFlag = nil;
|
|
||||||
[[NSURL fileURLWithPath:path] getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:nil];
|
|
||||||
NSNumber *directoryFlag = nil;
|
|
||||||
[[NSURL fileURLWithPath:path] getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:nil];
|
|
||||||
return aliasFlag.boolValue && directoryFlag.boolValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr
|
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr
|
||||||
{
|
{
|
||||||
NSParameterAssert(inUpdateFolder);
|
NSParameterAssert(inUpdateFolder);
|
||||||
@@ -49,6 +40,34 @@
|
|||||||
|
|
||||||
while ((currentFile = [dirEnum nextObject])) {
|
while ((currentFile = [dirEnum nextObject])) {
|
||||||
NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
|
NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
|
||||||
|
|
||||||
|
// Ignore all symbolic links and aliases
|
||||||
|
{
|
||||||
|
NSURL *currentPathURL = [NSURL fileURLWithPath:currentPath];
|
||||||
|
|
||||||
|
NSNumber *symbolicLinkFlag = nil;
|
||||||
|
[currentPathURL getResourceValue:&symbolicLinkFlag forKey:NSURLIsSymbolicLinkKey error:NULL];
|
||||||
|
if (symbolicLinkFlag.boolValue) {
|
||||||
|
// NSDirectoryEnumerator won't recurse into symlinked directories
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSNumber *aliasFlag = nil;
|
||||||
|
[currentPathURL getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:NULL];
|
||||||
|
|
||||||
|
if (aliasFlag.boolValue) {
|
||||||
|
NSNumber *directoryFlag = nil;
|
||||||
|
[currentPathURL getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:NULL];
|
||||||
|
|
||||||
|
// Some DMGs have symlinks into /Applications! That's no good!
|
||||||
|
if (directoryFlag.boolValue) {
|
||||||
|
[dirEnum skipDescendents];
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NSString *currentFilename = [currentFile lastPathComponent];
|
NSString *currentFilename = [currentFile lastPathComponent];
|
||||||
NSString *currentExtension = [currentFile pathExtension];
|
NSString *currentExtension = [currentFile pathExtension];
|
||||||
NSString *currentFilenameNoExtension = [currentFilename stringByDeletingPathExtension];
|
NSString *currentFilenameNoExtension = [currentFilename stringByDeletingPathExtension];
|
||||||
@@ -78,10 +97,6 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some DMGs have symlinks into /Applications! That's no good!
|
|
||||||
if ([self isAliasFolderAtPath:currentPath])
|
|
||||||
[dirEnum skipDescendents];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't have a valid path. Try to use the fallback package.
|
// We don't have a valid path. Try to use the fallback package.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@interface SUPipedUnarchiver : NSObject <SUUnarchiverProtocol>
|
@interface SUPipedUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||||
|
|
||||||
- (instancetype)initWithArchivePath:(NSString *)archivePath;
|
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,14 @@
|
|||||||
@interface SUPipedUnarchiver ()
|
@interface SUPipedUnarchiver ()
|
||||||
|
|
||||||
@property (nonatomic, copy, readonly) NSString *archivePath;
|
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||||
|
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation SUPipedUnarchiver
|
@implementation SUPipedUnarchiver
|
||||||
|
|
||||||
@synthesize archivePath = _archivePath;
|
@synthesize archivePath = _archivePath;
|
||||||
|
@synthesize extractionDirectory = _extractionDirectory;
|
||||||
|
|
||||||
+ (nullable NSArray <NSString *> *)commandAndArgumentsConformingToTypeOfPath:(NSString *)path
|
+ (nullable NSArray <NSString *> *)commandAndArgumentsConformingToTypeOfPath:(NSString *)path
|
||||||
{
|
{
|
||||||
@@ -63,11 +65,12 @@
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithArchivePath:(NSString *)archivePath
|
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_archivePath = [archivePath copy];
|
_archivePath = [archivePath copy];
|
||||||
|
_extractionDirectory = [extractionDirectory copy];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -93,7 +96,7 @@
|
|||||||
{
|
{
|
||||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
|
NSString *destination = self.extractionDirectory;
|
||||||
|
|
||||||
SULog(SULogLevelDefault, @"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], self.archivePath, destination);
|
SULog(SULogLevelDefault, @"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], self.archivePath, destination);
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@interface SUUnarchiver : NSObject
|
@interface SUUnarchiver : NSObject
|
||||||
|
|
||||||
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
|
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -18,21 +18,21 @@
|
|||||||
|
|
||||||
@implementation SUUnarchiver
|
@implementation SUUnarchiver
|
||||||
|
|
||||||
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
|
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
|
||||||
{
|
{
|
||||||
if ([SUPipedUnarchiver canUnarchivePath:path]) {
|
if ([SUPipedUnarchiver canUnarchivePath:path]) {
|
||||||
return [[SUPipedUnarchiver alloc] initWithArchivePath:path];
|
return [[SUPipedUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory];
|
||||||
|
|
||||||
} else if ([SUDiskImageUnarchiver canUnarchivePath:path]) {
|
} else if ([SUDiskImageUnarchiver canUnarchivePath:path]) {
|
||||||
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path decryptionPassword:decryptionPassword];
|
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory decryptionPassword:decryptionPassword];
|
||||||
|
|
||||||
} else if ([SUBinaryDeltaUnarchiver canUnarchivePath:path]) {
|
} else if ([SUBinaryDeltaUnarchiver canUnarchivePath:path]) {
|
||||||
assert(hostPath != nil);
|
assert(hostPath != nil);
|
||||||
NSString *nonNullHostPath = hostPath;
|
NSString *nonNullHostPath = hostPath;
|
||||||
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
|
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory updateHostBundlePath:nonNullHostPath];
|
||||||
} else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
|
} else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
|
||||||
// Flat packages are only supported for guided packaage installs
|
// Flat packages are only supported for guided packaage installs
|
||||||
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path expectingInstallationType:installationType];
|
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path extractionDirectory:extractionDirectory expectingInstallationType:installationType];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|||||||
+43
-8
@@ -12,15 +12,18 @@
|
|||||||
|
|
||||||
#include "AppKitPrevention.h"
|
#include "AppKitPrevention.h"
|
||||||
|
|
||||||
|
#define REPLY_STATUS_INFO_TIMEOUT 2
|
||||||
|
|
||||||
@interface StatusInfo () <NSXPCListenerDelegate>
|
@interface StatusInfo () <NSXPCListenerDelegate>
|
||||||
|
|
||||||
@property (nonatomic) NSXPCListener *xpcListener;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation StatusInfo
|
@implementation StatusInfo
|
||||||
|
{
|
||||||
|
NSXPCListener *_xpcListener;
|
||||||
|
NSMutableDictionary *_pendingReplies;
|
||||||
|
NSUInteger _pendingReplyCounter;
|
||||||
|
}
|
||||||
|
|
||||||
@synthesize xpcListener = _xpcListener;
|
|
||||||
@synthesize installationInfoData = _installationInfoData;
|
@synthesize installationInfoData = _installationInfoData;
|
||||||
|
|
||||||
- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier
|
- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier
|
||||||
@@ -29,19 +32,20 @@
|
|||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_xpcListener = [[NSXPCListener alloc] initWithMachServiceName:SPUStatusInfoServiceNameForBundleIdentifier(bundleIdentifier)];
|
_xpcListener = [[NSXPCListener alloc] initWithMachServiceName:SPUStatusInfoServiceNameForBundleIdentifier(bundleIdentifier)];
|
||||||
_xpcListener.delegate = self;
|
_xpcListener.delegate = self;
|
||||||
|
_pendingReplies = [NSMutableDictionary dictionary];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)startListener
|
- (void)startListener
|
||||||
{
|
{
|
||||||
[self.xpcListener resume];
|
[_xpcListener resume];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)invalidate
|
- (void)invalidate
|
||||||
{
|
{
|
||||||
[self.xpcListener invalidate];
|
[_xpcListener invalidate];
|
||||||
self.xpcListener = nil;
|
_xpcListener = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)listener:(NSXPCListener *)__unused listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection
|
- (BOOL)listener:(NSXPCListener *)__unused listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection
|
||||||
@@ -54,10 +58,41 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setInstallationInfoData:(NSData *)installationInfoData
|
||||||
|
{
|
||||||
|
_installationInfoData = installationInfoData;
|
||||||
|
|
||||||
|
// Respond to all of our pending replies
|
||||||
|
for (NSNumber *replyKey in _pendingReplies) {
|
||||||
|
void (^replyBlock)(NSData * _Nullable) = self->_pendingReplies[replyKey];
|
||||||
|
replyBlock(_installationInfoData);
|
||||||
|
}
|
||||||
|
|
||||||
|
[_pendingReplies removeAllObjects];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable))reply
|
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable))reply
|
||||||
{
|
{
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
reply(self.installationInfoData);
|
if (self->_installationInfoData != nil) {
|
||||||
|
reply(self->_installationInfoData);
|
||||||
|
} else {
|
||||||
|
// If we don't have the installation info data currently, we may receive it in a very short window afterwards
|
||||||
|
// In this case wait a bit for the reply. If we receive the data it will be in -setInstallationInfoData:
|
||||||
|
NSUInteger currentReplyCounter = self->_pendingReplyCounter;
|
||||||
|
self->_pendingReplyCounter++;
|
||||||
|
|
||||||
|
NSNumber *currentReplyCounterKey = @(currentReplyCounter);
|
||||||
|
self->_pendingReplies[currentReplyCounterKey] = [reply copy];
|
||||||
|
|
||||||
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(REPLY_STATUS_INFO_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
|
void (^replyBlock)(NSData * _Nullable) = self->_pendingReplies[currentReplyCounterKey];
|
||||||
|
if (replyBlock != nil) {
|
||||||
|
replyBlock(self->_installationInfoData);
|
||||||
|
[self->_pendingReplies removeObjectForKey:currentReplyCounterKey];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -28,7 +28,11 @@ int main(int __unused argc, const char __unused *argv[])
|
|||||||
|
|
||||||
dispatch_source_t sigtermSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue());
|
dispatch_source_t sigtermSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue());
|
||||||
dispatch_source_set_event_handler(sigtermSource, ^{
|
dispatch_source_set_event_handler(sigtermSource, ^{
|
||||||
[appInstaller cleanupAndExitWithStatus:SIGTERM error:nil];
|
// Don't clear the update directory because the installer may be in middle of installing an update
|
||||||
|
// We still need to set an event handler for receiving SIGTERM though, otherwise our job may not terminate
|
||||||
|
// (This is also recommended from the developer documentation).
|
||||||
|
// Simply exit with SIGTERM if we recieve this signal
|
||||||
|
exit(SIGTERM);
|
||||||
});
|
});
|
||||||
dispatch_resume(sigtermSource);
|
dispatch_resume(sigtermSource);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
# 2.2.2
|
||||||
|
|
||||||
|
* Critical update alerts may not show up as promptly as they should when they are being automatically installed (#2230) (Zorg)
|
||||||
|
* Remove module imports from framework headers (#2217) (Zorg)
|
||||||
|
* Update Portuguese localization (#2224) (Kent Sutherland)
|
||||||
|
* Update zh_TW localization (#2246) (Chiahong)
|
||||||
|
|
||||||
# 2.2.1
|
# 2.2.1
|
||||||
|
|
||||||
* Make scroll bar dark in dark theme for Release Notes by default (#2187) (Pavel Moiseenko)
|
* Make scroll bar dark in dark theme for Release Notes by default (#2187) (Pavel Moiseenko)
|
||||||
|
|||||||
+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"}
|
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz"}
|
||||||
@@ -43,12 +43,12 @@ SPARKLE_ICON_NAME = AppIcon
|
|||||||
// These variables must have a space after the '=' too
|
// These variables must have a space after the '=' too
|
||||||
SPARKLE_VERSION_MAJOR = 2
|
SPARKLE_VERSION_MAJOR = 2
|
||||||
SPARKLE_VERSION_MINOR = 2
|
SPARKLE_VERSION_MINOR = 2
|
||||||
SPARKLE_VERSION_PATCH = 1
|
SPARKLE_VERSION_PATCH = 2
|
||||||
|
|
||||||
// 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 =
|
||||||
CURRENT_PROJECT_VERSION = 2017
|
CURRENT_PROJECT_VERSION = 2017.1
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
+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.2.1"
|
let version = "2.2.2"
|
||||||
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
||||||
let tag = "2.2.1"
|
let tag = "2.2.2"
|
||||||
let checksum = "ce1e73dccebfd06c638ea9fc37451a690ea3137e1333406ec5dddb9e11b4e1b5"
|
let checksum = "aafce90805ca50d099c32e744636b2524a7382629f8f7e14ff21c84634125a44"
|
||||||
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.2.1"
|
s.version = "2.2.2"
|
||||||
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"
|
||||||
|
|||||||
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2021 Sparkle Project. All rights reserved.
|
// Copyright © 2021 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILDING_SPARKLE_DOWNLOADER_SERVICE
|
#ifdef BUILDING_SPARKLE_DOWNLOADER_SERVICE
|
||||||
// Ignore incorrect warning
|
// Ignore incorrect warning
|
||||||
|
|||||||
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SPUUserDriver.h>
|
#import <Sparkle/SPUUserDriver.h>
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
|
|||||||
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
#import <Sparkle/SPUUserDriver.h>
|
#import <Sparkle/SPUUserDriver.h>
|
||||||
|
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
#import <Sparkle/SPUUpdateCheck.h>
|
#import <Sparkle/SPUUpdateCheck.h>
|
||||||
|
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <Sparkle/SPUUserUpdateState.h>
|
#import <Sparkle/SPUUserUpdateState.h>
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|||||||
Vendored
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SPUUserUpdateState_h
|
#ifndef SPUUserUpdateState_h
|
||||||
#define SPUUserUpdateState_h
|
#define SPUUserUpdateState_h
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2021 Sparkle Project. All rights reserved.
|
// Copyright © 2021 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
|||||||
Vendored
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SUAPPCAST_H
|
#ifndef SUAPPCAST_H
|
||||||
#define SUAPPCAST_H
|
#define SUAPPCAST_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|||||||
Vendored
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SUAppcastItem_Private_h
|
#ifndef SUAppcastItem_Private_h
|
||||||
#define SUAppcastItem_Private_h
|
#define SUAppcastItem_Private_h
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
|||||||
Vendored
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SUAPPCASTITEM_H
|
#ifndef SUAPPCASTITEM_H
|
||||||
#define SUAPPCASTITEM_H
|
#define SUAPPCASTITEM_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILDING_SPARKLE_TESTS
|
#ifdef BUILDING_SPARKLE_TESTS
|
||||||
// Ignore incorrect warning
|
// Ignore incorrect warning
|
||||||
|
|||||||
Vendored
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SUERRORS_H
|
#ifndef SUERRORS_H
|
||||||
#define SUERRORS_H
|
#define SUERRORS_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BUILDING_SPARKLE_TOOL) || defined(BUILDING_SPARKLE_TESTS)
|
#if defined(BUILDING_SPARKLE_TOOL) || defined(BUILDING_SPARKLE_TESTS)
|
||||||
// Ignore incorrect warning
|
// Ignore incorrect warning
|
||||||
|
|||||||
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
|
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
|
||||||
#define SUSTANDARDVERSIONCOMPARATOR_H
|
#define SUSTANDARDVERSIONCOMPARATOR_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILDING_SPARKLE_TOOL
|
#ifdef BUILDING_SPARKLE_TOOL
|
||||||
// Ignore incorrect warning
|
// Ignore incorrect warning
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Vendored
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SUUPDATER_H
|
#ifndef SUUPDATER_H
|
||||||
#define SUUPDATER_H
|
#define SUUPDATER_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
#import <Sparkle/SUVersionComparisonProtocol.h>
|
#import <Sparkle/SUVersionComparisonProtocol.h>
|
||||||
#import <Sparkle/SUVersionDisplayProtocol.h>
|
#import <Sparkle/SUVersionDisplayProtocol.h>
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
@protocol SUVersionComparison, SUVersionDisplay;
|
@protocol SUVersionComparison, SUVersionDisplay;
|
||||||
|
|||||||
-7
@@ -9,14 +9,7 @@
|
|||||||
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
|
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
|
||||||
#define SUVERSIONCOMPARISONPROTOCOL_H
|
#define SUVERSIONCOMPARISONPROTOCOL_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILDING_SPARKLE_TOOL
|
#ifdef BUILDING_SPARKLE_TOOL
|
||||||
// Ignore incorrect warning
|
// Ignore incorrect warning
|
||||||
|
|||||||
Vendored
-7
@@ -6,14 +6,7 @@
|
|||||||
// Copyright 2009 Elgato Systems GmbH. All rights reserved.
|
// Copyright 2009 Elgato Systems GmbH. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
#if __has_warning("-Watimport-in-framework-header")
|
|
||||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
||||||
#endif
|
|
||||||
@import Foundation;
|
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
|
||||||
#import <Sparkle/SUExport.h>
|
#import <Sparkle/SUExport.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"%@ %@ is currently the newest version available." = "O %1$@ %2$@ é neste momento a versão mais recente disponível.";
|
"%@ %@ is currently the newest version available." = "O %1$@ %2$@ é neste momento a versão mais recente disponível.";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "O %1$@ %2$@ é neste momento a versão mais recente disponível.\n(You are currently running version %3$@.)";
|
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "O %1$@ %2$@ é neste momento a versão mais recente disponível.\n(Neste momento está na versão %3$@.)";
|
||||||
|
|
||||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "O %1$@ %2$@ está agora disponível e tem a versão %3$@. Gostaria de o transferir agora?";
|
"%@ %@ is now available—you have %@. Would you like to download it now?" = "O %1$@ %2$@ está agora disponível e tem a versão %3$@. Gostaria de o transferir agora?";
|
||||||
|
|||||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ 已是目前最新的版本。";
|
"%@ %@ is currently the newest version available." = "%1$@ %2$@ 已是目前最新的版本。";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ 已是目前最新的版本。\n(You are currently running version %3$@.)";
|
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ 已是目前最新的版本。\n(您正在執行的版本是 %3$@。)";
|
||||||
|
|
||||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ 現在已可取得,您的版本則是 %3$@。您要現在下載嗎?";
|
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ 現在已可取得,您的版本則是 %3$@。您要現在下載嗎?";
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
"Updating %@" = "正在更新 %@";
|
"Updating %@" = "正在更新 %@";
|
||||||
|
|
||||||
/* No comment provided by engineer. */
|
/* No comment provided by engineer. */
|
||||||
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "請將 %1$@ 移至您的“應用程式”檔案夾,從該處重新啟動,然後再試一次。";
|
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "請將 %1$@ 移至您的「應用程式」檔案夾,從該處重新啟動,然後再試一次。";
|
||||||
|
|
||||||
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
||||||
"You’re up-to-date!" = "你已有最新版本!";
|
"You’re up-to-date!" = "您已有最新版本!";
|
||||||
@@ -24,10 +24,9 @@ class SUUnarchiverTest: XCTestCase
|
|||||||
let unarchivedSuccessExpectation = super.expectation(description: "Unarchived Success (format: \(archiveExtension))")
|
let unarchivedSuccessExpectation = super.expectation(description: "Unarchived Success (format: \(archiveExtension))")
|
||||||
let unarchivedFailureExpectation = super.expectation(description: "Unarchived Failure (format: \(archiveExtension))")
|
let unarchivedFailureExpectation = super.expectation(description: "Unarchived Failure (format: \(archiveExtension))")
|
||||||
|
|
||||||
let tempArchiveURL = tempDirectoryURL.appendingPathComponent(archiveResourceURL.lastPathComponent)
|
|
||||||
let extractedAppURL = tempDirectoryURL.appendingPathComponent(extractedAppName).appendingPathExtension("app")
|
let extractedAppURL = tempDirectoryURL.appendingPathComponent(extractedAppName).appendingPathExtension("app")
|
||||||
|
|
||||||
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, tempArchiveURL: tempArchiveURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
|
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
|
||||||
self.unarchiveNonExistentFileTestFailureAppWithExtension(archiveExtension, tempDirectoryURL: tempDirectoryURL, password: password, expectingInstallationType: installationType, testExpectation: unarchivedFailureExpectation)
|
self.unarchiveNonExistentFileTestFailureAppWithExtension(archiveExtension, tempDirectoryURL: tempDirectoryURL, password: password, expectingInstallationType: installationType, testExpectation: unarchivedFailureExpectation)
|
||||||
|
|
||||||
super.waitForExpectations(timeout: 30.0, handler: nil)
|
super.waitForExpectations(timeout: 30.0, handler: nil)
|
||||||
@@ -40,7 +39,7 @@ class SUUnarchiverTest: XCTestCase
|
|||||||
|
|
||||||
func unarchiveNonExistentFileTestFailureAppWithExtension(_ archiveExtension: String, tempDirectoryURL: URL, password: String?, expectingInstallationType installationType: String, testExpectation: XCTestExpectation) {
|
func unarchiveNonExistentFileTestFailureAppWithExtension(_ archiveExtension: String, tempDirectoryURL: URL, password: String?, expectingInstallationType installationType: String, testExpectation: XCTestExpectation) {
|
||||||
let tempArchiveURL = tempDirectoryURL.appendingPathComponent("error-invalid").appendingPathExtension(archiveExtension)
|
let tempArchiveURL = tempDirectoryURL.appendingPathComponent("error-invalid").appendingPathExtension(archiveExtension)
|
||||||
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
||||||
|
|
||||||
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
||||||
XCTAssertNotNil(error)
|
XCTAssertNotNil(error)
|
||||||
@@ -49,13 +48,9 @@ class SUUnarchiverTest: XCTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
// swiftlint:disable function_parameter_count
|
// swiftlint:disable function_parameter_count
|
||||||
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, tempArchiveURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
|
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
|
||||||
|
|
||||||
let fileManager = FileManager.default
|
let unarchiver = SUUnarchiver.unarchiver(forPath: archiveResourceURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
||||||
|
|
||||||
try! fileManager.copyItem(at: archiveResourceURL, to: tempArchiveURL)
|
|
||||||
|
|
||||||
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
|
||||||
|
|
||||||
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
||||||
if expectingSuccess {
|
if expectingSuccess {
|
||||||
@@ -130,7 +125,7 @@ class SUUnarchiverTest: XCTestCase
|
|||||||
self.unarchiveTestAppWithExtension("dmg", resourceName: "SparkleTestCodeSign_apfs")
|
self.unarchiveTestAppWithExtension("dmg", resourceName: "SparkleTestCodeSign_apfs")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testUnarchivingFlatPackage()
|
func testUnarchivingBarePackage()
|
||||||
{
|
{
|
||||||
self.unarchiveTestAppWithExtension("pkg", resourceName: "test", expectingInstallationType: SPUInstallationTypeGuidedPackage)
|
self.unarchiveTestAppWithExtension("pkg", resourceName: "test", expectingInstallationType: SPUInstallationTypeGuidedPackage)
|
||||||
|
|
||||||
|
|||||||
@@ -8,38 +8,26 @@ import Foundation
|
|||||||
func unarchive(itemPath: URL, archiveDestDir: URL, callback: @escaping (Error?) -> Void) {
|
func unarchive(itemPath: URL, archiveDestDir: URL, callback: @escaping (Error?) -> Void) {
|
||||||
let fileManager = FileManager.default
|
let fileManager = FileManager.default
|
||||||
let tempDir = archiveDestDir.appendingPathExtension("tmp")
|
let tempDir = archiveDestDir.appendingPathExtension("tmp")
|
||||||
let itemCopy = tempDir.appendingPathComponent(itemPath.lastPathComponent)
|
|
||||||
|
|
||||||
|
_ = try? fileManager.removeItem(at: tempDir)
|
||||||
_ = try? fileManager.createDirectory(at: tempDir, withIntermediateDirectories: true, attributes: [:])
|
_ = try? fileManager.createDirectory(at: tempDir, withIntermediateDirectories: true, attributes: [:])
|
||||||
|
|
||||||
do {
|
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemPath.path, extractionDirectory: tempDir.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
|
||||||
do {
|
unarchiver.unarchive(completionBlock: { (error: Error?) in
|
||||||
try fileManager.linkItem(at: itemPath, to: itemCopy)
|
if error != nil {
|
||||||
} catch {
|
callback(error)
|
||||||
try fileManager.copyItem(at: itemPath, to: itemCopy)
|
return
|
||||||
}
|
}
|
||||||
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemCopy.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
|
|
||||||
unarchiver.unarchive(completionBlock: { (error: Error?) in
|
|
||||||
if error != nil {
|
|
||||||
callback(error)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
_ = try? fileManager.removeItem(at: itemCopy)
|
do {
|
||||||
do {
|
try fileManager.moveItem(at: tempDir, to: archiveDestDir)
|
||||||
try fileManager.moveItem(at: tempDir, to: archiveDestDir)
|
callback(nil)
|
||||||
callback(nil)
|
} catch {
|
||||||
} catch {
|
callback(error)
|
||||||
callback(error)
|
}
|
||||||
}
|
}, progressBlock: nil)
|
||||||
}, progressBlock: nil)
|
} else {
|
||||||
} else {
|
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemPath.path)"))
|
||||||
_ = try? fileManager.removeItem(at: itemCopy)
|
|
||||||
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemCopy)"))
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
_ = try? fileManager.removeItem(at: tempDir)
|
|
||||||
callback(error)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user