Compare commits

..
6 Commits
Author SHA1 Message Date
Sparkle-Bot 83f9e29c28 Update Package management files for version 2.11.0-beta.1 2026-11-16 04:24:41 +00:00
Zorg c50cf08f3e Update CHANGELOG for 2.11.0 2026-11-15 20:16:50 -08:00
Zorg 8f90b193cb Add <sparkle:bundleIdentifier> on appcast for signed feeds (#2954) 2026-11-15 20:12:32 -08:00
Zorg 57bb19085b Avoid using host bundle filename for finding bundle to update (#2953)
The user can rename the host bundle filename so it's not reliable and gives a false sense of reliability. We keep matching against the name of the bundle derived from the Info.plist and the bundle identifier.
2026-11-15 20:12:14 -08:00
Niklas Wenzel 5014eb5e63 Activate app if update check is initiated from NSStatusItem (#2950) 2026-11-15 20:11:57 -08:00
1024jp 1967167890 Update Japanese localization (#2948)
- Add missing translations.
- Refine existing translations to make them sound more like macOS.
2026-11-15 20:11:19 -08:00
48 changed files with 255 additions and 64 deletions

No files matched your search

+24 -8
View File
@@ -21,6 +21,17 @@
@implementation SUInstaller
static BOOL SUFilenameMatchesAnyName(NSString *filename, NSOrderedSet<NSString *> *names)
{
for (NSString *name in names) {
// This handles unicode normalization but is still a case sensitive comparison
if ([filename compare:name] == NSOrderedSame) {
return YES;
}
}
return NO;
}
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host
#if SPARKLE_BUILD_PACKAGE_SUPPORT
isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr
@@ -32,8 +43,15 @@
// Search subdirectories for the application
NSString *currentFile,
*newAppDownloadPath = nil,
*bundleFileName = [[host bundlePath] lastPathComponent],
*alternateBundleFileName = [[host name] stringByAppendingPathExtension:[[host bundlePath] pathExtension]];
*bundleExtension = [[host bundlePath] pathExtension];
NSOrderedSet<NSString *> *hostNames = [host infoDictionaryNames];
NSMutableOrderedSet<NSString *> *bundleFileNames = [NSMutableOrderedSet orderedSet];
for (NSString *hostName in hostNames) {
NSString *bundleFileName = [hostName stringByAppendingPathExtension:bundleExtension];
if (bundleFileName != nil) {
[bundleFileNames addObject:bundleFileName];
}
}
#if SPARKLE_BUILD_PACKAGE_SUPPORT
NSString *fallbackPackagePath = nil;
@@ -41,7 +59,6 @@
BOOL isGuided = YES;
#endif
NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:inUpdateFolder];
NSString *bundleFileNameNoExtension = [bundleFileName stringByDeletingPathExtension];
while ((currentFile = [dirEnum nextObject])) {
NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
@@ -78,8 +95,7 @@
NSString *currentExtension = [currentFile pathExtension];
NSString *currentFilenameNoExtension = [currentFilename stringByDeletingPathExtension];
#endif
if ([currentFilename isEqualToString:bundleFileName] ||
[currentFilename isEqualToString:alternateBundleFileName]) // We found one!
if (SUFilenameMatchesAnyName(currentFilename, bundleFileNames)) // We found one!
{
#if SPARKLE_BUILD_PACKAGE_SUPPORT
isPackage = NO;
@@ -89,7 +105,7 @@
#if SPARKLE_BUILD_PACKAGE_SUPPORT
} else if ([currentExtension isEqualToString:@"pkg"] ||
[currentExtension isEqualToString:@"mpkg"]) {
if ([currentFilenameNoExtension isEqualToString:bundleFileNameNoExtension]) {
if (SUFilenameMatchesAnyName(currentFilenameNoExtension, hostNames)) {
isPackage = YES;
newAppDownloadPath = currentPath;
break;
@@ -138,13 +154,13 @@
#endif
if (!newAppDownloadPath) {
SULog(SULogLevelError, @"Searched %@ for %@.(app%@)", inUpdateFolder, bundleFileNameNoExtension,
SULog(SULogLevelError, @"Searched %@ for {%@}.(app%@) or bundle identifier %@", inUpdateFolder, [hostNames.array componentsJoinedByString:@", "],
#if SPARKLE_BUILD_PACKAGE_SUPPORT
@"|pkg"
#else
@""
#endif
);
, host.bundle.bundleIdentifier);
}
return newAppDownloadPath;
}
+7
View File
@@ -1,3 +1,10 @@
# 2.11.0
* Add sparkle:bundleIdentifier element on appcast for signed feeds (#2954) (Zorg)
* Avoid using host bundle filename for finding bundle to update (#2953) (Zorg)
* Activate app if update check is initiated from NSStatusItem (#2950) (Niklas Wenzel)
* Update Japanese localization (#2948) (1024jp)
# 2.10.1
* Fix not trimming whitespace/newline characters from <sparkle:releaseNotesLink> (#2944) (Zorg)
+1 -1
View File
@@ -1 +1 @@
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "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 -4
View File
@@ -98,13 +98,13 @@ SPARKLE_ICON_NAME = AppIcon
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
// These variables must have a space after the '=' too
SPARKLE_VERSION_MAJOR = 2
SPARKLE_VERSION_MINOR = 10
SPARKLE_VERSION_PATCH = 1
SPARKLE_VERSION_MINOR = 11
SPARKLE_VERSION_PATCH = 0
// This should be in SemVer format or empty, ie. "-beta.1"
// These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX =
CURRENT_PROJECT_VERSION = 2065
SPARKLE_VERSION_SUFFIX = -beta.1
CURRENT_PROJECT_VERSION = 2066
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
ALWAYS_SEARCH_USER_PATHS = NO
+3 -3
View File
@@ -2,10 +2,10 @@
import PackageDescription
// Version is technically not required here, SPM doesn't check
let version = "2.10.1"
let version = "2.11.0-beta.1"
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
let tag = "2.10.1"
let checksum = "4c2e48a3e50ebcc2c88a58a4c7264a1a99c3c31857ce754357afb9cdb323022a"
let tag = "2.11.0-beta.1"
let checksum = "584825d2ca202cea34bbe6442c2c3c227030e5fd042dc1dff2b51060cf79c141"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package(
+4
View File
@@ -141,6 +141,7 @@
720E217B1D0D00BF003A311C /* SPUUpdaterCycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 720E21791D0D00BF003A311C /* SPUUpdaterCycle.h */; };
720E217C1D0D00BF003A311C /* SPUUpdaterCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 720E217A1D0D00BF003A311C /* SPUUpdaterCycle.m */; };
7210C7681B9A9A1500EB90AC /* SUUnarchiverTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */; };
7212F16330A0311500BC9C7D /* testappcast_bundleIdentifiers.xml in Resources */ = {isa = PBXBuildFile; fileRef = 7210219630A0311500CA3DBD /* testappcast_bundleIdentifiers.xml */; };
72162B081C82C9600013C1C5 /* SULocalizations.h in Headers */ = {isa = PBXBuildFile; fileRef = 72162B071C82C9600013C1C5 /* SULocalizations.h */; };
721BC20E1D1CDE55002BC71E /* SPULocalCacheDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = 721BC20C1D1CDE55002BC71E /* SPULocalCacheDirectory.h */; };
721BC20F1D1CDE55002BC71E /* SPULocalCacheDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = 721BC20D1D1CDE55002BC71E /* SPULocalCacheDirectory.m */; };
@@ -1053,6 +1054,7 @@
720DC50527A62CDC00DFF3EC /* testappcast_minimumAutoupdateVersionSkipping2.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast_minimumAutoupdateVersionSkipping2.xml; sourceTree = "<group>"; };
720E21791D0D00BF003A311C /* SPUUpdaterCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUUpdaterCycle.h; sourceTree = "<group>"; };
720E217A1D0D00BF003A311C /* SPUUpdaterCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUUpdaterCycle.m; sourceTree = "<group>"; };
7210219630A0311500CA3DBD /* testappcast_bundleIdentifiers.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = testappcast_bundleIdentifiers.xml; sourceTree = "<group>"; };
7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUUnarchiverTest.swift; sourceTree = "<group>"; };
7214B8851D45AD9A00CB5CED /* SPUInstallationType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUInstallationType.h; sourceTree = "<group>"; };
72162B071C82C9600013C1C5 /* SULocalizations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SULocalizations.h; sourceTree = "<group>"; };
@@ -1853,6 +1855,7 @@
725EA4B13027D2AF0041BFA6 /* test-package-update.xml */,
72C56E212F04C28B0005A484 /* testreleasenotes.html */,
5A5DD40324958AFF0045EB3E /* SUUpdateValidatorTest */,
7210219630A0311500CA3DBD /* testappcast_bundleIdentifiers.xml */,
);
path = Resources;
sourceTree = "<group>";
@@ -3175,6 +3178,7 @@
72CCDEBE27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip in Resources */,
726FC0362C1E787A00177986 /* SparkleTestCodeSignApp.aar in Resources */,
722545B626805FF80036465C /* testappcast_info_updates.xml in Resources */,
7212F16330A0311500BC9C7D /* testappcast_bundleIdentifiers.xml in Resources */,
723414172EBFB482009727E0 /* testappcast_arm64HardwareRequirement.xml in Resources */,
7202DC9A269ABD3500737EC4 /* testappcast_phasedRollout.xml in Resources */,
72C6F2DB303BE56100D39EF2 /* SparkleTestCodeSignApp.license.no-text.dmg in Resources */,
@@ -87,7 +87,7 @@ static NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *const S
@"Updating %@": @"Aggiornamento di %@",
},
@"ja": @{
@"Cancel Update": @"アップデートを中止",
@"Cancel Update": @"アップデートをキャンセル",
@"Installing update…": @"アップデートをインストールしています…",
@"Updating %@": @"%@をアップデート中",
},
+4 -3
View File
@@ -549,9 +549,10 @@
[_checkingController beginActionWithTitle:SULocalizedStringFromTableInBundle(@"Checking for updates…", SPARKLE_TABLE, sparkleBundle, nil) maxProgressValue:0.0 statusText:nil];
[_checkingController setButtonTitle:SULocalizedStringFromTableInBundle(@"Cancel", SPARKLE_TABLE, sparkleBundle, nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO accessibilityIdentifier:@"SUStatusCancel"];
// For background applications, obtain focus.
// Useful if the update check is requested from another app like System Preferences.
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
// Obtain focus. Useful if:
// - The update check is requested from another app (e.g. System Preferences)
// - The user triggers the update check from an NSStatusItem (which does not activate the app)
if (![NSApp isActive]) {
[self _activateApplication];
}
+14 -1
View File
@@ -78,6 +78,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
BOOL _loggedATSWarning;
BOOL _loggedNoSecureKeyWarning;
BOOL _loggedUpdateSecurityPolicyWarning;
BOOL _loggedFeedBundleIdentifierWarning;
BOOL _updatingMainBundle;
}
@@ -380,14 +381,26 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
return NO;
}
} else if (_host.requiresFeedBundleIdentifier) {
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInvalidUpdaterError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"For security reasons, %@ needs to also be enabled if %@ is enabled for %@. Visit Sparkle's documentation for more information: https://sparkle-project.org/documentation/customization/", SURequireSignedFeedKey, SURequireFeedBundleIdentifierKey, hostName] }];
}
return NO;
}
if (_updatingMainBundle) {
if (!_loggedUpdateSecurityPolicyWarning && mainBundleHost.hasUpdateSecurityPolicy) {
SULog(SULogLevelDefault, @"Warning: %@ has a custom NSUpdateSecurityPolicy in its Info.plist. This may cause issues when installing updates. Please consider removing this key for your builds using Sparkle if you do not really require a custom update security policy.", hostName);
_loggedUpdateSecurityPolicyWarning = YES;
}
if (!_loggedFeedBundleIdentifierWarning && requiresSignedFeed && ![_host boolForInfoDictionaryKey:SURequireFeedBundleIdentifierKey]) {
SULog(SULogLevelDefault, @"Warning: %@ is enabled but %@ is not enabled for %@. For increased security, please consider enabling %@ and adding a %@ element to your signed feed. Visit Sparkle's documentation for more information: https://sparkle-project.org/documentation/#3-segue-for-security-concerns.", SURequireSignedFeedKey, SURequireFeedBundleIdentifierKey, hostName, SURequireFeedBundleIdentifierKey, SUAppcastElementBundleIdentifier);
_loggedFeedBundleIdentifierWarning = YES;
}
}
return YES;
+2
View File
@@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
- (SUAppcast *)copyByFilteringItems:(BOOL (^)(SUAppcastItem *))filterBlock;
@property (readonly, nonatomic, copy) NSSet<NSString *> *bundleIdentifiers;
@end
NS_ASSUME_NONNULL_END
+24
View File
@@ -21,10 +21,17 @@
#include "AppKitPrevention.h"
@interface SUAppcast ()
@property (readonly, nonatomic, copy) NSSet<NSString *> *bundleIdentifiers;
@end
@implementation SUAppcast
@synthesize items = _items;
@synthesize signingValidationStatus = _signingValidationStatus;
@synthesize bundleIdentifiers = _bundleIdentifiers;
- (nullable instancetype)initWithXMLData:(NSData *)xmlData relativeToURL:(NSURL * _Nullable)relativeURL stateResolver:(SPUAppcastItemStateResolver *)stateResolver signingValidationStatus:(SPUAppcastSigningValidationStatus)signingValidationStatus error:(NSError * __autoreleasing *)error
{
@@ -86,6 +93,22 @@
return nil;
}
NSArray *channelNodes = [document nodesForXPath:@"/rss/channel/*" error:errorp];
if (nil == channelNodes) {
return nil;
}
NSMutableSet<NSString *> *bundleIdentifiers = [NSMutableSet set];
for (NSXMLNode *channelNode in channelNodes) {
if ([[self sparkleNamespacedNameOfNode:channelNode] isEqualToString:SUAppcastElementBundleIdentifier]) {
NSString *bundleIdentifier = [channelNode.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
if (bundleIdentifier.length > 0) {
[bundleIdentifiers addObject:bundleIdentifier];
}
}
}
_bundleIdentifiers = [bundleIdentifiers copy];
NSArray *xmlItems = [document nodesForXPath:@"/rss/channel/item" error:errorp];
if (nil == xmlItems) {
return nil;
@@ -288,6 +311,7 @@
other->_items = newItems;
other->_signingValidationStatus = _signingValidationStatus;
other->_bundleIdentifiers = _bundleIdentifiers;
return other;
}
+12 -1
View File
@@ -195,7 +195,18 @@
return;
}
if (appcastSigningValidationStatus == SPUAppcastSigningValidationStatusSucceeded && _host.requiresFeedBundleIdentifier) {
NSString *hostBundleIdentifier = _host.bundle.bundleIdentifier;
if (hostBundleIdentifier == nil || ![loadedAppcast.bundleIdentifiers containsObject:hostBundleIdentifier]) {
NSError *bundleIdentifierError = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"The update feed is rejected because %@ is enabled and no %@ element in the feed matches the bundle identifier %@.", SURequireFeedBundleIdentifierKey, SUAppcastElementBundleIdentifier, hostBundleIdentifier] }];
[delegate didFailToFetchAppcastWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:@{ NSLocalizedDescriptionKey: SULocalizedStringFromTableInBundle(@"An error occurred while parsing the update feed.", SPARKLE_TABLE, SUSparkleBundle(), nil), NSUnderlyingErrorKey: bundleIdentifierError }]];
return;
}
}
// Now process the loaded appcast and find a suitable update item
[delegate didFinishLoadingAppcast:loadedAppcast];
+2
View File
@@ -47,6 +47,7 @@ extern NSString *const SUPublicDSAKeyKey;
extern NSString *const SUPublicDSAKeyFileKey;
extern NSString *const SUPublicEDKeyKey;
extern NSString *const SURequireSignedFeedKey;
extern NSString *const SURequireFeedBundleIdentifierKey;
extern NSString *const SUVerifyUpdateBeforeExtractionKey;
extern NSString *const SUAutomaticallyUpdateKey;
extern NSString *const SUAllowsAutomaticUpdatesKey;
@@ -82,6 +83,7 @@ extern NSString *const SUAppcastAttributeLength;
extern NSString *const SUAppcastElementVersion;
extern NSString *const SUAppcastElementShortVersionString;
extern NSString *const SUAppcastElementBundleIdentifier;
extern NSString *const SUAppcastElementCriticalUpdate;
extern NSString *const SUAppcastElementDeltas;
extern NSString *const SUAppcastElementMinimumAutoupdateVersion;
+2
View File
@@ -34,6 +34,7 @@ NSString *const SUPublicDSAKeyKey = @"SUPublicDSAKey";
NSString *const SUPublicDSAKeyFileKey = @"SUPublicDSAKeyFile";
NSString *const SUPublicEDKeyKey = @"SUPublicEDKey";
NSString *const SURequireSignedFeedKey = @"SURequireSignedFeed";
NSString *const SURequireFeedBundleIdentifierKey = @"SURequireFeedBundleIdentifier";
NSString *const SUVerifyUpdateBeforeExtractionKey = @"SUVerifyUpdateBeforeExtraction";
NSString *const SUAutomaticallyUpdateKey = @"SUAutomaticallyUpdate";
NSString *const SUAllowsAutomaticUpdatesKey = @"SUAllowsAutomaticUpdates";
@@ -71,6 +72,7 @@ NSString *const SUAppcastAttributeLength = @"sparkle:length";
NSString *const SUAppcastElementVersion = SUAppcastAttributeVersion;
NSString *const SUAppcastElementShortVersionString = SUAppcastAttributeShortVersionString;
NSString *const SUAppcastElementBundleIdentifier = @"sparkle:bundleIdentifier";
NSString *const SUAppcastElementCriticalUpdate = @"sparkle:criticalUpdate";
NSString *const SUAppcastElementDeltas = @"sparkle:deltas";
NSString *const SUAppcastElementMinimumAutoupdateVersion = @"sparkle:minimumAutoupdateVersion";
+2
View File
@@ -28,6 +28,7 @@ SUHostDefinitionAttribute
@property (readonly, nonatomic, copy) NSString *bundlePath;
@property (readonly, nonatomic, copy) NSString *name;
@property (readonly, nonatomic, copy) NSOrderedSet<NSString *> *infoDictionaryNames;
@property (readonly, nonatomic, copy) NSString *version;
@property (readonly, nonatomic) BOOL validVersion;
@property (readonly, nonatomic, copy) NSString *displayVersion;
@@ -39,6 +40,7 @@ SUHostDefinitionAttribute
@property (nonatomic, readonly) BOOL hasUpdateSecurityPolicy;
@property (nonatomic, readonly) BOOL requiresSignedAppcast;
@property (nonatomic, readonly) BOOL requiresFeedBundleIdentifier;
- (nullable id)objectForInfoDictionaryKey:(NSString *)key ofClass:(Class)aClass;
- (nullable NSNumber *)boolNumberForInfoDictionaryKey:(NSString *)key;
+31 -11
View File
@@ -118,19 +118,34 @@ static void *SUHostObservableContext = &SUHostObservableContext;
return _bundle.bundlePath;
}
- (NSOrderedSet<NSString *> *)infoDictionaryNamesStoppingAtFirstMatch:(BOOL)stopAtFirstMatch SPU_OBJC_DIRECT
{
NSMutableOrderedSet<NSString *> *names = [NSMutableOrderedSet orderedSet];
// Allow host bundle to provide a custom name
for (NSString *key in @[@"SUBundleName", @"CFBundleDisplayName", (__bridge NSString *)kCFBundleNameKey]) {
NSString *name = [self objectForInfoDictionaryKey:key ofClass:NSString.class];
if (name.length > 0) {
[names addObject:name];
if (stopAtFirstMatch) {
break;
}
}
}
return [names copy];
}
- (NSOrderedSet<NSString *> *)infoDictionaryNames
{
return [self infoDictionaryNamesStoppingAtFirstMatch:NO];
}
- (NSString * _Nonnull)name
{
NSString *name;
// Allow host bundle to provide a custom name
name = [self objectForInfoDictionaryKey:@"SUBundleName" ofClass:NSString.class];
if (name && name.length > 0) return name;
name = [self objectForInfoDictionaryKey:@"CFBundleDisplayName" ofClass:NSString.class];
if (name && name.length > 0) return name;
name = [self objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey ofClass:NSString.class];
if (name && name.length > 0) return name;
NSString *name = [self infoDictionaryNamesStoppingAtFirstMatch:YES].firstObject;
if (name != nil) {
return name;
}
return [[[NSFileManager defaultManager] displayNameAtPath:[self bundlePath]] stringByDeletingPathExtension];
}
@@ -231,6 +246,11 @@ static void *SUHostObservableContext = &SUHostObservableContext;
return [self boolForInfoDictionaryKey:SURequireSignedFeedKey];
}
- (BOOL)requiresFeedBundleIdentifier
{
return [self boolForInfoDictionaryKey:SURequireFeedBundleIdentifierKey];
}
- (SUPublicKeys *)publicKeys
{
return [[SUPublicKeys alloc] initWithEd:[self publicEDKey]
+39 -21
View File
@@ -37,6 +37,9 @@
/* No comment provided by engineer. */
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@が入手可能ですが、インストールするにはmacOSのバージョンが古すぎます。macOS %3$@以降が必要です。";
/* Mac is too old and update requires Apple silicon Mac */
"%1$@ %2$@ is available but this update requires a new Apple silicon Mac." = "%1$@ %2$@が入手可能ですが、このアップデートにはApple silicon搭載の新しいMacが必要です。";
/* No comment provided by engineer. */
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "この場所ではダウンロードされたアップデートを%1$@に適用できません。";
@@ -50,28 +53,31 @@
"A new version of %@ is ready to install!" = "新しいバージョンの%@が今すぐインストールできます!";
/* No comment provided by engineer. */
"An error occurred in retrieving update information. Please try again later." = "アップデート情報の取得中にエラーが発生しました。あとでやり直してください。";
"An error occurred in retrieving update information. Please try again later." = "アップデート情報の取得中にエラーが起きました。あとでやり直してください。";
/* No comment provided by engineer. */
"An error occurred while connecting to the installer. Please try again later." = "インストーラに接続中にエラーが発生しました。あとでやり直してください。";
"An error occurred while connecting to the installer. Please try again later." = "インストーラに接続中にエラーが起きました。あとでやり直してください。";
/* No comment provided by engineer. */
"An error occurred while downloading the update. Please try again later." = "アップデートをダウンロード中にエラーが発生しました。あとでやり直してください。";
"An error occurred while downloading the update. Please try again later." = "アップデートをダウンロード中にエラーが起きました。あとでやり直してください。";
/* No comment provided by engineer. */
"An error occurred while extracting the archive. Please try again later." = "アーカイブの展開中にエラーが発生しました。あとでやり直してください。";
"An error occurred while downloading the release notes." = "リリースノートのダウンロード中にエラーが起きました。";
/* No comment provided by engineer. */
"An error occurred while launching the installer. Please try again later." = "インストーラを起動中にエラーが発生しました。あとでやり直してください。";
"An error occurred while extracting the archive. Please try again later." = "アーカイブの展開中にエラーが起きました。あとでやり直してください。";
/* No comment provided by engineer. */
"An error occurred while parsing the update feed." = "アップデートフィードを解析中にエラーが発生しました。";
"An error occurred while launching the installer. Please try again later." = "インストーラを起動中にエラーが起きました。あとでやり直してください。";
/* No comment provided by engineer. */
"An error occurred while running the updater. Please try again later." = "アップデータを実行中にエラーが発生しました。あとでやり直してください。";
"An error occurred while parsing the update feed." = "アップデートフィードを解析中にエラーが起きました。";
/* No comment provided by engineer. */
"An error occurred while starting the installer. Please try again later." = "インストーラを始動中にエラーが発生しました。あとでやり直してください。";
"An error occurred while running the updater. Please try again later." = "アップデータを実行中にエラーが起きました。あとでやり直してください。";
/* No comment provided by engineer. */
"An error occurred while starting the installer. Please try again later." = "インストーラを始動中にエラーが起きました。あとでやり直してください。";
/* No comment provided by engineer. */
"An important update to %@ is ready to install" = "%@の重要なアップデートがインストールできます。";
@@ -86,13 +92,13 @@
"Cancel" = "キャンセル";
/* Run generate_progress_tool_localizations.py after updating. */
"Cancel Update" = "アップデートを中止";
"Cancel Update" = "アップデートをキャンセル";
/* No comment provided by engineer. */
"Checking for updates…" = "アップデートを確認しています…";
"Checking for updates…" = "アップデートを確認中…";
/* No comment provided by engineer. */
"CPU is 64-Bit?" = "CPUは64-Bit?";
"CPU is 64-Bit?" = "CPUは64ビット?";
/* No comment provided by engineer. */
"CPU Speed (MHz)" = "CPUスピード (MHz)";
@@ -104,10 +110,10 @@
"CPU Type" = "CPUタイプ";
/* Take care not to overflow the status window. */
"Downloading update…" = "アップデートをダウンロードしています…";
"Downloading update…" = "アップデートをダウンロード中…";
/* Take care not to overflow the status window. */
"Extracting update…" = "アップデートを展開しています…";
"Extracting update…" = "アップデートを抽出中…";
/* No comment provided by engineer. */
"Failed to resume installing update." = "アップデートのインストール再開に失敗しました。";
@@ -146,7 +152,7 @@
"Preferred Language" = "優先する言語";
/* No comment provided by engineer. */
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "%1$@を終了させ、アプリケーションフォルダに移動の上再度お試しください。";
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "%1$@を終了させ、アプリケーションフォルダに移動してからやり直してください。";
/* No comment provided by engineer. */
"Ready to Install" = "インストールできます";
@@ -158,22 +164,31 @@
"The installation failed due to not having permission to write the new update." = "新しいアップデートを書き込むアクセス権がないためインストールできませんでした。";
/* No comment provided by engineer. */
"The update is improperly signed and could not be validated. Please try again later or contact the app developer." = "アップデートの署名が不適切で認証できませんでした。あとでやり直すかアプリケーション開発者に連絡してください。";
"The updater failed to start. Please verify you have the latest version of %@ and contact the app developer if the issue still persists. Check the Console logs for more information." = "アップデータを起動できませんでした。%@が最新バージョンであることを確認し、それでも問題が解決しない場合はアプリの開発者に連絡してください。詳しくはコンソールログを確認してください。";
/* No comment provided by engineer. */
"Unable to Check For Updates" = "アップデートを確認できませんでした";
"The update is improperly signed and could not be validated. Please try again later or contact the app developer." = "アップデートの署名が正しくないため検証できませんでした。あとでやり直すか、アプリの開発者に連絡してください。";
/* No comment provided by engineer. */
"The update feed is improperly signed and could not be validated. Please try again later or contact the app developer." = "アップデートフィードの署名が正しくないため検証できませんでした。あとでやり直すか、アプリの開発者に連絡してください。";
/* No comment provided by engineer. */
"The release notes is improperly signed and could not be validated. Please contact the app developer for more information." = "リリースノートの署名が正しくないため検証できませんでした。詳しくはアプリの開発者に連絡してください。";
/* No comment provided by engineer. */
"Unable to Check For Updates" = "アップデートを確認できません";
/* No comment provided by engineer. */
"Update Error!" = "アップデートエラー!";
/* No comment provided by engineer. */
"Update Installed" = "アップデートがインストールされました";
"Update Installed" = "インストール完了";
/* Run generate_progress_tool_localizations.py after updating. */
"Updating %@" = "%@をアップデート中";
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@をアプリケーションフォルダに移動し、そこから再起動したあとやり直してください。";
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Finderで%1$@をアプリケーションフォルダに移動し、そこから再起動したあとやり直してください。";
/* No comment provided by engineer. */
"Version History" = "バージョン履歴";
@@ -190,23 +205,26 @@
/* No comment provided by engineer. */
"Your macOS version is too old" = "このmacOSのバージョンは古すぎます";
/* Mac is too old and update requires newer hardware */
"Your Mac is too old" = "このMacは古すぎます";
/* 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!" = "最新版を使用しています!";
/* Software Update title/label */
"Software Update" = "ソフトウェア・アップデート";
"Software Update" = "ソフトウェアアップデート";
/* Remind Me Later choice for update alert */
"Remind Me Later" = "あとで通知";
/* Skip This Version choice for update alert */
"Skip This Version" = "このバージョンはスキップ";
"Skip This Version" = "このバージョンをスキップ";
/* Install Update choice for update alert */
"Install Update" = "アップデートをインストール";
/* Automatically download and install updates in the future option for update alert */
"Automatically download and install updates in the future" = "今後はアップデートのダウンロードとインストールを自動で行う";
"Automatically download and install updates in the future" = "今後はアップデートを自動でダウンロードしてインストール";
/* Check for updates automatically response for update permission dialog */
"Check Automatically" = "自動で確認";
@@ -36,6 +36,8 @@
<true/>
<key>SURequireSignedFeed</key>
<true/>
<key>SURequireFeedBundleIdentifier</key>
<true/>
<key>SUVerifyUpdateBeforeExtraction</key>
<true/>
<key>_SUEnableDebugUpdateCheckIntervals</key>
+1
View File
@@ -7,6 +7,7 @@ IMPORTANT: This file must be re-signed if modifications are made to this file! T
<title>Sparkle Test App Changelog</title>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<sparkle:bundleIdentifier>org.sparkle-project.SparkleTestApp</sparkle:bundleIdentifier>
<item>
<title>Version 2.2</title>
<sparkle:version>2.2</sparkle:version>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Both</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CodeSignedBoth</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -13,10 +13,6 @@
<dict>
<key>Resources/test-pubkey.pem</key>
<dict>
<key>hash</key>
<data>
pR1EGsp5nhk1vr/xfQPT8es9ZBw=
</data>
<key>hash2</key>
<data>
zD/XQJu4ElPWE6sfqtzoR2vEjdfgi98j/hiRoYZqv9w=
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CodeSignedBothNew</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -13,10 +13,6 @@
<dict>
<key>Resources/test-pubkey.pem</key>
<dict>
<key>hash</key>
<data>
pR1EGsp5nhk1vr/xfQPT8es9ZBw=
</data>
<key>hash2</key>
<data>
zD/XQJu4ElPWE6sfqtzoR2vEjdfgi98j/hiRoYZqv9w=
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CodeSignedInvalid</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CodeSignedInvalidOnly</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CodeSignedOldED</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CodeSignedOnly</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CodeSignedOnlyNew</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>DSAOnly</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>EDOnly</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>None</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<title>Test</title>
<sparkle:bundleIdentifier>com.example.first</sparkle:bundleIdentifier>
<sparkle:bundleIdentifier>
com.example.second
</sparkle:bundleIdentifier>
<sparkle:bundleIdentifier></sparkle:bundleIdentifier>
<item>
<title>Version 2.0</title>
<enclosure url="http://example.com/test.zip" sparkle:version="2.0" length="1" type="application/octet-stream" sparkle:edSignature="test" />
</item>
</channel>
</rss>
+21
View File
@@ -1208,4 +1208,25 @@ class SUAppcastTest: XCTestCase {
XCTFail("Appcast creation should have passed, dropping only the rejected package item")
}
}
func testParseAppcastBundleIdentifiers() throws {
let versionComparator = SUStandardVersionComparator.default
let stateResolver = SPUAppcastItemStateResolver(hostVersion: "1.0", applicationVersionComparator: versionComparator, standardVersionComparator: versionComparator)
let testURL = Bundle(for: SUAppcastTest.self).url(forResource: "testappcast_bundleIdentifiers", withExtension: "xml")!
let testData = try Data(contentsOf: testURL)
let appcast = try SUAppcast(xmlData: testData, relativeTo: nil, stateResolver: stateResolver, signingValidationStatus: .succeeded)
XCTAssertEqual(appcast.bundleIdentifiers, ["com.example.first", "com.example.second"])
XCTAssertEqual(appcast.items.count, 1)
let filteredAppcast = appcast.copy(byFilteringItems: { _ in false })
XCTAssertEqual(filteredAppcast.bundleIdentifiers, ["com.example.first", "com.example.second"])
let testURLWithoutBundleIdentifiers = Bundle(for: SUAppcastTest.self).url(forResource: "testappcast", withExtension: "xml")!
let testDataWithoutBundleIdentifiers = try Data(contentsOf: testURLWithoutBundleIdentifiers)
let appcastWithoutBundleIdentifiers = try SUAppcast(xmlData: testDataWithoutBundleIdentifiers, relativeTo: nil, stateResolver: stateResolver, signingValidationStatus: .succeeded)
XCTAssertEqual(appcastWithoutBundleIdentifiers.bundleIdentifiers, [])
}
}
+4 -1
View File
@@ -78,6 +78,7 @@ class ArchiveItem: CustomStringConvertible {
let publicEdKey: Data?
let supportsDSA: Bool
let requiresSignedAppcast: Bool
let bundleIdentifier: String?
let archiveFileAttributes: [FileAttributeKey: Any]
var deltas: [DeltaUpdate]
@@ -174,11 +175,12 @@ class ArchiveItem: CustomStringConvertible {
}
}
init(version: String, shortVersion: String?, feedURL: URL?, requiresSignedAppcast: Bool, minimumSystemVersion: String?, hardwareRequirements: String?, frameworkVersion: String?, sparkleExecutableFileSize: Int?, sparkleLocales: String?, publicEdKey: String?, supportsDSA: Bool, appPath: URL, archivePath: URL) throws {
init(version: String, shortVersion: String?, feedURL: URL?, requiresSignedAppcast: Bool, bundleIdentifier: String?, minimumSystemVersion: String?, hardwareRequirements: String?, frameworkVersion: String?, sparkleExecutableFileSize: Int?, sparkleLocales: String?, publicEdKey: String?, supportsDSA: Bool, appPath: URL, archivePath: URL) throws {
self.version = version
self._shortVersion = shortVersion
self.feedURL = feedURL
self.requiresSignedAppcast = requiresSignedAppcast
self.bundleIdentifier = bundleIdentifier
self.minimumSystemVersion = minimumSystemVersion ?? "12.0"
self.hardwareRequirements = hardwareRequirements
self.frameworkVersion = frameworkVersion
@@ -369,6 +371,7 @@ class ArchiveItem: CustomStringConvertible {
shortVersion: shortVersion,
feedURL: feedURL,
requiresSignedAppcast: requiresSignedAppcast,
bundleIdentifier: infoPlist[kCFBundleIdentifierKey as String] as? String,
minimumSystemVersion: minimumSystemVersion,
hardwareRequirements: hardwareRequirements,
frameworkVersion: frameworkVersion,
+14 -1
View File
@@ -311,7 +311,20 @@ func writeAppcast(appcastDestPath: URL, keys: PrivateKeys, disableEmbeddedSignWa
requiresSignedAppcast = requiresSignedAppcastFromArchives
}
if requiresSignedAppcast && keys.publicEdKey != nil && keys.privateEdKey != nil {
let existingBundleIdentifiers = Set(channel.elements(forName: SUAppcastElementBundleIdentifier).compactMap({ $0.stringValue?.trimmingCharacters(in: .whitespacesAndNewlines) }))
let archiveBundleIdentifiers = Set(appcast.versionsInFeed.compactMap({ appcast.archives[$0]?.bundleIdentifier }))
var bundleIdentifierIndex = try channel.nodes(forXPath: "item").first?.index ?? channel.childCount
for bundleIdentifier in archiveBundleIdentifiers.subtracting(existingBundleIdentifiers).sorted() {
let bundleIdentifierElement = XMLElement.element(withName: SUAppcastElementBundleIdentifier, uri: sparkleNS) as! XMLElement
bundleIdentifierElement.setChildren([text(bundleIdentifier)])
channel.insertChild(bundleIdentifierElement, at: bundleIdentifierIndex)
bundleIdentifierIndex += 1
}
}
// Keep track of already signed release note files so we avoid
// re-signing the same file in case the developer is using symlinks
// Path -> [(EdSignature, Length)]