mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
35
Commits
2.9.0-beta.1
...
2.9.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6276ba2b40 | ||
|
|
113279a21f | ||
|
|
7c4741d762 | ||
|
|
5df807d5ac | ||
|
|
c6ab245eba | ||
|
|
6e370a5ab8 | ||
|
|
cbdc150cfb | ||
|
|
fe7b718d07 | ||
|
|
d2b796bc3e | ||
|
|
2f33f56afb | ||
|
|
f27a02f068 | ||
|
|
1520cda1bd | ||
|
|
066e75a8b3 | ||
|
|
e97ba759e1 | ||
|
|
c625894761 | ||
|
|
c1dbf52970 | ||
|
|
cd20a12e92 | ||
|
|
59ff700f51 | ||
|
|
829fa4c38b | ||
|
|
ae10c16bbb | ||
|
|
a888daa6f5 | ||
|
|
61a100ab89 | ||
|
|
21d8df8044 | ||
|
|
cb33faafa2 | ||
|
|
79475ea34a | ||
|
|
aa42f7a020 | ||
|
|
a3f136022a | ||
|
|
192dce5f72 | ||
|
|
afea2cda87 | ||
|
|
99ace46e4a | ||
|
|
90eff791ec | ||
|
|
7ba3dedd6d | ||
|
|
7c460d70f6 | ||
|
|
596b6b031b | ||
|
|
480b895279 |
No files matched your search
@@ -31,7 +31,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout sources"
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
submodules: true
|
||||
|
||||
@@ -97,6 +97,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
|
||||
// Setting _performedStage1Installation on main thread must be synchronzied with reading it from new connection handler
|
||||
BOOL _performedStage1Installation;
|
||||
BOOL _receivedAppcastItemData;
|
||||
|
||||
BOOL _performedStage2Installation;
|
||||
BOOL _performedStage3Installation;
|
||||
@@ -142,9 +143,9 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
BOOL connectionCodeSigningValidationSkipped = NO;
|
||||
#endif
|
||||
|
||||
// It's safe to allow any connections once stage 1 installation is complete
|
||||
// It's safe to allow any connections once stage 1 installation is complete and appcast data has been received.
|
||||
// This is to allow general updaters to resume the installation.
|
||||
if (!_performedStage1Installation) {
|
||||
if (!_performedStage1Installation || !_receivedAppcastItemData) {
|
||||
BOOL passesValidation;
|
||||
NSError *validationError = nil;
|
||||
SUValidateConnectionStatus status = [SUCodeSigningVerifier validateConnection:newConnection error:&validationError];
|
||||
@@ -597,15 +598,21 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
[self extractAndInstallUpdate];
|
||||
});
|
||||
} else if (identifier == SPUSentUpdateAppcastItemData) {
|
||||
SUAppcastItem *updateItem = (data != nil) ? (SUAppcastItem *)SPUUnarchiveRootObjectSecurely(data, [SUAppcastItem class]) : nil;
|
||||
if (updateItem != nil) {
|
||||
SPUInstallationInfo *installationInfo = [[SPUInstallationInfo alloc] initWithAppcastItem:updateItem];
|
||||
os_unfair_lock_lock(&_newConnectionLock);
|
||||
if (!_receivedAppcastItemData) {
|
||||
_receivedAppcastItemData = YES;
|
||||
|
||||
NSData *archivedData = SPUArchiveRootObjectSecurely(installationInfo);
|
||||
if (archivedData != nil) {
|
||||
[_agentConnection.agent registerInstallationInfoData:archivedData];
|
||||
SUAppcastItem *updateItem = (data != nil) ? (SUAppcastItem *)SPUUnarchiveRootObjectSecurely(data, [SUAppcastItem class]) : nil;
|
||||
if (updateItem != nil) {
|
||||
SPUInstallationInfo *installationInfo = [[SPUInstallationInfo alloc] initWithAppcastItem:updateItem];
|
||||
|
||||
NSData *archivedData = SPUArchiveRootObjectSecurely(installationInfo);
|
||||
if (archivedData != nil) {
|
||||
[_agentConnection.agent registerInstallationInfoData:archivedData];
|
||||
}
|
||||
}
|
||||
}
|
||||
os_unfair_lock_unlock(&_newConnectionLock);
|
||||
} else if (identifier == SPUResumeInstallationToStage2 && data.length == sizeof(uint8_t) * 2) {
|
||||
// Because anyone can ask us to resume the installation, it may be wise to think about backwards compatibility here if IPC changes
|
||||
uint8_t relaunch = *((const uint8_t *)data.bytes);
|
||||
|
||||
@@ -178,7 +178,7 @@ typedef struct
|
||||
FILE *file = _file;
|
||||
void *compressionBuffer = _compressionBuffer;
|
||||
|
||||
_compressionStream.dst_ptr = buffer;
|
||||
_compressionStream.dst_ptr = (uint8_t *)buffer;
|
||||
_compressionStream.dst_size = (size_t)length;
|
||||
|
||||
while (_compressionStream.dst_size > 0) {
|
||||
@@ -194,7 +194,7 @@ typedef struct
|
||||
}
|
||||
|
||||
// Reset source buffer
|
||||
_compressionStream.src_ptr = compressionBuffer;
|
||||
_compressionStream.src_ptr = (const uint8_t *)compressionBuffer;
|
||||
_compressionStream.src_size = bytesRead;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ static compression_algorithm compressionAlgorithmForMode(SPUDeltaCompressionMode
|
||||
return nil;
|
||||
}
|
||||
|
||||
SPUDeltaCompressionMode compression = 0;
|
||||
SPUDeltaCompressionMode compression = SPUDeltaCompressionModeNone;
|
||||
if (fread(&compression, sizeof(compression), 1, file) < 1) {
|
||||
_error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to read compression value from patch file: %@", patchFile] }];
|
||||
return nil;
|
||||
@@ -379,7 +379,7 @@ static compression_algorithm compressionAlgorithmForMode(SPUDeltaCompressionMode
|
||||
return @[];
|
||||
}
|
||||
|
||||
char *fileTableData = calloc(1, filePathSectionSize);
|
||||
char *fileTableData = (char *)calloc(1, filePathSectionSize);
|
||||
if (fileTableData == NULL) {
|
||||
_error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to calloc() %llu bytes for relative file paths.", filePathSectionSize] }];
|
||||
return nil;
|
||||
@@ -449,7 +449,7 @@ static compression_algorithm compressionAlgorithmForMode(SPUDeltaCompressionMode
|
||||
{
|
||||
uint64_t currentItemIndex = 0;
|
||||
while (YES) {
|
||||
SPUDeltaItemCommands commands = 0;
|
||||
SPUDeltaItemCommands commands = (SPUDeltaItemCommands)0;
|
||||
if (![self _readBuffer:&commands length:sizeof(commands)]) {
|
||||
break;
|
||||
}
|
||||
@@ -715,14 +715,14 @@ static compression_algorithm compressionAlgorithmForMode(SPUDeltaCompressionMode
|
||||
case SPUDeltaCompressionModeLZFSE:
|
||||
case SPUDeltaCompressionModeLZ4:
|
||||
case SPUDeltaCompressionModeZLIB: {
|
||||
_compressionStream.src_ptr = buffer;
|
||||
_compressionStream.src_ptr = (const uint8_t *)buffer;
|
||||
_compressionStream.src_size = (size_t)length;
|
||||
|
||||
FILE *file = _file;
|
||||
void *compressionBuffer = _compressionBuffer;
|
||||
while (_compressionStream.src_size > 0) {
|
||||
// Reset destination buffer
|
||||
_compressionStream.dst_ptr = compressionBuffer;
|
||||
_compressionStream.dst_ptr = (uint8_t *)compressionBuffer;
|
||||
_compressionStream.dst_size = COMPRESSION_BUFFER_SIZE;
|
||||
|
||||
if (compression_stream_process(&_compressionStream, 0) == COMPRESSION_STATUS_ERROR) {
|
||||
@@ -1259,7 +1259,7 @@ static compression_algorithm compressionAlgorithmForMode(SPUDeltaCompressionMode
|
||||
_compressionStream.src_size = 0;
|
||||
|
||||
while (_compressionStream.dst_size > 0) {
|
||||
_compressionStream.dst_ptr = compressionBuffer;
|
||||
_compressionStream.dst_ptr = (uint8_t *)compressionBuffer;
|
||||
_compressionStream.dst_size = COMPRESSION_BUFFER_SIZE;
|
||||
|
||||
compression_status status = compression_stream_process(&_compressionStream, COMPRESSION_STREAM_FINALIZE);
|
||||
|
||||
@@ -252,7 +252,7 @@ static xar_file_t xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTab
|
||||
NSArray<NSString *> *subpathComponents = [relativePathComponents subarrayWithRange:NSMakeRange(0, componentIndex + 1)];
|
||||
NSString *subpathKey = [subpathComponents componentsJoinedByString:@"/"];
|
||||
|
||||
xar_file_t cachedFile = [fileTable[subpathKey] pointerValue];
|
||||
xar_file_t cachedFile = (xar_file_t)[fileTable[subpathKey] pointerValue];
|
||||
if (cachedFile != NULL) {
|
||||
lastParent = cachedFile;
|
||||
} else {
|
||||
@@ -349,7 +349,7 @@ static xar_file_t xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTab
|
||||
continue;
|
||||
}
|
||||
|
||||
SPUDeltaItemCommands commands = 0;
|
||||
SPUDeltaItemCommands commands = (SPUDeltaItemCommands)0;
|
||||
{
|
||||
const char *value = NULL;
|
||||
if (xar_prop_get(file, DELETE_KEY, &value) == 0) {
|
||||
@@ -399,7 +399,7 @@ static xar_file_t xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTab
|
||||
assert(item.itemFilePath != nil);
|
||||
assert(item.xarContext != NULL);
|
||||
|
||||
xar_file_t file = item.xarContext;
|
||||
xar_file_t file = (xar_file_t)item.xarContext;
|
||||
if (xar_extract_tofile(_x, file, item.itemFilePath.fileSystemRepresentation) != 0) {
|
||||
_error = [NSError errorWithDomain:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_DOMAIN code:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_CODE_EXTRACT_FAILURE userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to extract xar file entry to %@", item.itemFilePath] }];
|
||||
return NO;
|
||||
|
||||
@@ -41,7 +41,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
|
||||
|
||||
progressCallback(0/7.0);
|
||||
|
||||
SUBinaryDeltaMajorVersion majorDiffVersion = header.majorVersion;
|
||||
SUBinaryDeltaMajorVersion majorDiffVersion = (SUBinaryDeltaMajorVersion)header.majorVersion;
|
||||
uint16_t minorDiffVersion = header.minorVersion;
|
||||
|
||||
unsigned char *expectedBeforeHash = header.beforeTreeHash;
|
||||
@@ -177,7 +177,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
|
||||
[archive enumerateItems:^(SPUDeltaArchiveItem *item, BOOL *stop) {
|
||||
NSString *relativePath = item.relativeFilePath;
|
||||
|
||||
if ([relativePath.pathComponents containsObject:@".."]) {
|
||||
NSArray<NSString *> *relativePathComponents = relativePath.pathComponents;
|
||||
if ([relativePathComponents containsObject:@".."]) {
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Relative path '%@' contains '..' path component", relativePath] }];
|
||||
}
|
||||
@@ -187,18 +188,40 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
|
||||
|
||||
NSString *sourceFilePath = [source stringByAppendingPathComponent:relativePath];
|
||||
NSString *destinationFilePath = [destination stringByAppendingPathComponent:relativePath];
|
||||
|
||||
{
|
||||
NSString *destinationParentDirectory = destinationFilePath.stringByDeletingLastPathComponent;
|
||||
NSDictionary<NSFileAttributeKey, id> *destinationParentDirectoryAttributes = [fileManager attributesOfItemAtPath:destinationParentDirectory error:NULL];
|
||||
|
||||
// It is OK for the directory parent to not exist if it has already been removed
|
||||
if (destinationParentDirectoryAttributes != nil) {
|
||||
// But if it does exist, make sure the entry in the parent directory we're looking at is good
|
||||
// If it's inside a symlink, this is not good in any circumstance
|
||||
NSString *fileType = destinationParentDirectoryAttributes[NSFileType];
|
||||
if ([fileType isEqualToString:NSFileTypeSymbolicLink]) {
|
||||
// Walk each intermediate directory component of relativePath, excluding the last component, and verify none are symlinks.
|
||||
NSUInteger relativePathComponentCount = relativePathComponents.count;
|
||||
NSString *cumulativePath = destination;
|
||||
for (NSUInteger relativePathComponentIndex = 0; relativePathComponentIndex + 1 < relativePathComponentCount; relativePathComponentIndex++) {
|
||||
cumulativePath = [cumulativePath stringByAppendingPathComponent:relativePathComponents[relativePathComponentIndex]];
|
||||
|
||||
char cumulativePathBuffer[PATH_MAX + 1] = {0};
|
||||
if (![cumulativePath getFileSystemRepresentation:cumulativePathBuffer maxLength:PATH_MAX]) {
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to create patch because '%@' cannot be a symbolic link.", destinationParentDirectory] }];
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to create patch because '%@' cannot be converted to file system path.", cumulativePath] }];
|
||||
}
|
||||
*stop = YES;
|
||||
return;
|
||||
}
|
||||
|
||||
struct stat cumulativePathStat = {0};
|
||||
if (lstat(cumulativePathBuffer, &cumulativePathStat) != 0) {
|
||||
if (errno == ENOENT) {
|
||||
// Directory doesn't exist, so it can't be a symlink - safe to continue
|
||||
break;
|
||||
}
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to create patch because failed to stat '%@' with error: %d", cumulativePath, errno] }];
|
||||
}
|
||||
*stop = YES;
|
||||
return;
|
||||
}
|
||||
|
||||
if (S_ISLNK(cumulativePathStat.st_mode)) {
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to create patch because '%@' cannot contain a symbolic link in its intermediate path.", destinationFilePath.stringByDeletingLastPathComponent] }];
|
||||
}
|
||||
*stop = YES;
|
||||
return;
|
||||
@@ -444,7 +467,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
|
||||
|
||||
if (failedToApplyFileSystemCompression) {
|
||||
// Try to replace bundle normally
|
||||
if (![fileManager replaceItemAtURL:[NSURL fileURLWithPath:finalDestination] withItemAtURL:[NSURL fileURLWithPath:destination isDirectory:YES] backupItemName:nil options:0 resultingItemURL:NULL error:error]) {
|
||||
if (![fileManager replaceItemAtURL:[NSURL fileURLWithPath:finalDestination] withItemAtURL:[NSURL fileURLWithPath:destination isDirectory:YES] backupItemName:nil options:(NSFileManagerItemReplacementOptions)0 resultingItemURL:NULL error:error]) {
|
||||
removeTree(destination);
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ NSString *temporaryFilename(NSString *base)
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
[data appendBytes:template.fileSystemRepresentation length:strlen(template.fileSystemRepresentation) + 1];
|
||||
|
||||
char *buffer = data.mutableBytes;
|
||||
char *buffer = (char *)data.mutableBytes;
|
||||
int fd = mkstemp(buffer);
|
||||
if (fd == -1) {
|
||||
perror("mkstemp");
|
||||
@@ -149,7 +149,7 @@ NSString *temporaryDirectory(NSString *base)
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
[data appendBytes:template.fileSystemRepresentation length:strlen(template.fileSystemRepresentation) + 1];
|
||||
|
||||
char *buffer = data.mutableBytes;
|
||||
char *buffer = (char *)data.mutableBytes;
|
||||
char *templateResult = mkdtemp(buffer);
|
||||
if (templateResult == NULL) {
|
||||
perror("mkdtemp");
|
||||
@@ -180,12 +180,12 @@ static BOOL crc32HashOfFileContents(uLong *outChecksum, FTSENT *ent, void *tempB
|
||||
return NO;
|
||||
}
|
||||
|
||||
checksum = crc32(checksum, (const void *)linkDestination, (unsigned int)linkDestinationLength);
|
||||
checksum = crc32(checksum, (const Bytef *)linkDestination, (unsigned int)linkDestinationLength);
|
||||
} else if (ent->fts_info == FTS_F) {
|
||||
ssize_t fileSize = ent->fts_statp->st_size;
|
||||
|
||||
uint64_t encodedFileSize = (uint64_t)fileSize;
|
||||
checksum = crc32(checksum, (const void *)&encodedFileSize, sizeof(encodedFileSize));
|
||||
checksum = crc32(checksum, (const Bytef *)&encodedFileSize, sizeof(encodedFileSize));
|
||||
|
||||
if (fileSize > 0) {
|
||||
FILE *file = fopen(ent->fts_path, "rb");
|
||||
@@ -204,7 +204,7 @@ static BOOL crc32HashOfFileContents(uLong *outChecksum, FTSENT *ent, void *tempB
|
||||
return NO;
|
||||
}
|
||||
|
||||
checksum = crc32(checksum, tempBuffer, (uInt)bytesToConsume);
|
||||
checksum = crc32(checksum, (const Bytef *)tempBuffer, (uInt)bytesToConsume);
|
||||
|
||||
bytesLeft -= bytesToConsume;
|
||||
}
|
||||
@@ -337,7 +337,7 @@ BOOL getRawHashOfTreeAndFileTablesWithVersion(void *hashBuffer, NSString *path,
|
||||
|
||||
uint64_t encodedFileContentsChecksum = fileContentsChecksum;
|
||||
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const void *)&encodedFileContentsChecksum, sizeof(encodedFileContentsChecksum));
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const Bytef *)&encodedFileContentsChecksum, sizeof(encodedFileContentsChecksum));
|
||||
|
||||
if (ent->fts_info == FTS_F) {
|
||||
fileHashKey = [NSData dataWithBytes:&encodedFileContentsChecksum length:sizeof(encodedFileContentsChecksum)];
|
||||
@@ -378,7 +378,7 @@ BOOL getRawHashOfTreeAndFileTablesWithVersion(void *hashBuffer, NSString *path,
|
||||
const char *relativePathBytes = [relativePath fileSystemRepresentation];
|
||||
|
||||
if (majorVersion >= SUBinaryDeltaMajorVersion4) {
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const void *)relativePathBytes, (uInt)strlen(relativePathBytes));
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const Bytef *)relativePathBytes, (uInt)strlen(relativePathBytes));
|
||||
} else {
|
||||
CC_SHA1_Update(&hashContext, relativePathBytes, (CC_LONG)strlen(relativePathBytes));
|
||||
}
|
||||
@@ -393,8 +393,8 @@ BOOL getRawHashOfTreeAndFileTablesWithVersion(void *hashBuffer, NSString *path,
|
||||
uint16_t hashedPermissions = (ent->fts_info == FTS_SL) ? VALID_SYMBOLIC_LINK_PERMISSIONS : permissions;
|
||||
|
||||
if (majorVersion >= SUBinaryDeltaMajorVersion4) {
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const void *)&type, sizeof(type));
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const void *)&hashedPermissions, sizeof(hashedPermissions));
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const Bytef *)&type, sizeof(type));
|
||||
crc32ChecksumValue = crc32(crc32ChecksumValue, (const Bytef *)&hashedPermissions, sizeof(hashedPermissions));
|
||||
} else {
|
||||
CC_SHA1_Update(&hashContext, &type, sizeof(type));
|
||||
CC_SHA1_Update(&hashContext, &hashedPermissions, sizeof(hashedPermissions));
|
||||
@@ -410,7 +410,7 @@ BOOL getRawHashOfTreeAndFileTablesWithVersion(void *hashBuffer, NSString *path,
|
||||
memset(hashBuffer, 0, BINARY_DELTA_HASH_LENGTH);
|
||||
memcpy(hashBuffer, &encodedCrc32ChecksumValue, sizeof(encodedCrc32ChecksumValue));
|
||||
} else {
|
||||
CC_SHA1_Final(hashBuffer, &hashContext);
|
||||
CC_SHA1_Final((unsigned char *)hashBuffer, &hashContext);
|
||||
}
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -133,7 +133,7 @@ static bool codeSignatureExtendedAttributeExists(const FTSENT *ent)
|
||||
return false;
|
||||
}
|
||||
|
||||
char *buffer = malloc((size_t)listSize);
|
||||
char *buffer = (char *)malloc((size_t)listSize);
|
||||
assert(buffer != NULL);
|
||||
|
||||
ssize_t sizeBack = listxattr(ent->fts_path, buffer, (size_t)listSize, options);
|
||||
|
||||
@@ -74,8 +74,7 @@
|
||||
// See https://github.com/sparkle-project/Sparkle/issues/376#issuecomment-48824267 and https://developer.apple.com/library/mac/technotes/tn2206
|
||||
// Additionally, there are several reasons to stay away from deep verification and to prefer EdDSA signing the download archive instead.
|
||||
// See https://github.com/sparkle-project/Sparkle/pull/523#commitcomment-17549302 and https://github.com/sparkle-project/Sparkle/issues/543
|
||||
SecCSFlags flags = kSecCSCheckAllArchitectures;
|
||||
result = SecStaticCodeCheckValidityWithErrors(staticCode, flags, requirement, &cfError);
|
||||
result = SecStaticCodeCheckValidityWithErrors(staticCode, kSecCSCheckAllArchitectures, requirement, &cfError);
|
||||
|
||||
if (result != errSecSuccess) {
|
||||
NSError *underlyingError;
|
||||
@@ -147,6 +146,8 @@ finally:
|
||||
OSStatus result;
|
||||
SecStaticCodeRef staticCode = NULL;
|
||||
CFErrorRef cfError = NULL;
|
||||
// See also code further below where kSecCSCheckNestedCode may be added
|
||||
SecCSFlags flags = kSecCSCheckAllArchitectures;
|
||||
|
||||
result = SecStaticCodeCreateWithPath((__bridge CFURLRef)bundleURL, kSecCSDefaultFlags, &staticCode);
|
||||
if (result != noErr) {
|
||||
@@ -160,7 +161,6 @@ finally:
|
||||
}
|
||||
|
||||
// See in -codeSignatureIsValidAtBundleURL:andMatchesSignatureAtBundleURL:error: for why kSecCSCheckNestedCode is not always passed
|
||||
SecCSFlags flags = kSecCSCheckAllArchitectures;
|
||||
if (checkNestedCode) {
|
||||
flags |= kSecCSCheckNestedCode;
|
||||
}
|
||||
@@ -330,6 +330,7 @@ static NSString * _Nullable SUTeamIdentifierFromCode(SecStaticCodeRef staticCode
|
||||
OSStatus result;
|
||||
|
||||
NSError *resultError = nil;
|
||||
CFErrorRef cfError = NULL;
|
||||
|
||||
NSString *commonErrorMessage = @"The download archive cannot be validated with Apple Developer ID code signing as fallback (after (Ed)DSA verification has failed)";
|
||||
|
||||
@@ -379,9 +380,7 @@ static NSString * _Nullable SUTeamIdentifierFromCode(SecStaticCodeRef staticCode
|
||||
goto finally;
|
||||
}
|
||||
|
||||
SecCSFlags flags = (SecCSFlags)kSecCSDefaultFlags;
|
||||
CFErrorRef cfError = NULL;
|
||||
result = SecStaticCodeCheckValidityWithErrors(downloadStaticCode, flags, requirement, &cfError);
|
||||
result = SecStaticCodeCheckValidityWithErrors(downloadStaticCode, kSecCSDefaultFlags, requirement, &cfError);
|
||||
if (result != errSecSuccess) {
|
||||
NSError *underlyingError;
|
||||
if (cfError != NULL) {
|
||||
@@ -472,7 +471,9 @@ finally:
|
||||
SecCodeRef code = NULL;
|
||||
OSStatus result = SecCodeCopyGuestWithAttributes(NULL, (__bridge CFDictionaryRef _Nullable)(attributes), kSecCSDefaultFlags, &code);
|
||||
if (result != errSecSuccess) {
|
||||
CFRelease(code);
|
||||
if (code != NULL) {
|
||||
CFRelease(code);
|
||||
}
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInsufficientSigningError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"The client connection could not be validated because SecCodeCopyGuestWithAttributes() failed with error %d", result] }];
|
||||
|
||||
@@ -133,6 +133,8 @@ static NSUInteger fileCountForDirectory(NSFileManager *fileManager, NSString *it
|
||||
NSMutableArray<NSString *> *itemsToExtract = [NSMutableArray array];
|
||||
NSUInteger totalFileExtractionCount = 0;
|
||||
|
||||
BOOL success = YES;
|
||||
|
||||
{
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
task.launchPath = @"/usr/bin/hdiutil";
|
||||
@@ -269,7 +271,7 @@ static NSUInteger fileCountForDirectory(NSFileManager *fileManager, NSString *it
|
||||
[itemsToExtract addObject:item];
|
||||
}
|
||||
|
||||
_fileProgressIncrement = (0.99 - _currentExtractionProgress) / totalFileExtractionCount;
|
||||
_fileProgressIncrement = (0.99 - _currentExtractionProgress) / (double)totalFileExtractionCount;
|
||||
_notifier = notifier;
|
||||
|
||||
// Copy all items we want to extract and notify of progress
|
||||
@@ -286,7 +288,6 @@ static NSUInteger fileCountForDirectory(NSFileManager *fileManager, NSString *it
|
||||
|
||||
[notifier notifyProgress:1.0];
|
||||
|
||||
BOOL success = YES;
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
|
||||
@@ -22,7 +22,13 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SUSignatureVerifier : NSObject
|
||||
#ifndef BUILDING_SPARKLE_TESTS
|
||||
#define SUSignatureVerifierDefinitionAttribute SPU_OBJC_DIRECT_MEMBERS
|
||||
#else
|
||||
#define SUSignatureVerifierDefinitionAttribute __attribute__((objc_runtime_name("SUTestSignatureVerifier")))
|
||||
#endif
|
||||
|
||||
SUSignatureVerifierDefinitionAttribute @interface SUSignatureVerifier : NSObject
|
||||
|
||||
// Helper for verifying downloaded updates
|
||||
+ (BOOL)validatePath:(NSString *)path withSignatures:(SUSignatures *)signatures withPublicKeys:(SUPublicKeys *)pkeys verifierInformation:(SPUVerifierInformation * _Nullable)verifierInformation error:(NSError * __autoreleasing *)error;
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
}
|
||||
case SUSigningInputStatusPresent: {
|
||||
assert(data != nil);
|
||||
if (ed25519_verify(signatures.ed25519Signature, data.bytes, data.length, _pubKeys.ed25519PubKey)) {
|
||||
if (ed25519_verify(signatures.ed25519Signature, (const unsigned char *)data.bytes, data.length, _pubKeys.ed25519PubKey)) {
|
||||
SULog(SULogLevelDefault, @"OK: EdDSA signature is correct for %@", fileKind);
|
||||
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
// No need to check DSA when EdDSA verification succeeded, unless a DSA signature is provided and it's
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
# 2.9.2
|
||||
|
||||
* Show hidden window title in update window for accessibility (#2871) (Zorg)
|
||||
* Polish and update Spanish translations to be gender neutral (#2874, #2875) (Emilio P Egido)
|
||||
* Guard against NULL CFRelease() on failure condition in fallback path (#2867) (Zorg)
|
||||
* Guard against symlinks when applying delta update files (fe7b718) (Zorg, fg0x0)
|
||||
* Enforce connection to installer to be validated before receiving appcast item data (#2876, #2877) (Zorg, fg0x0)
|
||||
|
||||
# 2.9.1
|
||||
|
||||
* Fix potential crash due to race condition within clearDownloadedUpdate (#2863) (Julian Pscheid)
|
||||
* Fix generate_appcast failing if feed URL doesn't have lastPathComponent (#2862) (Julian Pscheid)
|
||||
* Don't let progress status text title string line wrap (#2856) (Zorg)
|
||||
* Add minimal framework support for building arm64e (#2858, #2860) (Zorg)
|
||||
* Add SKIP_INSTALL=YES to for XPCServices targets (#2864) (Jeremy Huddleston Sequoia)
|
||||
|
||||
# 2.9.0
|
||||
|
||||
* Add basic markdown support for release notes (requires macOS 12+) including [customizing its presentation](https://sparkle-project.org/documentation/publishing#adapting-markdown-or-plain-text-release-notes) (#2810, #2817) (Zorg)
|
||||
@@ -8,12 +24,16 @@
|
||||
* Validate Obj-C class when reading objects from user defaults / Info plists (#2782) (Zorg)
|
||||
* Download temporary files in-memory using NSURLSessionDataTask (#2825) (Zorg)
|
||||
* Allow [impatient update check interval](https://sparkle-project.org/documentation/customization/) to be configured for updates that are downloaded automatically (#2799) (Zorg)
|
||||
* Probe agent & status service as soon as we launch it to reduce timeout issues (#2852) (Zorg)
|
||||
* Add `allowsAutomaticUpdates` property to determine if automatic downloading/installing of updates option should be enabled (#2809) (Zorg)
|
||||
* Add Vietnamese translation (#2816) (TranPhuong319)
|
||||
* Add Vietnamese translation (#2816, #2839) (TranPhuong319)
|
||||
* Add missing nn language to Installer progress Info.plist (#2818) (Zorg)
|
||||
* Improve German localization (#2847) (Marco Hillger)
|
||||
* Find non-canonical Sparkle.framework locations in generate_appcast when creating delta updates to determine compatibility (#2833) (Zorg)
|
||||
* Make Debug builds of Sparkle use same time interval settings as Release (#2805) (Zorg)
|
||||
* Remove sparkle-cli from the binary distribution (#2826) (Zorg)
|
||||
* Make generate_appcast deltas order stable and thread-safe (#2848) (Nathan Manceaux-Panot)
|
||||
* Fix Xcode 26.4 beta compiler warnings (#2850) (Zorg)
|
||||
|
||||
# 2.8.1
|
||||
|
||||
|
||||
+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", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "2.5.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.1/Sparkle-2.5.1.tar.xz", "2.5.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz", "2.6.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.1/Sparkle-2.6.0-beta.1.tar.xz", "2.6.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.2/Sparkle-2.6.0-beta.2.tar.xz", "2.6.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0/Sparkle-2.6.0.tar.xz", "2.6.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.1/Sparkle-2.6.1.tar.xz", "1.27.2": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.2/Sparkle-1.27.2.tar.xz", "2.6.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.2/Sparkle-2.6.2.tar.xz", "1.27.3": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.3/Sparkle-1.27.3.tar.xz", "2.6.3": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.3/Sparkle-2.6.3.tar.xz", "2.6.4": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.4/Sparkle-2.6.4.tar.xz", "2.7.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.0-beta.1/Sparkle-2.7.0-beta.1.tar.xz", "2.7.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.0/Sparkle-2.7.0.tar.xz", "2.7.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.1/Sparkle-2.7.1.tar.xz", "2.7.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.2/Sparkle-2.7.2.tar.xz", "2.7.3": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.3/Sparkle-2.7.3.tar.xz", "2.8.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0-beta.1/Sparkle-2.8.0-beta.1.tar.xz", "2.8.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0-beta.2/Sparkle-2.8.0-beta.2.tar.xz", "2.8.0-beta.3": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0-beta.3/Sparkle-2.8.0-beta.3.tar.xz", "2.8.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0/Sparkle-2.8.0.tar.xLine truncated
|
||||
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "2.5.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.1/Sparkle-2.5.1.tar.xz", "2.5.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz", "2.6.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.1/Sparkle-2.6.0-beta.1.tar.xz", "2.6.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.2/Sparkle-2.6.0-beta.2.tar.xz", "2.6.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0/Sparkle-2.6.0.tar.xz", "2.6.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.1/Sparkle-2.6.1.tar.xz", "1.27.2": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.2/Sparkle-1.27.2.tar.xz", "2.6.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.2/Sparkle-2.6.2.tar.xz", "1.27.3": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.3/Sparkle-1.27.3.tar.xz", "2.6.3": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.3/Sparkle-2.6.3.tar.xz", "2.6.4": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.4/Sparkle-2.6.4.tar.xz", "2.7.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.0-beta.1/Sparkle-2.7.0-beta.1.tar.xz", "2.7.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.0/Sparkle-2.7.0.tar.xz", "2.7.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.1/Sparkle-2.7.1.tar.xz", "2.7.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.2/Sparkle-2.7.2.tar.xz", "2.7.3": "https://github.com/sparkle-project/Sparkle/releases/download/2.7.3/Sparkle-2.7.3.tar.xz", "2.8.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0-beta.1/Sparkle-2.8.0-beta.1.tar.xz", "2.8.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0-beta.2/Sparkle-2.8.0-beta.2.tar.xz", "2.8.0-beta.3": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0-beta.3/Sparkle-2.8.0-beta.3.tar.xz", "2.8.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.8.0/Sparkle-2.8.0.tar.xLine truncated
|
||||
@@ -4,3 +4,4 @@
|
||||
|
||||
SWIFT_OBJC_BRIDGING_HEADER = $(PRODUCT_NAME)/Bridging-Header.h
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_EXTERNALLY=1
|
||||
ARCHS = $(ARCHS_COMMAND_LINE_TOOLS)
|
||||
@@ -48,9 +48,14 @@ OTHER_SWIFT_FLAGS_COMMON = -DSPARKLE_BUILD_LEGACY_DSA_SUPPORT -DGENERATE_APPCAST
|
||||
// Minimum supported macOS version
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13
|
||||
|
||||
// Supported architectures
|
||||
// Archs to use for Sparkle
|
||||
// You can change this for example to add arm64e or remove x86_64
|
||||
ARCHS = $(ARCHS_STANDARD)
|
||||
|
||||
// Archs to use for command line tools (generate_appcast, sign_update, BinaryDelta, etc)
|
||||
// arm64e is not supported for these yet
|
||||
ARCHS_COMMAND_LINE_TOOLS = $(ARCHS_STANDARD)
|
||||
|
||||
// Default Sparkle names
|
||||
SPARKLE_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle
|
||||
SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate
|
||||
@@ -94,12 +99,12 @@ SPARKLE_ICON_NAME = AppIcon
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_MAJOR = 2
|
||||
SPARKLE_VERSION_MINOR = 9
|
||||
SPARKLE_VERSION_PATCH = 0
|
||||
SPARKLE_VERSION_PATCH = 2
|
||||
|
||||
// This should be in SemVer format or empty, ie. "-beta.1"
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_SUFFIX = -beta.1
|
||||
CURRENT_PROJECT_VERSION = 2051
|
||||
SPARKLE_VERSION_SUFFIX =
|
||||
CURRENT_PROJECT_VERSION = 2057
|
||||
|
||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
@@ -6,4 +6,5 @@ PRODUCT_BUNDLE_IDENTIFIER = ${DOWNLOADER_BUNDLE_ID}
|
||||
PRODUCT_NAME = ${DOWNLOADER_NAME}
|
||||
CODE_SIGN_ENTITLEMENTS = $(DOWNLOADER_SANDBOXED_ENTITLEMENTS)
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||
SKIP_INSTALL = YES
|
||||
CLANG_MODULES_AUTOLINK = NO
|
||||
@@ -5,4 +5,5 @@ WRAPPER_EXTENSION = xpc
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_CONNECTION_BUNDLE_ID}
|
||||
PRODUCT_NAME = ${INSTALLER_CONNECTION_NAME}
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||
SKIP_INSTALL = YES
|
||||
CLANG_MODULES_AUTOLINK = NO
|
||||
@@ -5,4 +5,5 @@ WRAPPER_EXTENSION = xpc
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_LAUNCHER_BUNDLE_ID}
|
||||
PRODUCT_NAME = ${INSTALLER_LAUNCHER_NAME}
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||
SKIP_INSTALL = YES
|
||||
CLANG_MODULES_AUTOLINK = NO
|
||||
@@ -5,4 +5,5 @@ WRAPPER_EXTENSION = xpc
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_STATUS_BUNDLE_ID}
|
||||
PRODUCT_NAME = ${INSTALLER_STATUS_NAME}
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE=0 BUILDING_SPARKLE_SOURCES_EXTERNALLY=1
|
||||
SKIP_INSTALL = YES
|
||||
CLANG_MODULES_AUTOLINK = NO
|
||||
@@ -12,3 +12,6 @@ ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
// Disable Warnings - this is a third-party project, and we'll trust that the maintainers know what they're doing.
|
||||
WARNING_CFLAGS = $(inherited) -Wno-comma
|
||||
|
||||
// bsdiff is used by command line tools too
|
||||
ARCHS = $(inherited) $(ARCHS_COMMAND_LINE_TOOLS)
|
||||
@@ -15,3 +15,6 @@ WARNING_CFLAGS = $(inherited) -Wno-cast-qual -Wno-conversion -Wno-sign-conversio
|
||||
|
||||
// Disable dead stores analyzer warning
|
||||
CLANG_ANALYZER_DEADCODE_DEADSTORES = NO
|
||||
|
||||
// ed25519 is used by command line tools too
|
||||
ARCHS = $(inherited) $(ARCHS_COMMAND_LINE_TOOLS)
|
||||
@@ -286,7 +286,7 @@ static bool SPUValidateStatusCodeAndFailIfInvalid(NSURLResponse * _Nullable resp
|
||||
NSURL *downloadURL = [NSURL fileURLWithPath:toPath isDirectory:NO];
|
||||
|
||||
NSError *bookmarkError = nil;
|
||||
NSData *bookmarkData = [downloadURL bookmarkDataWithOptions:0 includingResourceValuesForKeys:@[] relativeToURL:nil error:&bookmarkError];
|
||||
NSData *bookmarkData = [downloadURL bookmarkDataWithOptions:(NSURLBookmarkCreationOptions)0 includingResourceValuesForKeys:@[] relativeToURL:nil error:&bookmarkError];
|
||||
if (bookmarkData == nil) {
|
||||
[_delegate downloaderDidFailWithError:bookmarkError];
|
||||
} else {
|
||||
|
||||
@@ -73,7 +73,7 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
|
||||
|
||||
- (void)_setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain SPU_OBJC_DIRECT
|
||||
{
|
||||
NSXPCConnectionOptions options = systemDomain ? NSXPCConnectionPrivileged : 0;
|
||||
NSXPCConnectionOptions options = systemDomain ? NSXPCConnectionPrivileged : (NSXPCConnectionOptions)0;
|
||||
NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:options];
|
||||
|
||||
connection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerCommunicationProtocol)];
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
|
||||
NSGraphicsContext.currentContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:iconBitmapRep];
|
||||
[icon drawInRect:NSMakeRect(0, 0, imageDimensions, imageDimensions)];
|
||||
[icon drawInRect:NSMakeRect(0.0, 0.0, (CGFloat)imageDimensions, (CGFloat)imageDimensions)];
|
||||
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@
|
||||
import PackageDescription
|
||||
|
||||
// Version is technically not required here, SPM doesn't check
|
||||
let version = "2.9.0-beta.1"
|
||||
let version = "2.9.2"
|
||||
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
||||
let tag = "2.9.0-beta.1"
|
||||
let checksum = "e64db73fa9e36cc4cae8b6c2cf53d0aa91743236dbe08e6ae5eb9064500603a9"
|
||||
let tag = "2.9.2"
|
||||
let checksum = "b83e37436774556ed055e0244b297ef2c790e0737393bf65bf495fcbba6eed65"
|
||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
let package = Package(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "2.9.0-beta.1"
|
||||
s.version = "2.9.2"
|
||||
s.summary = "A software update framework for macOS"
|
||||
s.description = "Sparkle is an easy-to-use software update framework for macOS."
|
||||
s.homepage = "https://sparkle-project.org"
|
||||
|
||||
@@ -102,7 +102,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
|
||||
// This difference is significant. We shouldn't have a model where the 'server' tries to connect to a 'client',
|
||||
// nor have a model where a process that runs at the highest level (the installer can run as root) tries to connect to a user level agent or process
|
||||
BOOL systemDomain = arguments[2].boolValue;
|
||||
NSXPCConnectionOptions connectionOptions = systemDomain ? NSXPCConnectionPrivileged : 0;
|
||||
NSXPCConnectionOptions connectionOptions = systemDomain ? NSXPCConnectionPrivileged : (NSXPCConnectionOptions)0;
|
||||
|
||||
_systemDomain = systemDomain;
|
||||
_connection = [[NSXPCConnection alloc] initWithMachServiceName:SPUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) options:connectionOptions];
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@
|
||||
|
||||
BOOL minimumOperatingSystemVersionIsOK = [self isMinimumOperatingSystemVersionOK:minimumOperatingSystemVersion];
|
||||
|
||||
BOOL maximumOperatingSystemVersionIsOK = [self isMaximumOperatingSystemVersionOK:maximumOperatingSystemVersion];;
|
||||
BOOL maximumOperatingSystemVersionIsOK = [self isMaximumOperatingSystemVersionOK:maximumOperatingSystemVersion];
|
||||
|
||||
BOOL majorUpgrade = ![self isMinimumAutoupdateVersionOK:minimumAutoupdateVersion];
|
||||
|
||||
|
||||
Vendored
+7
-3
@@ -198,9 +198,13 @@
|
||||
- (void)clearDownloadedUpdate
|
||||
{
|
||||
id<NSObject> downloadedUpdateObject = (_resumableUpdate != nil) ? _resumableUpdate : _downloadedUpdateForRemoval;
|
||||
assert(downloadedUpdateObject != nil);
|
||||
|
||||
if (downloadedUpdateObject != nil && [downloadedUpdateObject isKindOfClass:[SPUDownloadedUpdate class]]) {
|
||||
|
||||
if (downloadedUpdateObject == nil) {
|
||||
SULog(SULogLevelError, @"Warning: clearDownloadedUpdate called but no downloaded update is tracked");
|
||||
return;
|
||||
}
|
||||
|
||||
if ([downloadedUpdateObject isKindOfClass:[SPUDownloadedUpdate class]]) {
|
||||
if (_downloadDriver == nil) {
|
||||
_downloadDriver = [[SPUDownloadDriver alloc] initWithHost:_host];
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -23,7 +23,7 @@ NSData *SPUExtractAppcastContent(NSData *appcastData, NSString * _Nullable __aut
|
||||
|
||||
NSData *contentFeedData = [appcastData subdataWithRange:NSMakeRange(0, prefixRange.location)];
|
||||
|
||||
NSRange suffixRange = [appcastData rangeOfData:[NSData dataWithBytesNoCopy:feedSigningSuffix length:sizeof(feedSigningSuffix) - 1 freeWhenDone:NO] options:0 range:NSMakeRange(NSMaxRange(prefixRange), appcastDataLength - NSMaxRange(prefixRange))];
|
||||
NSRange suffixRange = [appcastData rangeOfData:[NSData dataWithBytesNoCopy:feedSigningSuffix length:sizeof(feedSigningSuffix) - 1 freeWhenDone:NO] options:(NSDataSearchOptions)0 range:NSMakeRange(NSMaxRange(prefixRange), appcastDataLength - NSMaxRange(prefixRange))];
|
||||
|
||||
if (suffixRange.location == NSNotFound) {
|
||||
return appcastData;
|
||||
@@ -76,7 +76,7 @@ NSData *SPUExtractReleaseNotesContent(NSData *data)
|
||||
return data;
|
||||
}
|
||||
|
||||
NSRange commentSuffixRange = [data rangeOfData:signWarningComment options:0 range:NSMakeRange(signWarningCommentPrefix.length, data.length - signWarningCommentPrefix.length)];
|
||||
NSRange commentSuffixRange = [data rangeOfData:signWarningComment options:(NSDataSearchOptions)0 range:NSMakeRange(signWarningCommentPrefix.length, data.length - signWarningCommentPrefix.length)];
|
||||
|
||||
if (commentSuffixRange.location == NSNotFound) {
|
||||
return data;
|
||||
|
||||
Vendored
+28
-8
@@ -26,6 +26,7 @@
|
||||
#import "SPUDownloadedUpdate.h"
|
||||
#import "SPUInstallationType.h"
|
||||
#import "SUConstants.h"
|
||||
#import "SPUProbeInstallStatus.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
@@ -296,7 +297,7 @@
|
||||
|
||||
- (void)_handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data SPU_OBJC_DIRECT
|
||||
{
|
||||
if (!SPUInstallerMessageTypeIsLegal(_currentStage, identifier)) {
|
||||
if (!SPUInstallerMessageTypeIsLegal(_currentStage, (SPUInstallerMessageType)identifier)) {
|
||||
SULog(SULogLevelError, @"Error: received out of order message with current stage: %d, requested stage: %d", _currentStage, identifier);
|
||||
return;
|
||||
}
|
||||
@@ -305,14 +306,14 @@
|
||||
|
||||
if (identifier == SPUExtractionStarted) {
|
||||
_extractionAttempts++;
|
||||
_currentStage = identifier;
|
||||
_currentStage = (SPUInstallerMessageType)identifier;
|
||||
[delegate installerDidStartExtracting];
|
||||
} else if (identifier == SPUExtractedArchiveWithProgress) {
|
||||
if (data.length == sizeof(double) && sizeof(double) == sizeof(uint64_t)) {
|
||||
uint64_t progressValue = CFSwapInt64LittleToHost(*(const uint64_t *)data.bytes);
|
||||
double progress = *(double *)&progressValue;
|
||||
[delegate installerDidExtractUpdateWithProgress:progress];
|
||||
_currentStage = identifier;
|
||||
_currentStage = (SPUInstallerMessageType)identifier;
|
||||
}
|
||||
} else if (identifier == SPUArchiveExtractionFailed) {
|
||||
// If this is a delta update, there must be a regular update we can fall back to
|
||||
@@ -326,11 +327,11 @@
|
||||
[self _reportInstallerError:unarchivedError genericErrorCode:SUUnarchivingError genericUserInfo:genericUserInfo];
|
||||
}
|
||||
} else if (identifier == SPUValidationStarted) {
|
||||
_currentStage = identifier;
|
||||
_currentStage = (SPUInstallerMessageType)identifier;
|
||||
} else if (identifier == SPUInstallationStartedStage1) {
|
||||
_currentStage = identifier;
|
||||
_currentStage = (SPUInstallerMessageType)identifier;
|
||||
} else if (identifier == SPUInstallationFinishedStage1) {
|
||||
_currentStage = identifier;
|
||||
_currentStage = (SPUInstallerMessageType)identifier;
|
||||
|
||||
// Let the installer keep a copy of the appcast item data
|
||||
// We may want to ask for it later (note the updater can relaunch without the app necessarily having relaunched)
|
||||
@@ -349,7 +350,7 @@
|
||||
|
||||
[delegate installerDidFinishPreparationAndWillInstallImmediately:hasTargetTerminated];
|
||||
} else if (identifier == SPUInstallationFinishedStage2) {
|
||||
_currentStage = identifier;
|
||||
_currentStage = (SPUInstallerMessageType)identifier;
|
||||
|
||||
BOOL hasTargetTerminated = NO;
|
||||
if (data.length >= sizeof(uint8_t)) {
|
||||
@@ -366,7 +367,7 @@
|
||||
|
||||
[delegate installerDidStartInstallingWithApplicationTerminated:hasTargetTerminated];
|
||||
} else if (identifier == SPUInstallationFinishedStage3) {
|
||||
_currentStage = identifier;
|
||||
_currentStage = (SPUInstallerMessageType)identifier;
|
||||
|
||||
[_installerConnection invalidate];
|
||||
_installerConnection = nil;
|
||||
@@ -459,6 +460,8 @@
|
||||
NSString *hostBundlePath = _host.bundle.bundlePath;
|
||||
assert(hostBundlePath != nil);
|
||||
|
||||
NSString *hostBundleIdentifier = _host.bundle.bundleIdentifier;
|
||||
|
||||
NSString *installationType = _updateItem.installationType;
|
||||
assert(installationType != nil);
|
||||
|
||||
@@ -484,7 +487,24 @@
|
||||
self->_systemDomain = systemDomain;
|
||||
[self setUpConnection];
|
||||
[self sendInstallationData];
|
||||
|
||||
// Complete immediately so the caller can set up state (e.g., _downloadedUpdateForRemoval)
|
||||
// before installer messages arrive on the main queue.
|
||||
// Previously, completionHandler was called inside the probe callback, which meant
|
||||
// installer messages (SPUExtractionStarted, SPUArchiveExtractionFailed) could be
|
||||
// processed before the completion handler fired, leaving _downloadedUpdateForRemoval
|
||||
// unset and causing an assertion crash in clearDownloadedUpdate.
|
||||
completionHandler(nil);
|
||||
|
||||
// Send a probe/ping to the status service, which should boost/prioritize its startup
|
||||
if (hostBundleIdentifier != nil) {
|
||||
[SPUProbeInstallStatus probeInstallerInProgressForHostBundleIdentifier:hostBundleIdentifier completion:^(BOOL stausServiceIsRunning) {
|
||||
if (!stausServiceIsRunning) {
|
||||
SULog(SULogLevelError, @"Error: failed to probe status service for %@ from the framework", hostBundleIdentifier);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+2
-2
@@ -112,7 +112,7 @@
|
||||
- (double)currentTime SPU_OBJC_DIRECT
|
||||
{
|
||||
if (_timebaseInfo.denom > 0) {
|
||||
return (1.0 * mach_absolute_time() * _timebaseInfo.numer / _timebaseInfo.denom);
|
||||
return (double)(mach_absolute_time() * _timebaseInfo.numer) / (double)_timebaseInfo.denom;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
@@ -826,7 +826,7 @@
|
||||
NSBundle *sparkleBundle = SUSparkleBundle();
|
||||
#endif
|
||||
|
||||
if (_expectedContentLength > 0.0) {
|
||||
if (_expectedContentLength > 0) {
|
||||
double newProgressValue = (double)_bytesDownloaded / (double)_expectedContentLength;
|
||||
|
||||
[_statusController setProgressValue:MIN(newProgressValue, 1.0)];
|
||||
|
||||
Vendored
+13
-15
@@ -92,7 +92,7 @@ SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUUpdater : NSObject
|
||||
- (BOOL)startUpdater:(NSError * __autoreleasing *)error;
|
||||
|
||||
/**
|
||||
Checks for updates, and displays progress while doing so if needed.
|
||||
Checks for new updates, and displays progress while doing so if needed.
|
||||
|
||||
This is meant for users initiating a new update check or checking the current update progress.
|
||||
|
||||
@@ -109,25 +109,23 @@ SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUUpdater : NSObject
|
||||
- (void)checkForUpdates;
|
||||
|
||||
/**
|
||||
Checks for updates, but does not show any UI unless an update is found.
|
||||
Checks for new updates in the background.
|
||||
|
||||
You usually do not need to call this method directly. If `automaticallyChecksForUpdates` is @c YES,
|
||||
Sparkle calls this method automatically according to its update schedule using the `updateCheckInterval`
|
||||
and the `lastUpdateCheckDate`. Therefore, you should typically only consider calling this method directly if you
|
||||
opt out of automatic update checks. Calling this method when updating your own bundle is invalid if Sparkle is configured
|
||||
to ask the user's permission to check for updates automatically and `automaticallyChecksForUpdates` is `NO`.
|
||||
If you want to reset the updater's cycle after an updater setting change, see `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
|
||||
You usually should not call this method directly. By default Sparkle calls this method automatically
|
||||
on a scheduled basis if automatic update checks are enabled. This is done by checking the current state of
|
||||
`automaticallyChecksForUpdates`, `updateCheckInterval`, `lastUpdateCheckDate`, and
|
||||
`SUScheduledImpatientCheckInterval`.
|
||||
|
||||
This is meant for programmatically initiating a check for updates in the background without the user initiating it.
|
||||
This check will not show UI if no new updates are found.
|
||||
If you want to additionally force an update check on every app launch though, it's recommended to only call this method immediately after starting the updater,
|
||||
and only when automatic update checks are enabled (by checking `automaticallyChecksForUpdates` is `YES`). Calling this method at later points
|
||||
could interfere with Sparkle's scheduler in unexpected ways.
|
||||
|
||||
If a new update is found, the updater's user driver may handle showing it at an appropriate (but not necessarily immediate) time.
|
||||
If you want control over when and how a new update is shown, please see https://sparkle-project.org/documentation/gentle-reminders/
|
||||
If you want to reset the updater's cycle after an updater setting change, please use `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
|
||||
|
||||
Note if automated downloading/installing is turned on, either a new update may be downloaded in the background to be installed silently,
|
||||
or an already downloaded update may be shown.
|
||||
Updates that are found may not be presented immediately to the user, either due to automatic downloading/installing of updates being on or
|
||||
due to gentle reminders https://sparkle-project.org/documentation/gentle-reminders/ for example.
|
||||
|
||||
This will not find updates that the user has opted into skipping.
|
||||
Updates that have been skipped by the user will not be found.
|
||||
|
||||
This method does not do anything if there is a `sessionInProgress`.
|
||||
|
||||
|
||||
Vendored
+10
-5
@@ -421,16 +421,21 @@ NS_SWIFT_UI_ACTOR @protocol SPUUpdaterDelegate <NSObject>
|
||||
/**
|
||||
Called when an update is scheduled to be silently installed on quit after downloading the update automatically.
|
||||
|
||||
If the updater is given responsibility, it can later remind the user an update is available if they have not terminated the application for a long time.
|
||||
If you want to intercept this method without taking control of installing the update, return @c NO.
|
||||
This will let future update cycles to run and allow Sparkle to present the update to the user later if certain conditions are met.
|
||||
For example, critical updates will be presented to the user right away. Other updates may be presented later if the user hasn't terminated the application
|
||||
for a long time (defined by `SUScheduledImpatientCheckInterval`).
|
||||
|
||||
Also if the updater is given responsibility and the update item is marked critical, the new update will be presented to the user immediately after.
|
||||
If you want to take control of installing the update, return @c YES.
|
||||
This stalls the current update cycle and prevents future update cycles from running. When the opportunity arrives, you can invoke `immediateInstallHandler` to
|
||||
install the update and relaunch the application without any UI interaction shown.
|
||||
|
||||
Even if the @c immediateInstallHandler is not invoked, the installer will attempt to install the update on termination.
|
||||
In either case Sparkle will always attempt to install the update when the app terminates.
|
||||
|
||||
@param updater The updater instance.
|
||||
@param item The appcast item corresponding to the update that is proposed to be installed.
|
||||
@param immediateInstallHandler The install handler for the delegate to immediately install the update. No UI interaction will be shown and the application will be relaunched after installation. This handler can only be used if @c YES is returned and the delegate handles installing the update. For Sparkle 2.3 onwards, this handler can be invoked multiple times in case the application cancels the termination request.
|
||||
@return @c YES if the delegate will handle installing the update or @c NO if the updater should be given responsibility.
|
||||
@param immediateInstallHandler The install handler to immediately install the update and relaunch the application. This handler can only be used if @c YES is returned. For Sparkle 2.3 onwards, this handler can be invoked multiple times in case the application cancels the termination request.
|
||||
@return @c YES if you will handle installing the update using `immediateInstallHandler` or @c NO to allow Sparkle's update scheduler to continue running.
|
||||
*/
|
||||
- (BOOL)updater:(SPUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)(void))immediateInstallHandler;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -40,7 +40,7 @@
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
SPUUserUpdateStage stage = [decoder decodeIntegerForKey:SPUUserUpdateStateStageKey];
|
||||
SPUUserUpdateStage stage = (SPUUserUpdateStage)[decoder decodeIntegerForKey:SPUUserUpdateStateStageKey];
|
||||
BOOL userInitiated = [decoder decodeBoolForKey:SPUUserUpdateStateUserInitiatedKey];
|
||||
|
||||
return [self initWithStage:stage userInitiated:userInitiated];
|
||||
|
||||
Vendored
+7
-1
@@ -9,7 +9,13 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SPUVerifierInformation : NSObject
|
||||
#ifndef BUILDING_SPARKLE_TESTS
|
||||
#define SPUVerifierInformationDefinitionAttribute SPU_OBJC_DIRECT_MEMBERS
|
||||
#else
|
||||
#define SPUVerifierInformationDefinitionAttribute __attribute__((objc_runtime_name("SPUTestVerifierInformation")))
|
||||
#endif
|
||||
|
||||
SPUVerifierInformationDefinitionAttribute @interface SPUVerifierInformation : NSObject
|
||||
|
||||
- (instancetype)initWithExpectedVersion:(NSString * _Nullable)expectedVersion expectedContentLength:(uint64_t)expectedContentLength;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -80,7 +80,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSUInteger options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file://
|
||||
NSXMLNodeOptions options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file://
|
||||
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:appcastData options:options error:errorp];
|
||||
if (nil == document) {
|
||||
return nil;
|
||||
|
||||
Vendored
+2
-2
@@ -274,7 +274,7 @@
|
||||
if (notFoundPrimaryItem != nil) {
|
||||
hostToLatestAppcastItemComparisonResult = [applicationVersionComparator compareVersion:_host.version toVersion:notFoundPrimaryItem.versionString];
|
||||
} else {
|
||||
hostToLatestAppcastItemComparisonResult = 0;
|
||||
hostToLatestAppcastItemComparisonResult = NSOrderedSame;
|
||||
}
|
||||
|
||||
[delegate didNotFindUpdateWithLatestAppcastItem:notFoundPrimaryItem hostToLatestAppcastItemComparisonResult:hostToLatestAppcastItemComparisonResult background:background];
|
||||
@@ -619,7 +619,7 @@ SPU_OBJC_DIRECT
|
||||
NSTimeInterval timeSinceRelease = [currentDate timeIntervalSinceDate:itemReleaseDate];
|
||||
|
||||
NSTimeInterval phasedRolloutInterval = [phasedRolloutIntervalObject doubleValue];
|
||||
NSTimeInterval timeToWaitForGroup = phasedRolloutInterval * phasedUpdateGroup.unsignedIntegerValue;
|
||||
NSTimeInterval timeToWaitForGroup = phasedRolloutInterval * (NSTimeInterval)(phasedUpdateGroup.unsignedIntegerValue);
|
||||
|
||||
if (timeSinceRelease >= timeToWaitForGroup) {
|
||||
return YES;
|
||||
|
||||
Vendored
+1
-1
@@ -176,7 +176,7 @@ static NSString *SUAppcastItemSigningValidationStatusKey = @"SUAppcastItemSignin
|
||||
case SPUAppcastSigningValidationStatusSkipped:
|
||||
case SPUAppcastSigningValidationStatusSucceeded:
|
||||
case SPUAppcastSigningValidationStatusFailed:
|
||||
_signingValidationStatus = decodedSigningValidationStatus;
|
||||
_signingValidationStatus = (SPUAppcastSigningValidationStatus)decodedSigningValidationStatus;
|
||||
break;
|
||||
default:
|
||||
// This shouldn't be reached, skipped == 0 matches an old encoder that doesn't encode this enum.
|
||||
|
||||
Vendored
+1
-1
@@ -415,7 +415,7 @@ SPU_OBJC_DIRECT
|
||||
|
||||
// Preserve the modification time
|
||||
struct timeval modTime;
|
||||
TIMESPEC_TO_TIMEVAL(&modTime, &statInfo.st_mtimespec);
|
||||
TIMESPEC_TO_TIMEVAL(&modTime, &statInfo.st_mtimespec)
|
||||
|
||||
const struct timeval timeInputs[] = {accessTime, modTime};
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -37,7 +37,7 @@ static SUSigningInputStatus decode(NSString *str, NSData * __strong *outData) {
|
||||
}
|
||||
|
||||
NSString *stripped = [str stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
|
||||
NSData *result = [[NSData alloc] initWithBase64EncodedString:stripped options:0];
|
||||
NSData *result = [[NSData alloc] initWithBase64EncodedString:stripped options:(NSDataBase64DecodingOptions)0];
|
||||
if (!result) {
|
||||
return SUSigningInputStatusInvalid;
|
||||
}
|
||||
|
||||
+1
-1
@@ -171,7 +171,7 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
|
||||
- (void)balanceVersionPartsA:(NSMutableArray<NSString *> *)partsA partsB:(NSMutableArray<NSString *> *)partsB SPU_OBJC_DIRECT
|
||||
{
|
||||
NSUInteger partANumberAndPeriodPartsCount = [self countOfNumberAndPeriodStartingParts:partsA];
|
||||
NSUInteger partBNumberAndPeriodPartsCount = [self countOfNumberAndPeriodStartingParts:partsB];;
|
||||
NSUInteger partBNumberAndPeriodPartsCount = [self countOfNumberAndPeriodStartingParts:partsB];
|
||||
|
||||
if (partANumberAndPeriodPartsCount > partBNumberAndPeriodPartsCount) {
|
||||
[self addNumberAndPeriodPartsToParts:partsB toNumberAndPeriodPartsCount:partBNumberAndPeriodPartsCount fromParts:partsA fromNumberAndPeriodPartsCount:partANumberAndPeriodPartsCount];
|
||||
|
||||
Vendored
+12
-12
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24093.8" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24764" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24093.8"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24764"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -21,14 +21,14 @@
|
||||
<windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="200" y="222" width="400" height="107"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1470" height="918"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1470" height="923"/>
|
||||
<value key="minSize" type="size" width="213" height="107"/>
|
||||
<view key="contentView" misplaced="YES" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="105"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="107"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView translatesAutoresizingMaskIntoConstraints="NO" id="7">
|
||||
<rect key="frame" x="20" y="37" width="64" height="64"/>
|
||||
<rect key="frame" x="20" y="42" width="64" height="64"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="64" id="BT1-iv-l2H"/>
|
||||
<constraint firstAttribute="width" constant="64" id="eYK-yn-PVe"/>
|
||||
@@ -39,10 +39,10 @@
|
||||
</connections>
|
||||
</imageView>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="E7u-iB-1VW" userLabel="Status text and progress">
|
||||
<rect key="frame" x="92" y="48" width="288" height="42"/>
|
||||
<rect key="frame" x="92" y="52" width="288" height="44"/>
|
||||
<subviews>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8">
|
||||
<rect key="frame" x="-2" y="26" width="292" height="16"/>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="8">
|
||||
<rect key="frame" x="-2" y="28" width="292" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Status Text (set by loc. string in code)" id="54">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -52,8 +52,8 @@
|
||||
<binding destination="-2" name="value" keyPath="title" id="26"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<progressIndicator verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="11">
|
||||
<rect key="frame" x="0.0" y="-1" width="288" height="20"/>
|
||||
<progressIndicator wantsLayer="YES" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="11">
|
||||
<rect key="frame" x="0.0" y="0.0" width="288" height="20"/>
|
||||
<connections>
|
||||
<binding destination="-2" name="maxValue" keyPath="maxProgressValue" id="13"/>
|
||||
<binding destination="-2" name="value" keyPath="progressValue" previousBinding="13" id="27"/>
|
||||
@@ -71,7 +71,7 @@
|
||||
</constraints>
|
||||
</customView>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="12">
|
||||
<rect key="frame" x="273" y="13" width="114" height="32"/>
|
||||
<rect key="frame" x="280" y="20" width="100" height="24"/>
|
||||
<buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="55">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -85,7 +85,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="16">
|
||||
<rect key="frame" x="90" y="23" width="146" height="16"/>
|
||||
<rect key="frame" x="90" y="24" width="146" height="16"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Small System Font Text" id="56">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
|
||||
Vendored
+2
-2
@@ -80,10 +80,10 @@ static NSString *const SUStatusControllerTouchBarIdentifier = @"" SPARKLE_BUNDLE
|
||||
}
|
||||
|
||||
if (_minimizable) {
|
||||
window.styleMask |= NSWindowStyleMaskMiniaturizable;
|
||||
window.styleMask = (NSWindowStyleMask)(window.styleMask | NSWindowStyleMaskMiniaturizable);
|
||||
}
|
||||
if (_closable) {
|
||||
window.styleMask |= NSWindowStyleMaskClosable;
|
||||
window.styleMask = (NSWindowStyleMask)(window.styleMask | NSWindowStyleMaskClosable);
|
||||
}
|
||||
[_progressBar setUsesThreadedAnimation:YES];
|
||||
[_statusTextField setFont:[NSFont monospacedDigitSystemFontOfSize:0 weight:NSFontWeightRegular]];
|
||||
|
||||
Vendored
+1
-1
@@ -157,7 +157,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
unsigned long bytes;
|
||||
size_t bytes_size = sizeof(unsigned long);
|
||||
if (sysctlbyname("hw.memsize", &bytes, &bytes_size, NULL, 0) == 0) {
|
||||
double megabytes = bytes / (1024. * 1024.);
|
||||
double megabytes = (double)bytes / (1024. * 1024.);
|
||||
NSString *stringValue = [NSString stringWithFormat:@"%lu", (unsigned long)megabytes];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerMemoryKey, SULocalizedStringFromTableInBundle(@"Memory (MB)", SPARKLE_TABLE, sparkleBundle, nil), stringValue, stringValue] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -182,7 +182,7 @@ static void processMarkdownFragmentAttributedString(NSAttributedString *fragment
|
||||
// to avoid outputting multiple list bullets
|
||||
// Also avoid processing list items that were processed from previous passes / fragments
|
||||
if (canProcessListItem) {
|
||||
CGFloat firstLineIdentation = intent.indentationLevel * (font.pointSize * 1.5);
|
||||
CGFloat firstLineIdentation = (CGFloat)intent.indentationLevel * (font.pointSize * 1.5);
|
||||
paragraphStyle.firstLineHeadIndent += firstLineIdentation;
|
||||
|
||||
// Advance subsequent lines and text that wraps to next line by next tab interval past the firstLineIdentation
|
||||
@@ -288,7 +288,7 @@ static NSAttributedString *formatMarkdownAttributedString(NSAttributedString *or
|
||||
// Enumerate through every presentation intent fragment and create a new attributed string that we append to the output
|
||||
// Foundation handles formatting some things for us already in the attributed string such as bold/itatlics and hyperlinks,
|
||||
// but we need to handle formatting paragraphs, headers, lists, block quotes, etc in the attributed string.
|
||||
[originalAttributedString enumerateAttribute:NSPresentationIntentAttributeName inRange:NSMakeRange(0, originalAttributedString.length) options:0 usingBlock:^(NSPresentationIntent *intent, NSRange presentationIntentRange, BOOL * _Nonnull __unused stopPresentationIntentEnumeration) {
|
||||
[originalAttributedString enumerateAttribute:NSPresentationIntentAttributeName inRange:NSMakeRange(0, originalAttributedString.length) options:(NSAttributedStringEnumerationOptions)0 usingBlock:^(NSPresentationIntent *intent, NSRange presentationIntentRange, BOOL * _Nonnull __unused stopPresentationIntentEnumeration) {
|
||||
|
||||
// Split the presentation intent by lines so we treat every line as a separate paragraph so we present them properly (with correct indentation / tabs)
|
||||
// Normally multiple lines aren't in the same paragraph, but this can happen in some cases like code blocks
|
||||
|
||||
Vendored
+7
-3
@@ -375,7 +375,7 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
[_releaseNotesContentView addSubview:_releaseNotesView.view positioned:NSWindowBelow relativeTo:_releaseNotesSpinner];
|
||||
|
||||
_releaseNotesView.view.frame = _releaseNotesContentView.bounds;
|
||||
_releaseNotesView.view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
||||
_releaseNotesView.view.autoresizingMask = (NSAutoresizingMaskOptions)(NSViewWidthSizable | NSViewHeightSizable);
|
||||
|
||||
if (@available(macOS 10.14, *)) {
|
||||
// We need a transparent background
|
||||
@@ -427,6 +427,10 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
_releaseNotesBoxView.contentView.layer.cornerRadius = boxCornerRadius - boxBorderWidth;
|
||||
}
|
||||
|
||||
// Keep hidden window title for accessibility
|
||||
window.title = SULocalizedStringFromTableInBundle(@"Software Update", SPARKLE_TABLE, sparkleBundle, nil);
|
||||
window.titleVisibility = NSWindowTitleHidden;
|
||||
|
||||
_laterButton.title = SULocalizedStringFromTableInBundle(@"Remind Me Later", SPARKLE_TABLE, sparkleBundle, @"");
|
||||
_skipButton.title = SULocalizedStringFromTableInBundle(@"Skip This Version", SPARKLE_TABLE, sparkleBundle, @"");
|
||||
_installButton.title = SULocalizedStringFromTableInBundle(@"Install Update", SPARKLE_TABLE, sparkleBundle, @"");
|
||||
@@ -443,7 +447,7 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
window.frameAutosaveName = @"SUUpdateAlert2";
|
||||
} else {
|
||||
// Update alert should not be resizable when no release notes are available
|
||||
window.styleMask &= ~NSWindowStyleMaskResizable;
|
||||
window.styleMask = (NSWindowStyleMask)(window.styleMask & ~NSWindowStyleMaskResizable);
|
||||
}
|
||||
_windowLoadedAndShowsReleaseNotes = showReleaseNotes;
|
||||
|
||||
@@ -463,7 +467,7 @@ typedef NS_ENUM(NSInteger, SUReleaseNotesFormat)
|
||||
|
||||
// NOTE: The code below for deciding what buttons to hide is complex! Due to array of feature configurations :)
|
||||
|
||||
[_updaterSettings addObserver:self forKeyPath:SUAllowsAutomaticUpdatesKeyPath options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) context:NULL];
|
||||
[_updaterSettings addObserver:self forKeyPath:SUAllowsAutomaticUpdatesKeyPath options:(NSKeyValueObservingOptions)(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) context:NULL];
|
||||
|
||||
if (_state.stage == SPUUserUpdateStageInstalling) {
|
||||
// We're going to be relaunching pretty instantaneously
|
||||
|
||||
Vendored
+8
-8
@@ -17,19 +17,19 @@
|
||||
"%@ downloaded" = "%@ geladen";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ is now updated to version %@!" = "%@ ist aktualisiert auf Version %@!";
|
||||
"%@ is now updated to version %@!" = "%@ wurde auf Version %@ aktualisiert!";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ is now updated!" = "%@ ist aktualisiert!";
|
||||
"%@ is now updated!" = "%@ wurde aktualisiert!";
|
||||
|
||||
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
|
||||
"%@ of %@" = "%1$@ von %2$@";
|
||||
|
||||
/* Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Dies ist ein wichtiges Update. Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?";
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Dies ist ein wichtiges Update. Möchtest du %1$@ jetzt aktualisieren?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?";
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Möchtest du %1$@ jetzt aktualisieren?";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@." = "%1$@ %2$@ ist verfügbar, aber deine Version von macOS ist zu neu für dieses Update. Das Update unterstützt nur bis macOS %3$@.";
|
||||
@@ -41,7 +41,7 @@
|
||||
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "„%1$@“ kann nicht aktualisiert werden, wenn das Programm von dem Ort ausgeführt wird, an den es heruntergeladen wurde.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ kann nicht aktualisiert werden, da es aus dem Downloads-Order, oder von einer DMG-Datei oder einem Laufwerk ohne Schreibzugriff gestartet wurde.";
|
||||
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ kann nicht aktualisiert werden, da es aus dem Downloads-Ordner, oder von einer DMG-Datei oder einem Laufwerk ohne Schreibzugriff gestartet wurde.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"A new version of %@ is available!" = "Eine neue Version von %@ ist verfügbar!";
|
||||
@@ -113,7 +113,7 @@
|
||||
"Failed to resume installing update." = "Das Fortsetzen der Installation ist fehlgeschlagen.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Install and Relaunch" = "Installieren und neu starten";
|
||||
"Install and Relaunch" = "Installieren und App neu starten";
|
||||
|
||||
/* Alternate title for 'Remind Me Later' button when downloaded updates can be resumed */
|
||||
"Install on Quit" = "Installieren beim Beenden";
|
||||
@@ -122,7 +122,7 @@
|
||||
"Installing update…" = "Update installieren …";
|
||||
|
||||
/* Alternate title for 'Install Update' button when there's no download in RSS feed. */
|
||||
"Learn More…" = "Mehr über …";
|
||||
"Learn More…" = "Mehr erfahren …";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Mac Model" = "Mac-Modell";
|
||||
@@ -182,7 +182,7 @@
|
||||
"Yes" = "Ja";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"You may need to allow modifications from %1$@ in System Settings under Privacy & Security and App Management to install future updates." = "Du musst möglicherweise %1$@ in den Systemeinstellungen unter „Datenschutz & Sicherheit“ und „App-Verwaltung“ hinzufügen, um künftige Updates zu installieren.";
|
||||
"You may need to allow modifications from %1$@ in System Settings under Privacy & Security and App Management to install future updates." = "Du musst möglicherweise in den Systemeinstellungen unter „Datenschutz & Sicherheit“ und „App-Verwaltung“ Änderungen von %1$@ erlauben, um künftige Updates zu installieren.";
|
||||
|
||||
/* 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!" = "Du bist auf dem neuesten Stand!";
|
||||
|
||||
Vendored
+7
-7
@@ -2,13 +2,13 @@
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ es la versión más nueva disponible.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ es la versión más nueva disponible.\n(Actualmente estás corriendo la versión %3$@.)";
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ es la versión más nueva disponible.\n(Actualmente estás ejecutando la versión %3$@.)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ ya está disponible (tienes la %3$@). ¿Quisieras descargarla ahora?";
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ ya está disponible (tienes la %3$@). ¿Querrías descargarla ahora?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update informational with no download. */
|
||||
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ ya está disponible--tú tienes la %3$@. ¿Quisieras aprender más acerca de esta actualización en la red?";
|
||||
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ ya está disponible--tú tienes la %3$@. ¿Querrías aprender más acerca de esta actualización en la red?";
|
||||
|
||||
/* The download progress in a unit of bytes, e.g. 100 KB */
|
||||
"%@ downloaded" = "%@ descargado";
|
||||
@@ -23,7 +23,7 @@
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "¡%1$@ %2$@ se ha descargado y está lista para usarse! ¿Te gustaría instalarla y volver a abrir %1$@ ahora?";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ no se puede actualizar porque fue abierta desde una ubicación temporal o de solo lectura.";
|
||||
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ no se puede actualizar porque fue abierta desde una ubicación temporal o de sólo lectura.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"A new version of %@ is available!" = "¡Una nueva versión de %@ está disponible!";
|
||||
@@ -74,7 +74,7 @@
|
||||
"OK" = "Aceptar";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Ready to Install" = "Listo para instalarse";
|
||||
"Ready to Install" = "Lista para instalarse";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "¿Debería %1$@ buscar actualizaciones automáticamente? Siempre puedes buscar actualizaciones manualmente desde el menú %1$@.";
|
||||
@@ -92,7 +92,7 @@
|
||||
"Version History" = "Historial de versiones";
|
||||
|
||||
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
||||
"You’re up to date!" = "¡Está actualizado!";
|
||||
"You’re up to date!" = "¡Estás al día!";
|
||||
|
||||
/* Software Update title/label */
|
||||
"Software Update" = "Actualización de software";
|
||||
@@ -125,4 +125,4 @@
|
||||
"Automatically download and install updates" = "Descargar e instalar actualizaciones automáticamente";
|
||||
|
||||
/* Anonymous system profile information disclosure for update permission dialog */
|
||||
"Anonymous system profile information is used to help us plan future development work. Please contact us if you have any questions about this.\n\nThis is the information that would be sent:" = "La información de perfil de sistema anónimo se usa para ayudarnos a planear el trabajo de desarrollo futuro. Por favor, póngase en contacto con nosotros si tiene preguntas sobre esto.\n\nEsta es la información que nos enviaría:";
|
||||
"Anonymous system profile information is used to help us plan future development work. Please contact us if you have any questions about this.\n\nThis is the information that would be sent:" = "La información de perfil de sistema anónimo se usa para ayudarnos a planear el trabajo de desarrollo futuro. Por favor, ponte en contacto con nosotros si tienes preguntas sobre esto.\n\nEsta es la información que nos enviaría:";
|
||||
Vendored
+3
-3
@@ -26,13 +26,13 @@
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ hiện là phiên bản mới nhất.\n(Bạn đang chạy phiên bản %3$@.)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the critical update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. This is an important update; would you like to download it now?" = "%1$@ %2$@ hiện đã có—bạn đang dùng %@. Đây là bản cập nhật quan trọng; bạn có muốn tải xuống ngay bây giờ không?";
|
||||
"%@ %@ is now available—you have %@. This is an important update; would you like to download it now?" = "%1$@ %2$@ hiện đã có—bạn đang dùng %3$@. Đây là bản cập nhật quan trọng; bạn có muốn tải xuống ngay bây giờ không?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ hiện đã có—bạn đang dùng %@. Bạn có muốn tải xuống ngay bây giờ không?";
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ hiện đã có—bạn đang dùng %3$@. Bạn có muốn tải xuống ngay bây giờ không?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update informational with no download. */
|
||||
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ hiện đã có—bạn đang dùng %@. Bạn có muốn tìm hiểu thêm về bản cập nhật này trên web không?";
|
||||
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ hiện đã có—bạn đang dùng %3$@. Bạn có muốn tìm hiểu thêm về bản cập nhật này trên web không?";
|
||||
|
||||
/* The download progress in a unit of bytes, e.g. 100 KB */
|
||||
"%@ downloaded" = "%@ đã tải xuống";
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
}
|
||||
|
||||
if (_expectedContentLength > 0) {
|
||||
double progress = (double)_contentLengthDownloaded / _expectedContentLength;
|
||||
double progress = (double)_contentLengthDownloaded / (double)_expectedContentLength;
|
||||
[self addUpdateButtonWithTitle:[NSString stringWithFormat:@"Downloading (%0.0f%%)", progress * 100] action:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,9 +191,9 @@
|
||||
NSData *archive = [NSData dataWithContentsOfURL:patchURL];
|
||||
assert(archive != nil);
|
||||
|
||||
ed25519_sign(signature, archive.bytes, archive.length, public_key, self_sign_demo_only_insecure_hack);
|
||||
ed25519_sign(signature, (const unsigned char *)archive.bytes, archive.length, public_key, self_sign_demo_only_insecure_hack);
|
||||
|
||||
NSString *signatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:0];
|
||||
NSString *signatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0];
|
||||
|
||||
// Obtain the file attributes to get the file size of our update later
|
||||
NSError *fileAttributesError = nil;
|
||||
@@ -214,12 +214,12 @@
|
||||
NSUInteger numberOfFromVersionReplacements = [appcastContents replaceOccurrencesOfString:@"$INSERT_DELTA_FROM_VERSION" withString:mainBundleVersion options:NSLiteralSearch range:NSMakeRange(0, appcastContents.length)];
|
||||
assert(numberOfFromVersionReplacements == 1);
|
||||
|
||||
NSRange feedSignaturesPrefixRange = [appcastContents rangeOfString:@"<!-- sparkle-signatures:\n" options:(NSLiteralSearch | NSBackwardsSearch)];
|
||||
NSRange feedSignaturesPrefixRange = [appcastContents rangeOfString:@"<!-- sparkle-signatures:\n" options:(NSStringCompareOptions)(NSLiteralSearch | NSBackwardsSearch)];
|
||||
assert(feedSignaturesPrefixRange.location != NSNotFound);
|
||||
|
||||
ed25519_sign(signature, (const unsigned char *)appcastContents.UTF8String, feedSignaturesPrefixRange.location, public_key, self_sign_demo_only_insecure_hack);
|
||||
|
||||
NSString *feedSignatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:0];
|
||||
NSString *feedSignatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0];
|
||||
|
||||
NSUInteger numberOfFeedSignatureReplacements = [appcastContents replaceOccurrencesOfString:@"$INSERT_EDDSA_FEED_SIGNATURE" withString:feedSignatureString options:NSLiteralSearch range:NSMakeRange(0, appcastContents.length)];
|
||||
assert(numberOfFeedSignatureReplacements == 1);
|
||||
@@ -248,9 +248,9 @@
|
||||
NSData *archive = [NSData dataWithContentsOfURL:archiveURL];
|
||||
assert(archive != nil);
|
||||
|
||||
ed25519_sign(signature, archive.bytes, archive.length, public_key, self_sign_demo_only_insecure_hack);
|
||||
ed25519_sign(signature, (const unsigned char *)archive.bytes, archive.length, public_key, self_sign_demo_only_insecure_hack);
|
||||
|
||||
NSString *signatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:0];
|
||||
NSString *signatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0];
|
||||
|
||||
// Obtain the file attributes to get the file size of our update later
|
||||
NSError *fileAttributesError = nil;
|
||||
@@ -268,12 +268,12 @@
|
||||
NSUInteger numberOfSignatureReplacements = [appcastContents replaceOccurrencesOfString:@"$INSERT_EDDSA_SIGNATURE" withString:signatureString options:NSLiteralSearch range:NSMakeRange(0, appcastContents.length)];
|
||||
assert(numberOfSignatureReplacements == 2);
|
||||
|
||||
NSRange feedSignaturesPrefixRange = [appcastContents rangeOfString:@"<!-- sparkle-signatures:\n" options:(NSLiteralSearch | NSBackwardsSearch)];
|
||||
NSRange feedSignaturesPrefixRange = [appcastContents rangeOfString:@"<!-- sparkle-signatures:\n" options:(NSStringCompareOptions)(NSLiteralSearch | NSBackwardsSearch)];
|
||||
assert(feedSignaturesPrefixRange.location != NSNotFound);
|
||||
|
||||
ed25519_sign(signature, (const unsigned char *)appcastContents.UTF8String, feedSignaturesPrefixRange.location, public_key, self_sign_demo_only_insecure_hack);
|
||||
|
||||
NSString *feedSignatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:0];
|
||||
NSString *feedSignatureString = [[NSData dataWithBytes:signature length:64] base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0];
|
||||
|
||||
NSUInteger numberOfFeedSignatureReplacements = [appcastContents replaceOccurrencesOfString:@"$INSERT_EDDSA_FEED_SIGNATURE" withString:feedSignatureString options:NSLiteralSearch range:NSMakeRange(0, appcastContents.length)];
|
||||
assert(numberOfFeedSignatureReplacements == 1);
|
||||
@@ -297,45 +297,47 @@
|
||||
abort();
|
||||
}
|
||||
self->_webServer = webServer;
|
||||
|
||||
// Set up updater and the updater settings window
|
||||
{
|
||||
self->_updateSettingsWindowController = [[SUUpdateSettingsWindowController alloc] init];
|
||||
|
||||
NSWindow *settingsWindow = self->_updateSettingsWindowController.window;
|
||||
|
||||
NSBundle *hostBundle = [NSBundle mainBundle];
|
||||
NSBundle *applicationBundle = hostBundle;
|
||||
|
||||
id<SPUUserDriver> userDriver;
|
||||
|
||||
[webServer startWithReadyHandler:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// Set up updater and the updater settings window
|
||||
self->_updateSettingsWindowController = [[SUUpdateSettingsWindowController alloc] init];
|
||||
|
||||
NSWindow *settingsWindow = self->_updateSettingsWindowController.window;
|
||||
|
||||
NSBundle *hostBundle = [NSBundle mainBundle];
|
||||
NSBundle *applicationBundle = hostBundle;
|
||||
|
||||
id<SPUUserDriver> userDriver;
|
||||
#if SPARKLE_BUILD_UI_BITS
|
||||
if (shiftKeyHeldDown) {
|
||||
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithWindow:settingsWindow];
|
||||
} else {
|
||||
userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:hostBundle delegate:nil];
|
||||
}
|
||||
if (shiftKeyHeldDown) {
|
||||
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithWindow:settingsWindow];
|
||||
} else {
|
||||
userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:hostBundle delegate:nil];
|
||||
}
|
||||
#else
|
||||
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithWindow:settingsWindow];
|
||||
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithWindow:settingsWindow];
|
||||
#endif
|
||||
|
||||
SPUUpdater *updater = [[SPUUpdater alloc] initWithHostBundle:hostBundle applicationBundle:applicationBundle userDriver:userDriver delegate:self];
|
||||
|
||||
self->_updater = updater;
|
||||
self->_updateSettingsWindowController.updater = updater;
|
||||
|
||||
NSError *updaterError = nil;
|
||||
if (![updater startUpdater:&updaterError]) {
|
||||
NSLog(@"Failed to start updater with error: %@", updaterError);
|
||||
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = @"Updater Error";
|
||||
alert.informativeText = @"The Updater failed to start. For detailed error information, check the Console.app log.";
|
||||
[alert addButtonWithTitle:@"OK"];
|
||||
[alert runModal];
|
||||
}
|
||||
|
||||
[self->_updateSettingsWindowController showWindow:nil];
|
||||
}
|
||||
|
||||
SPUUpdater *updater = [[SPUUpdater alloc] initWithHostBundle:hostBundle applicationBundle:applicationBundle userDriver:userDriver delegate:self];
|
||||
|
||||
self->_updater = updater;
|
||||
self->_updateSettingsWindowController.updater = updater;
|
||||
|
||||
NSError *updaterError = nil;
|
||||
if (![updater startUpdater:&updaterError]) {
|
||||
NSLog(@"Failed to start updater with error: %@", updaterError);
|
||||
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = @"Updater Error";
|
||||
alert.informativeText = @"The Updater failed to start. For detailed error information, check the Console.app log.";
|
||||
[alert addButtonWithTitle:@"OK"];
|
||||
[alert runModal];
|
||||
}
|
||||
|
||||
[self->_updateSettingsWindowController showWindow:nil];
|
||||
});
|
||||
}];
|
||||
});
|
||||
}];
|
||||
}
|
||||
@@ -366,11 +368,6 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification * __unused)notification
|
||||
{
|
||||
[_webServer close];
|
||||
}
|
||||
|
||||
- (IBAction)checkForUpdates:(id __unused)sender
|
||||
{
|
||||
[_updater checkForUpdates];
|
||||
|
||||
@@ -12,6 +12,6 @@ SPU_OBJC_DIRECT_MEMBERS @interface SUTestWebServer : NSObject
|
||||
|
||||
- (instancetype)initWithPort:(int)port workingDirectory:(NSString*)workingDirectory;
|
||||
|
||||
- (void)close;
|
||||
- (void)startWithReadyHandler:(dispatch_block_t)readyHandler;
|
||||
|
||||
@end
|
||||
@@ -174,6 +174,7 @@
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SUTestWebServer () <SUTestWebServerConnectionDelegate> {
|
||||
CFSocketRef _socket;
|
||||
NSThread *_serverThread;
|
||||
}
|
||||
|
||||
@property (nonatomic) NSMutableArray *connections;
|
||||
@@ -227,14 +228,23 @@ static void connectCallback(CFSocketRef __unused s, CFSocketCallBackType type, C
|
||||
_connections = [[NSMutableArray alloc] init];
|
||||
_workingDirectory = workingDirectory;
|
||||
|
||||
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, _socket, 0);
|
||||
assert(source != NULL);
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);
|
||||
CFRelease(source);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)startWithReadyHandler:(dispatch_block_t)readyHandler
|
||||
{
|
||||
_serverThread = [[NSThread alloc] initWithBlock:^{
|
||||
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, self->_socket, 0);
|
||||
assert(source != NULL);
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);
|
||||
CFRelease(source);
|
||||
readyHandler();
|
||||
[[NSRunLoop currentRunLoop] run];
|
||||
}];
|
||||
|
||||
[_serverThread start];
|
||||
}
|
||||
|
||||
- (void)connectionDidClose:(SUTestWebServerConnection *)sender
|
||||
{
|
||||
assert(_connections != nil);
|
||||
@@ -252,16 +262,4 @@ static void connectCallback(CFSocketRef __unused s, CFSocketCallBackType type, C
|
||||
}
|
||||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
for (SUTestWebServerConnection *conn in _connections) {
|
||||
[conn close];
|
||||
}
|
||||
if (_socket) {
|
||||
CFSocketInvalidate(_socket);
|
||||
CFRelease(_socket);
|
||||
_socket = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -37,10 +37,10 @@ IMPORTANT: This file must be re-signed if modifications are made to this file! T
|
||||
* Upgraded text kit system to use *improved* TextKit 2.
|
||||
* Lists in markdown can contain multiple paragraphs
|
||||
|
||||
These paragraphs can even span multiple lines if they are long and wide enough to pass over the next line. These paragraphs can also contain useful information.
|
||||
These paragraphs can even span multiple lines if they are long and wide enough to pass over the next line. These paragraphs can also contain useful information.
|
||||
|
||||
* Multiple levels of lists can also exist in Markdown
|
||||
* Indented list items can contain information that are related to a parent list point. For example this could contain information about writing long paragraphs.
|
||||
* Multiple levels of lists can also exist in Markdown
|
||||
* Indented list items can contain information that are related to a parent list point. For example this could contain information about writing long paragraphs.
|
||||
|
||||
1. Markdown also supports numbered lists.
|
||||
2. This is an example of a numbered list.
|
||||
|
||||
@@ -388,7 +388,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
- (NSData *)bigData1
|
||||
{
|
||||
const size_t bufferSize = 4096*32;
|
||||
uint8_t *buffer = calloc(1, bufferSize);
|
||||
uint8_t *buffer = (uint8_t *)calloc(1, bufferSize);
|
||||
XCTAssertTrue(buffer != NULL);
|
||||
|
||||
return [NSData dataWithBytesNoCopy:buffer length:bufferSize];
|
||||
@@ -397,7 +397,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
- (NSData *)bigData2
|
||||
{
|
||||
const size_t bufferSize = 4096*32;
|
||||
uint8_t *buffer = calloc(1, bufferSize);
|
||||
uint8_t *buffer = (uint8_t *)calloc(1, bufferSize);
|
||||
XCTAssertTrue(buffer != NULL);
|
||||
|
||||
for (size_t bufferIndex = 0; bufferIndex < bufferSize; ++bufferIndex) {
|
||||
@@ -2172,7 +2172,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
NSImage *iconImage = [NSImage imageNamed:NSImageNameAdvanced];
|
||||
XCTAssertNotNil(iconImage);
|
||||
|
||||
BOOL setIcon = [[NSWorkspace sharedWorkspace] setIcon:iconImage forFile:sourceDirectory options:0];
|
||||
BOOL setIcon = [[NSWorkspace sharedWorkspace] setIcon:iconImage forFile:sourceDirectory options:(NSWorkspaceIconCreationOptions)0];
|
||||
XCTAssertTrue(setIcon);
|
||||
} afterDiffHandler:nil afterPatchHandler:nil];
|
||||
XCTAssertFalse(success);
|
||||
@@ -2190,7 +2190,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
NSImage *iconImage = [NSImage imageNamed:NSImageNameAdvanced];
|
||||
XCTAssertNotNil(iconImage);
|
||||
|
||||
BOOL setIcon = [[NSWorkspace sharedWorkspace] setIcon:iconImage forFile:destinationDirectory options:0];
|
||||
BOOL setIcon = [[NSWorkspace sharedWorkspace] setIcon:iconImage forFile:destinationDirectory options:(NSWorkspaceIconCreationOptions)0];
|
||||
XCTAssertTrue(setIcon);
|
||||
} afterDiffHandler:nil afterPatchHandler:nil];
|
||||
XCTAssertFalse(success);
|
||||
@@ -2208,7 +2208,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
NSImage *iconImage = [NSImage imageNamed:NSImageNameAdvanced];
|
||||
XCTAssertNotNil(iconImage);
|
||||
|
||||
BOOL setIcon = [[NSWorkspace sharedWorkspace] setIcon:iconImage forFile:sourceDirectory options:0];
|
||||
BOOL setIcon = [[NSWorkspace sharedWorkspace] setIcon:iconImage forFile:sourceDirectory options:(NSWorkspaceIconCreationOptions)0];
|
||||
XCTAssertTrue(setIcon);
|
||||
} afterPatchHandler:nil];
|
||||
XCTAssertTrue(success);
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
return [v verifyFileAtPath:aFile signatures:sig verifierInformation:nil error:error];
|
||||
}
|
||||
|
||||
static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
static SUSignatures *createSignatures(NSString *edString, NSString *dsaString)
|
||||
{
|
||||
#if !SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
(void)dsaString;
|
||||
@@ -165,7 +165,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
|
||||
SUSignatureVerifier *v = [[SUSignatureVerifier alloc] initWithPublicKeys:pubKeys];
|
||||
|
||||
SUSignatures *sig = _createSignatures(sigString, nil);
|
||||
SUSignatures *sig = createSignatures(sigString, nil);
|
||||
|
||||
return [v verifyFileAtPath:aFile signatures:sig verifierInformation:nil error:error];
|
||||
}
|
||||
@@ -180,10 +180,10 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
NSError *error = nil;
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(nil, nil) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(nil, nil) verifierInformation:nil error:&error],
|
||||
@"Fail if no signatures are provided: %@", error);
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(@"lol", @"lol") verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(@"lol", @"lol") verifierInformation:nil error:&error],
|
||||
@"Fail if both signatures are invalid: %@", error);
|
||||
|
||||
NSString *dsaSig = @"MCwCFCIHCIYYkfZavNzTitTW5tlRp/k5AhQ40poFytqcVhIYdCxQznaXeJPJDQ==";
|
||||
@@ -192,36 +192,36 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
NSString *wrongEdSig = @"wTcpXCgWoa4NrJpsfzS61FXJIbv963//12U2ef9xstzVOLPHYK2N4/ojgpDV5N1/NGG1uWMBgK+kEWp0Z5zMDQ==";
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(nil, dsaSig) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(nil, dsaSig) verifierInformation:nil error:&error],
|
||||
@"EdDSA signature must be present if app has EdDSA key: %@", error);
|
||||
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, nil) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(edSig, nil) verifierInformation:nil error:&error],
|
||||
@"Allow just an EdDSA signature if that's all that's available: %@", error);
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(wrongEdSig, dsaSig) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(wrongEdSig, dsaSig) verifierInformation:nil error:&error],
|
||||
@"Fail on a bad Ed25519 signature regardless: %@", error);
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, wrongDSASig) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(edSig, wrongDSASig) verifierInformation:nil error:&error],
|
||||
@"Allow bad DSA signature if EdDSA signature is good: %@", error);
|
||||
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(@"lol", dsaSig) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(@"lol", dsaSig) verifierInformation:nil error:&error],
|
||||
@"Fail if the Ed25519 signature is invalid: %@", error);
|
||||
|
||||
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
XCTAssertFalse([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, @"lol") verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(edSig, @"lol") verifierInformation:nil error:&error],
|
||||
@"Fail if invalid DSA signature is used even if EdDSA signature is good: %@", error);
|
||||
#else
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, @"lol") error:&error],
|
||||
signatures:createSignatures(edSig, @"lol") error:&error],
|
||||
@"Allow invalid DSA signature if EdDSA signature is good: %@", error);
|
||||
#endif
|
||||
|
||||
XCTAssertTrue([v verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, dsaSig) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(edSig, dsaSig) verifierInformation:nil error:&error],
|
||||
@"Pass if both are valid: %@", error);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
SUSignatureVerifier *dsaOnlyVerifier = [[SUSignatureVerifier alloc] initWithPublicKeys:dsaOnlyKeys];
|
||||
|
||||
XCTAssertFalse([dsaOnlyVerifier verifyFileAtPath:_testFile
|
||||
signatures:_createSignatures(edSig, nil) verifierInformation:nil error:&error],
|
||||
signatures:createSignatures(edSig, nil) verifierInformation:nil error:&error],
|
||||
@"DSA cannot verify an Ed signature: %@", error);
|
||||
|
||||
SUPublicKeys *edOnlyKeys = [[SUPublicKeys alloc] initWithEd:_pubEdKey
|
||||
@@ -247,7 +247,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
SUSignatureVerifier *edOnlyVerifier = [[SUSignatureVerifier alloc] initWithPublicKeys:edOnlyKeys];
|
||||
|
||||
{
|
||||
SUSignatures *signatures = _createSignatures(nil, dsaSig);
|
||||
SUSignatures *signatures = createSignatures(nil, dsaSig);
|
||||
XCTAssertFalse([edOnlyVerifier verifyFileAtPath:_testFile
|
||||
signatures:signatures
|
||||
verifierInformation:nil
|
||||
@@ -265,7 +265,7 @@ static SUSignatures *_createSignatures(NSString *edString, NSString *dsaString)
|
||||
XCTAssertNotNil(pubkeys);
|
||||
XCTAssertNotNil(pubkeys.dsaPubKey);
|
||||
|
||||
SUSignatures *sig = _createSignatures(nil, @"MC0CFFMF3ha5kjvrJ9JTpTR8BenPN9QUAhUAzY06JRdtP17MJewxhK0twhvbKIE=");
|
||||
SUSignatures *sig = createSignatures(nil, @"MC0CFFMF3ha5kjvrJ9JTpTR8BenPN9QUAhUAzY06JRdtP17MJewxhK0twhvbKIE=");
|
||||
XCTAssertNotNil(sig);
|
||||
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
||||
XCTAssertNotNil(sig.dsaSignature);
|
||||
|
||||
Vendored
+5
-3
@@ -12,6 +12,8 @@ u_char *readfile(const char *filename, off_t *outSize)
|
||||
{
|
||||
int success = -1;
|
||||
u_char *buffer = NULL;
|
||||
long offset = 0;
|
||||
size_t size = 0;
|
||||
|
||||
FILE *file = fopen(filename, "r");
|
||||
if (file == NULL) {
|
||||
@@ -22,12 +24,12 @@ u_char *readfile(const char *filename, off_t *outSize)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
long offset = ftell(file);
|
||||
offset = ftell(file);
|
||||
if (offset == -1) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
size_t size = (size_t)offset;
|
||||
size = (size_t)offset;
|
||||
|
||||
if (outSize != NULL) {
|
||||
*outSize = (off_t)size;
|
||||
@@ -35,7 +37,7 @@ u_char *readfile(const char *filename, off_t *outSize)
|
||||
|
||||
/* Allocate size + 1 bytes instead of newsize bytes to ensure
|
||||
that we never try to malloc(0) and get a NULL pointer */
|
||||
buffer = malloc(size + 1);
|
||||
buffer = (u_char *)malloc(size + 1);
|
||||
if (buffer == NULL) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
Vendored
+26
-26
@@ -45,13 +45,13 @@ __FBSDID("$FreeBSD: src/usr.bin/bsdiff/bsdiff/bsdiff.c, v 1.1 2005/08/06 01:59:0
|
||||
/* matchlen(old, oldsize, new, newsize)
|
||||
*
|
||||
* Returns the length of the longest common prefix between 'old' and 'new'. */
|
||||
static off_t matchlen(u_char *old, off_t oldsize, u_char *new, off_t newsize)
|
||||
static off_t matchlen(u_char *old, off_t oldsize, u_char *newp, off_t newsize)
|
||||
{
|
||||
off_t i;
|
||||
|
||||
for (i = 0; (i < oldsize) && (i < newsize); i++)
|
||||
{
|
||||
if (old[i] != new[i])
|
||||
if (old[i] != newp[i])
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -66,13 +66,13 @@ static off_t matchlen(u_char *old, off_t oldsize, u_char *new, off_t newsize)
|
||||
* sort to consider. If you're searching all suffixes, 'st = 0' and 'en =
|
||||
* oldsize - 1'. */
|
||||
static off_t search(off_t *I, u_char *old, off_t oldsize,
|
||||
u_char *new, off_t newsize, off_t st, off_t en, off_t *pos)
|
||||
u_char *newp, off_t newsize, off_t st, off_t en, off_t *pos)
|
||||
{
|
||||
off_t x, y;
|
||||
|
||||
if (en - st < 2) {
|
||||
x = matchlen(old + I[st], oldsize - I[st], new, newsize);
|
||||
y = matchlen(old + I[en], oldsize - I[en], new, newsize);
|
||||
x = matchlen(old + I[st], oldsize - I[st], newp, newsize);
|
||||
y = matchlen(old + I[en], oldsize - I[en], newp, newsize);
|
||||
|
||||
if (x > y) {
|
||||
*pos = I[st];
|
||||
@@ -86,11 +86,11 @@ static off_t search(off_t *I, u_char *old, off_t oldsize,
|
||||
x = st + (en - st)/2;
|
||||
/* Modification ported from ChromiumOS project:
|
||||
* https://chromium.googlesource.com/chromiumos/third_party/bsdiff/+/58146f74abd6b1b69693943195f37f4ac6a6acef%5E%21/#F0 */
|
||||
if (memcmp(old + I[x], new, (size_t)(MIN(oldsize - I[x], newsize))) <= 0) {
|
||||
return search(I, old, oldsize, new, newsize, x, en, pos);
|
||||
if (memcmp(old + I[x], newp, (size_t)(MIN(oldsize - I[x], newsize))) <= 0) {
|
||||
return search(I, old, oldsize, newp, newsize, x, en, pos);
|
||||
} else {
|
||||
return search(I, old, oldsize, new, newsize, st, x, pos);
|
||||
};
|
||||
return search(I, old, oldsize, newp, newsize, st, x, pos);
|
||||
}
|
||||
}
|
||||
|
||||
/* offtout(x, buf)
|
||||
@@ -123,7 +123,7 @@ int bsdiff(int argc, char *argv[]); // Added by AMM: suppresses a warning about
|
||||
|
||||
int bsdiff(int argc, char *argv[])
|
||||
{
|
||||
u_char *old = NULL,*new = NULL; /* contents of old, new files */
|
||||
u_char *old = NULL,*newp = NULL; /* contents of old, new files */
|
||||
off_t oldsize = 0, newsize = 0; /* length of old, new files */
|
||||
off_t *I = NULL,*V = NULL; /* arrays used for suffix sort; I is ordering */
|
||||
off_t scan = 0; /* position of current match in old file */
|
||||
@@ -154,8 +154,8 @@ int bsdiff(int argc, char *argv[])
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (((I = malloc(((size_t)oldsize + 1) * sizeof(off_t))) == NULL) ||
|
||||
((V = malloc(((size_t)oldsize + 1) * sizeof(off_t))) == NULL)) {
|
||||
if (((I = (off_t *)malloc(((size_t)oldsize + 1) * sizeof(off_t))) == NULL) ||
|
||||
((V = (off_t *)malloc(((size_t)oldsize + 1) * sizeof(off_t))) == NULL)) {
|
||||
warn("Failed to allocate memory for I or V");
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -167,14 +167,14 @@ int bsdiff(int argc, char *argv[])
|
||||
free(V);
|
||||
V = NULL;
|
||||
|
||||
new = readfile(argv[2], &newsize);
|
||||
if (new == NULL) {
|
||||
newp = readfile(argv[2], &newsize);
|
||||
if (newp == NULL) {
|
||||
warn("new file error: %s", argv[2]);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (((db = malloc((size_t)newsize + 1)) == NULL) ||
|
||||
((eb = malloc((size_t)newsize + 1)) == NULL)) {
|
||||
if (((db = (u_char *)malloc((size_t)newsize + 1)) == NULL) ||
|
||||
((eb = (u_char *)malloc((size_t)newsize + 1)) == NULL)) {
|
||||
warn("Failed to allocate memory for db or eb");
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -229,14 +229,14 @@ int bsdiff(int argc, char *argv[])
|
||||
/* 'oldscore' is the number of characters that match between the
|
||||
* substrings 'old[lastoffset + scan:lastoffset + scsc]' and
|
||||
* 'new[scan:scsc]'. */
|
||||
len = search(I, old, oldsize, new + scan, newsize - scan,
|
||||
len = search(I, old, oldsize, newp + scan, newsize - scan,
|
||||
0, oldsize, &pos);
|
||||
|
||||
/* If this match extends further than the last one, add any new
|
||||
* matching characters to 'oldscore'. */
|
||||
for (; scsc < scan + len; scsc++) {
|
||||
if ((scsc + lastoffset < oldsize) &&
|
||||
(old[scsc + lastoffset] == new[scsc]))
|
||||
(old[scsc + lastoffset] == newp[scsc]))
|
||||
oldscore++;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ int bsdiff(int argc, char *argv[])
|
||||
/* Since we're advancing 'scan' by 1, remove the character under it
|
||||
* from 'oldscore' if it matches. */
|
||||
if ((scan + lastoffset < oldsize) &&
|
||||
(old[scan + lastoffset] == new[scan]))
|
||||
(old[scan + lastoffset] == newp[scan]))
|
||||
oldscore--;
|
||||
|
||||
/* Modification ported from ChromiumOS project:
|
||||
@@ -276,7 +276,7 @@ int bsdiff(int argc, char *argv[])
|
||||
Sf = 0;
|
||||
lenf = 0;
|
||||
for (i = 0; (lastscan + i < scan) && (lastpos + i < oldsize);) {
|
||||
if (old[lastpos + i] == new[lastscan + i])
|
||||
if (old[lastpos + i] == newp[lastscan + i])
|
||||
s++;
|
||||
i++;
|
||||
if (s * 2 - i > Sf * 2 - lenf) {
|
||||
@@ -291,7 +291,7 @@ int bsdiff(int argc, char *argv[])
|
||||
s = 0;
|
||||
Sb = 0;
|
||||
for (i = 1; (scan >= lastscan + i) && (pos >= i); i++) {
|
||||
if (old[pos - i] == new[scan - i])
|
||||
if (old[pos - i] == newp[scan - i])
|
||||
s++;
|
||||
if (s * 2 - i > Sb * 2 - lenb) {
|
||||
Sb = s;
|
||||
@@ -309,10 +309,10 @@ int bsdiff(int argc, char *argv[])
|
||||
Ss = 0;
|
||||
lens = 0;
|
||||
for (i = 0; i < overlap; i++) {
|
||||
if (new[lastscan + lenf - overlap + i] ==
|
||||
if (newp[lastscan + lenf - overlap + i] ==
|
||||
old[lastpos + lenf - overlap + i])
|
||||
s++;
|
||||
if (new[scan - lenb + i] == old[pos - lenb + i])
|
||||
if (newp[scan - lenb + i] == old[pos - lenb + i])
|
||||
s--;
|
||||
if (s > Ss) {
|
||||
Ss = s;
|
||||
@@ -326,11 +326,11 @@ int bsdiff(int argc, char *argv[])
|
||||
|
||||
/* Write the diff data for the last match to the diff section... */
|
||||
for (i = 0; i < lenf; i++)
|
||||
db[dblen + i] = new[lastscan + i] - old[lastpos + i];
|
||||
db[dblen + i] = newp[lastscan + i] - old[lastpos + i];
|
||||
/* ... and, if there's a gap between the extensions just
|
||||
* calculated, write the data in that gap to the extra section. */
|
||||
for (i = 0; i< (scan - lenb) - (lastscan + lenf); i++)
|
||||
eb[eblen + i] = new[lastscan + lenf + i];
|
||||
eb[eblen + i] = newp[lastscan + lenf + i];
|
||||
|
||||
/* Update the diff and extra section lengths accordingly. */
|
||||
dblen += lenf;
|
||||
@@ -425,7 +425,7 @@ cleanup:
|
||||
free(I);
|
||||
free(V);
|
||||
free(old);
|
||||
free(new);
|
||||
free(newp);
|
||||
|
||||
return exitstatus;
|
||||
}
|
||||
Vendored
+11
-10
@@ -135,13 +135,14 @@ int bspatch(int argc,const char * const argv[])
|
||||
ssize_t oldsize = 0,newsize = 0;
|
||||
ssize_t bzctrllen = 0,bzdatalen = 0;
|
||||
u_char header[32] = {0},buf[8] = {0};
|
||||
u_char *old = NULL, *new = NULL;
|
||||
u_char *old = NULL, *newp = NULL;
|
||||
off_t oldpos = 0,newpos = 0;
|
||||
off_t ctrl[3] = {0};
|
||||
off_t lenread = 0;
|
||||
off_t i = 0;
|
||||
io_funcs_t * io = NULL;
|
||||
int exitstatus = -1;
|
||||
off_t size = 0;
|
||||
|
||||
if(argc!=4) {
|
||||
warnx("usage: %s oldfile newfile patchfile\n",argv[0]);
|
||||
@@ -247,7 +248,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
warn("estream open");
|
||||
goto cleanup;
|
||||
}
|
||||
off_t size = 0;
|
||||
|
||||
old = readfile(argv[1], &size);
|
||||
if (old == NULL) {
|
||||
warn("old file: %s", argv[1]);
|
||||
@@ -256,7 +257,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
|
||||
oldsize = size;
|
||||
|
||||
if((new=malloc((size_t)newsize+1))==NULL) {
|
||||
if((newp=(u_char *)malloc((size_t)newsize+1))==NULL) {
|
||||
warn("Failed to allocate memory for new");
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -271,7 +272,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
goto cleanup;
|
||||
}
|
||||
ctrl[i]=offtin(buf);
|
||||
};
|
||||
}
|
||||
|
||||
/* Sanity-check */
|
||||
if(newpos+ctrl[0]>newsize) {
|
||||
@@ -280,7 +281,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
}
|
||||
|
||||
/* Read diff string */
|
||||
lenread = io->read(dstream, new + newpos, ctrl[0]);
|
||||
lenread = io->read(dstream, newp + newpos, ctrl[0]);
|
||||
if (lenread < 0 || lenread < ctrl[0]) {
|
||||
warnx("Corrupt patch\n");
|
||||
goto cleanup;
|
||||
@@ -289,7 +290,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
/* Add old data to diff string */
|
||||
for(i=0;i<ctrl[0];i++)
|
||||
if((oldpos+i>=0) && (oldpos+i<oldsize))
|
||||
new[newpos+i]+=old[oldpos+i];
|
||||
newp[newpos+i]+=old[oldpos+i];
|
||||
|
||||
/* Adjust pointers */
|
||||
newpos+=ctrl[0];
|
||||
@@ -302,7 +303,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
}
|
||||
|
||||
/* Read extra string */
|
||||
lenread = io->read(estream, new + newpos, ctrl[1]);
|
||||
lenread = io->read(estream, newp + newpos, ctrl[1]);
|
||||
if (lenread < 0 || lenread < ctrl[1]) {
|
||||
warnx("Corrupt patch\n");
|
||||
goto cleanup;
|
||||
@@ -311,7 +312,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
/* Adjust pointers */
|
||||
newpos+=ctrl[1];
|
||||
oldpos+=ctrl[2];
|
||||
};
|
||||
}
|
||||
|
||||
/* Clean up the bzip2 reads */
|
||||
io->close(cstream);
|
||||
@@ -349,7 +350,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (fwrite(new, 1, (size_t)newsize, f) < (size_t)newsize) {
|
||||
if (fwrite(newp, 1, (size_t)newsize, f) < (size_t)newsize) {
|
||||
warn("failed to write to new file: %s", argv[2]);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -363,7 +364,7 @@ int bspatch(int argc,const char * const argv[])
|
||||
|
||||
exitstatus = 0;
|
||||
cleanup:
|
||||
free(new);
|
||||
free(newp);
|
||||
free(old);
|
||||
|
||||
if (f != NULL) {
|
||||
|
||||
Vendored
+11
-11
@@ -100,7 +100,7 @@ static int sha512_compress(sha512_context *md, unsigned char *buf)
|
||||
|
||||
/* copy the state into 1024-bits into W[0..15] */
|
||||
for (i = 0; i < 16; i++) {
|
||||
LOAD64H(W[i], buf + (8*i));
|
||||
LOAD64H(W[i], buf + (8*i))
|
||||
}
|
||||
|
||||
/* fill W[16..79] */
|
||||
@@ -116,14 +116,14 @@ static int sha512_compress(sha512_context *md, unsigned char *buf)
|
||||
h = t0 + t1;
|
||||
|
||||
for (i = 0; i < 80; i += 8) {
|
||||
RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0);
|
||||
RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1);
|
||||
RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2);
|
||||
RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3);
|
||||
RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4);
|
||||
RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5);
|
||||
RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6);
|
||||
RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7);
|
||||
RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0)
|
||||
RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1)
|
||||
RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2)
|
||||
RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3)
|
||||
RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4)
|
||||
RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5)
|
||||
RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6)
|
||||
RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7)
|
||||
}
|
||||
|
||||
#undef RND
|
||||
@@ -253,12 +253,12 @@ while (md->curlen < 120) {
|
||||
}
|
||||
|
||||
/* store length */
|
||||
STORE64H(md->length, md->buf+120);
|
||||
STORE64H(md->length, md->buf+120)
|
||||
sha512_compress(md, md->buf);
|
||||
|
||||
/* copy output */
|
||||
for (i = 0; i < 8; i++) {
|
||||
STORE64H(md->state[i], out+(8*i));
|
||||
STORE64H(md->state[i], out+(8*i))
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -40,14 +40,14 @@ func addSignWarningToAppcast(data inputData: Data) -> Data {
|
||||
let signWarningPrefix = " sparkle-sign-warning:"
|
||||
let signWarningMessage = "\nIMPORTANT: This file was signed by Sparkle. Any modifications to this file requires re-signing this file with generate_appcast or sign_update! The signed signature will be embedded at the end of this file.\n"
|
||||
|
||||
let readOptions: XMLNode.Options = [
|
||||
let readAndWriteOptions: XMLNode.Options = [
|
||||
XMLNode.Options.nodeLoadExternalEntitiesNever,
|
||||
XMLNode.Options.nodePreserveCDATA,
|
||||
XMLNode.Options.nodePreserveWhitespace,
|
||||
]
|
||||
|
||||
do {
|
||||
let document = try XMLDocument(data: inputData, options: readOptions)
|
||||
let document = try XMLDocument(data: inputData, options: readAndWriteOptions)
|
||||
|
||||
var foundSignWarningComment: Bool = false
|
||||
if let documentChildren = document.children {
|
||||
@@ -66,8 +66,7 @@ func addSignWarningToAppcast(data inputData: Data) -> Data {
|
||||
newCommentNode.stringValue = newSigningWarningMessage
|
||||
document.insertChild(newCommentNode, at: 0)
|
||||
|
||||
let writeOptions: XMLNode.Options = [.nodeCompactEmptyElement, .nodePrettyPrint]
|
||||
xmlData = document.xmlData(options: writeOptions)
|
||||
xmlData = document.xmlData(options: readAndWriteOptions)
|
||||
} else {
|
||||
xmlData = inputData
|
||||
}
|
||||
|
||||
@@ -45,7 +45,13 @@ func makeAppcasts(archivesSourceDir: URL, outputPathURL: URL?, cacheDirectory ca
|
||||
// Group updates by appcast feed
|
||||
var updatesByAppcast: [FeedName: [ArchiveItem]] = [:]
|
||||
for update in allUpdates {
|
||||
let appcastFile = update.feedURL?.lastPathComponent ?? "appcast.xml"
|
||||
let appcastFile: String
|
||||
if let lastComponent = update.feedURL?.lastPathComponent, !lastComponent.isEmpty {
|
||||
appcastFile = lastComponent
|
||||
} else {
|
||||
appcastFile = "appcast.xml"
|
||||
}
|
||||
|
||||
updatesByAppcast[appcastFile, default: []].append(update)
|
||||
}
|
||||
|
||||
@@ -227,6 +233,7 @@ func makeAppcasts(archivesSourceDir: URL, outputPathURL: URL?, cacheDirectory ca
|
||||
// but we still wanted to record the used delta updates for a batch of recent updates
|
||||
// This is to support rollback in case the top newly generated update isn't exactly what the user wants
|
||||
let generatingDeltas = latestVersionPerBranch.contains(version)
|
||||
let itemDeltasLock = NSLock()
|
||||
var numDeltas = 0
|
||||
let appBaseName = latestItem.appPath.deletingPathExtension().lastPathComponent
|
||||
for item in updates {
|
||||
@@ -354,6 +361,10 @@ func makeAppcasts(archivesSourceDir: URL, outputPathURL: URL?, cacheDirectory ca
|
||||
markDeltaAsIgnored(delta: delta, markerPath: ignoreMarkerPath)
|
||||
continue
|
||||
}
|
||||
|
||||
itemDeltasLock.lock()
|
||||
latestItem.deltas.append(delta)
|
||||
itemDeltasLock.unlock()
|
||||
|
||||
group.enter()
|
||||
DispatchQueue.global().async {
|
||||
@@ -378,11 +389,13 @@ func makeAppcasts(archivesSourceDir: URL, outputPathURL: URL?, cacheDirectory ca
|
||||
#if GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT
|
||||
hasAnyDSASignature = hasAnyDSASignature || (delta.dsaSignature != nil)
|
||||
#endif
|
||||
if hasAnyDSASignature {
|
||||
latestItem.deltas.append(delta)
|
||||
} else {
|
||||
if !hasAnyDSASignature {
|
||||
markDeltaAsIgnored(delta: delta, markerPath: ignoreMarkerPath)
|
||||
print("Delta \(delta.archivePath.path) ignored, because it could not be signed")
|
||||
|
||||
itemDeltasLock.lock()
|
||||
latestItem.deltas.removeAll { $0 === delta }
|
||||
itemDeltasLock.unlock()
|
||||
}
|
||||
}
|
||||
group.leave()
|
||||
|
||||
@@ -83,6 +83,9 @@ struct GenerateAppcast: ParsableCommand {
|
||||
@Option(name: .customLong("ed-key-file"), help: ArgumentHelp("Path to the private EdDSA key file. If not specified, the private EdDSA key will be read from the Keychain instead. '-' can be used to echo the EdDSA key from a 'secret' environment variable to the standard input stream. For example: echo \"$PRIVATE_KEY_SECRET\" | ./\(programName) --ed-key-file -", valueName: "private-EdDSA-key-file"))
|
||||
var privateEdKeyPath: String?
|
||||
|
||||
@Flag(name: .long, help: ArgumentHelp("Disables adding a warning to signed appcast and release note files explaining that further modifications will require re-signing them. This flag has no effect if the files already have a signing warning embedded."))
|
||||
var disableSigningWarning: Bool = false
|
||||
|
||||
#if GENERATE_APPCAST_BUILD_LEGACY_DSA_SUPPORT
|
||||
@Option(name: .customShort("f"), help: ArgumentHelp("Path to the private DSA key file. Only use this option for transitioning to EdDSA from older updates.", valueName: "private-dsa-key-file"), transform: { URL(fileURLWithPath: $0) })
|
||||
var privateDSAKeyURL: URL?
|
||||
@@ -165,10 +168,6 @@ struct GenerateAppcast: ParsableCommand {
|
||||
@Argument(help: "The path to the directory containing the update archives and delta files.", transform: { URL(fileURLWithPath: $0, isDirectory: true) })
|
||||
var archivesSourceDir: URL
|
||||
|
||||
// Disables embedding sign warning when signing appcast XML feeds or HTML/markdown release note files
|
||||
@Flag(name: .long, help: .hidden)
|
||||
var disableEmbeddedSignWarning: Bool = false
|
||||
|
||||
@Flag(help: .hidden)
|
||||
var verbose: Bool = false
|
||||
|
||||
@@ -337,7 +336,7 @@ struct GenerateAppcast: ParsableCommand {
|
||||
relativeTo: archivesSourceDir)
|
||||
|
||||
// Write the appcast
|
||||
let (numNewUpdates, numExistingUpdates, numUpdatesRemoved) = try writeAppcast(appcastDestPath: appcastDestPath, keys: keys, disableEmbeddedSignWarning: disableEmbeddedSignWarning, appcast: appcast, fullReleaseNotesLink: fullReleaseNotesURL, preferToEmbedReleaseNotes: embedReleaseNotes, link: link, newChannel: channel, newMinimumUpdateVersion: minimumUpdateVersion, majorVersion: majorVersion, ignoreSkippedUpgradesBelowVersion: ignoreSkippedUpgradesBelowVersion, phasedRolloutInterval: phasedRolloutInterval, criticalUpdateVersion: criticalUpdateVersion, informationalUpdateVersions: informationalUpdateVersions)
|
||||
let (numNewUpdates, numExistingUpdates, numUpdatesRemoved) = try writeAppcast(appcastDestPath: appcastDestPath, keys: keys, disableEmbeddedSignWarning: disableSigningWarning, appcast: appcast, fullReleaseNotesLink: fullReleaseNotesURL, preferToEmbedReleaseNotes: embedReleaseNotes, link: link, newChannel: channel, newMinimumUpdateVersion: minimumUpdateVersion, majorVersion: majorVersion, ignoreSkippedUpgradesBelowVersion: ignoreSkippedUpgradesBelowVersion, phasedRolloutInterval: phasedRolloutInterval, criticalUpdateVersion: criticalUpdateVersion, informationalUpdateVersions: informationalUpdateVersions)
|
||||
|
||||
// Inform the user, pluralizing "update" if necessary
|
||||
let pluralizeUpdates = { pluralizeWord($0, "update") }
|
||||
|
||||
+9
-10
@@ -100,19 +100,18 @@ struct SignUpdate: ParsableCommand {
|
||||
@Flag(name: .customShort("p"), help: ArgumentHelp("Only prints the signature when signing a file without extra metadata. For signing XML files, nothing will be printed because the signature is embedded inside the file."))
|
||||
var printOnlySignature: Bool = false
|
||||
|
||||
@Argument(help: "The update archive, delta update, package (pkg), release notes file, or update feed (xml) to sign or verify. If the file is a update feed (xml), the file will be modified to include the generated signature. If the file is a release notes file, the file may also be updated to include a warning that it is signed.")
|
||||
@Argument(help: "The update archive, delta update, package (pkg), release notes file, or update feed (xml) to sign or verify. If the file is a update feed (xml), the file will be modified to include the generated signature. If the file is a release notes file, the file may also be updated to include a warning that it is signed (unless --disable-signing-warning is specified).")
|
||||
var filePath: String
|
||||
|
||||
@Flag(name: .long, help: ArgumentHelp("Disables adding a warning to signed appcast and release note files explaining that further modifications will require re-signing them. This flag has no effect if the files already have a signing warning embedded."))
|
||||
var disableSigningWarning: Bool = false
|
||||
|
||||
@Argument(help: "The signature to verify when --verify is passed. Don't pass this option for verifying appcast XML feeds, which already have a signature embedded.")
|
||||
var verifySignature: String?
|
||||
|
||||
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA (ed25519) key. Please use the Keychain, or pass the key as standard input when using --ed-key-file - instead. This option is no longer supported for newly generated keys. ", valueName: "private-key"))
|
||||
@Option(name: .customShort("s"), help: ArgumentHelp("(DEPRECATED): The private EdDSA (ed25519) key. Please use the Keychain, or pass the key as standard input when using --ed-key-file - instead. This option is no longer supported for newly generated keys.", valueName: "private-key"))
|
||||
var privateKey: String?
|
||||
|
||||
// Disables embedding sign warning when signing appcast XML feeds or HTML/markdown release note files
|
||||
@Flag(name: .long, help: .hidden)
|
||||
var disableEmbeddedSignWarning: Bool = false
|
||||
|
||||
static var configuration: CommandConfiguration = CommandConfiguration(
|
||||
abstract: "Sign or verify an update file using your signing keys.",
|
||||
discussion:
|
||||
@@ -123,9 +122,9 @@ struct SignUpdate: ParsableCommand {
|
||||
|
||||
For signing update archives, sign_update will output an EdDSA signature and length attributes to use for your update's appcast item enclosure.
|
||||
|
||||
For signing release note files, sign_update will output an EdDSA signature and length attributes to use for your update's appcast releaseNotesLink. Additionally, the release notes file may be modified to include a warning about making future modifications to the file.
|
||||
For signing release note files, sign_update will output an EdDSA signature and length attributes to use for your update's appcast releaseNotesLink. Additionally, the release notes file may be modified to include a warning about making future modifications to the file (unless --disable-signing-warning is specified).
|
||||
|
||||
For signing appcast feeds, sign_update will embed the signature inside the XML file and include a warning about making future modifications to the file.
|
||||
For signing appcast feeds, sign_update will embed the signature inside the XML file and include a warning about making future modifications to the file (unless --disable-signing-warning is specified).
|
||||
|
||||
For signing files, you can use -p to only print the EdDSA signature for automation.
|
||||
""")
|
||||
@@ -238,7 +237,7 @@ struct SignUpdate: ParsableCommand {
|
||||
if self.filePathIsFeed {
|
||||
let contentData = SPUExtractAppcastContent(data, nil, nil)
|
||||
|
||||
let dataToSign: Data = disableEmbeddedSignWarning ? contentData : addSignWarningToAppcast(data: contentData)
|
||||
let dataToSign: Data = disableSigningWarning ? contentData : addSignWarningToAppcast(data: contentData)
|
||||
let addedSignWarningToAppcast = (contentData.count != dataToSign.count)
|
||||
let signedData = try signAppcast(data: dataToSign, publicEdKey: pub, privateEdKey: priv)
|
||||
try signedData.write(to: fileURL, options: .atomic)
|
||||
@@ -254,7 +253,7 @@ struct SignUpdate: ParsableCommand {
|
||||
let signedData: Data
|
||||
let updatedSigningWarningInReleaseNotes: Bool
|
||||
|
||||
if disableEmbeddedSignWarning || (!self.filePathIsHTMLReleaseNotes && !self.filePathIsMarkdownReleaseNotes) {
|
||||
if disableSigningWarning || (!self.filePathIsHTMLReleaseNotes && !self.filePathIsMarkdownReleaseNotes) {
|
||||
signedData = data
|
||||
updatedSigningWarningInReleaseNotes = false
|
||||
} else {
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
}
|
||||
|
||||
if (_bytesToDownload > 0 && _verbose) {
|
||||
NSString *currentProgressPercentage = [NSString stringWithFormat:@"%.0f%%", (_bytesDownloaded * 100.0 / _bytesToDownload)];
|
||||
NSString *currentProgressPercentage = [NSString stringWithFormat:@"%.0f%%", ((double)_bytesDownloaded * 100.0 / (double)_bytesToDownload)];
|
||||
|
||||
// Only report progress advancement when percentage significantly advances
|
||||
if (_lastProgressReported == nil || ![_lastProgressReported isEqualToString:currentProgressPercentage]) {
|
||||
|
||||
Reference in new issue
Block a user