From de9be8b4810d0aa829dd2373145282a520604d67 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Wed, 23 Jul 2008 22:49:47 -0700 Subject: [PATCH] Fixes 244428 Removed all Cocoa categories from Sparkle by integrating things into other classes or making categories on existing Sparkle classes. Whoo! --- NSFileManager+Aliases.h | 18 --- NSFileManager+Aliases.m | 33 ------ NSFileManager+Authentication.h | 16 --- NSFileManager+ExtendedAttributes.h | 53 --------- NSFileManager+ExtendedAttributes.m | 98 ---------------- NSWorkspace+SystemVersion.h | 18 --- NSWorkspace+SystemVersion.m | 36 ------ SUBasicUpdateDriver.m | 6 +- ...eManager+Verification.h => SUDSAVerifier.h | 10 +- ...eManager+Verification.m => SUDSAVerifier.m | 9 +- SUHost.h | 2 + SUHost.m | 24 ++++ SUInstaller.m | 22 +++- SUPlainInstaller.h | 1 + SUPlainInstaller.m | 3 +- SUPlainInstallerInternals.h | 18 +++ ...ntication.m => SUPlainInstallerInternals.m | 110 ++++++++++++++++-- SUSystemProfiler.m | 2 +- Sparkle.h | 6 - Sparkle.xcodeproj/project.pbxproj | 82 ++++++------- 20 files changed, 219 insertions(+), 348 deletions(-) delete mode 100644 NSFileManager+Aliases.h delete mode 100644 NSFileManager+Aliases.m delete mode 100644 NSFileManager+Authentication.h delete mode 100644 NSFileManager+ExtendedAttributes.h delete mode 100644 NSFileManager+ExtendedAttributes.m delete mode 100644 NSWorkspace+SystemVersion.h delete mode 100644 NSWorkspace+SystemVersion.m rename NSFileManager+Verification.h => SUDSAVerifier.h (50%) rename NSFileManager+Verification.m => SUDSAVerifier.m (95%) create mode 100644 SUPlainInstallerInternals.h rename NSFileManager+Authentication.m => SUPlainInstallerInternals.m (69%) diff --git a/NSFileManager+Aliases.h b/NSFileManager+Aliases.h deleted file mode 100644 index 673b12b3..00000000 --- a/NSFileManager+Aliases.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// NSFileManager+Aliases.h -// Sparkle -// -// Created by Andy Matuschak on 2/4/08. -// Copyright 2008 Andy Matuschak. All rights reserved. -// - -#ifndef NSFILEMANAGER_PLUS_ALIASES_H -#define NSFILEMANAGER_PLUS_ALIASES_H - -#import - -@interface NSFileManager (SUAliases) -- (BOOL)isAliasFolderAtPath:(NSString *)path; -@end - -#endif diff --git a/NSFileManager+Aliases.m b/NSFileManager+Aliases.m deleted file mode 100644 index 9b2ab411..00000000 --- a/NSFileManager+Aliases.m +++ /dev/null @@ -1,33 +0,0 @@ -// -// NSFileManager+Aliases.m -// Sparkle -// -// Created by Andy Matuschak on 2/4/08. -// Copyright 2008 Andy Matuschak. All rights reserved. -// - -#import "NSFileManager+Aliases.h" - - -@implementation NSFileManager (SUAliases) - -- (BOOL)isAliasFolderAtPath:(NSString *)path -{ - FSRef fileRef; - OSStatus err = noErr; - Boolean aliasFileFlag, folderFlag; - NSURL *fileURL = [NSURL fileURLWithPath:path]; - - if (FALSE == CFURLGetFSRef((CFURLRef)fileURL, &fileRef)) - err = coreFoundationUnknownErr; - - if (noErr == err) - err = FSIsAliasFile(&fileRef, &aliasFileFlag, &folderFlag); - - if (noErr == err) - return (BOOL)(aliasFileFlag && folderFlag); - else - return NO; -} - -@end diff --git a/NSFileManager+Authentication.h b/NSFileManager+Authentication.h deleted file mode 100644 index 80b91a9b..00000000 --- a/NSFileManager+Authentication.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSFileManager+Authentication.m -// Sparkle -// -// Created by Andy Matuschak on 3/9/06. -// Copyright 2006 Andy Matuschak. All rights reserved. -// - -#ifndef NSFILEMANAGER_PLUS_AUTHENTICATION_H -#define NSFILEMANAGER_PLUS_AUTHENTICATION_H - -@interface NSFileManager (SUAuthenticationAdditions) -- (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error; -@end - -#endif diff --git a/NSFileManager+ExtendedAttributes.h b/NSFileManager+ExtendedAttributes.h deleted file mode 100644 index 6744ce0b..00000000 --- a/NSFileManager+ExtendedAttributes.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// NSFileManager+ExtendedAttributes.h -// Sparkle -// -// Created by Mark Mentovai on 2008-01-22. -// Copyright 2008 Mark Mentovai. All rights reserved. -// - -#ifndef NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES -#define NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES - -#import - -@interface NSFileManager (MMExtendedAttributes) - -// Wraps the removexattr system call, allowing an AppKit-style NSString* to -// be used for the pathname argument. Note that the order of the arguments -// has changed from what removexattr accepts, so that code reads more -// naturally. -// -// removexattr is only available on Mac OS X 10.4 ("Tiger") and later. If -// built with an SDK that includes removexattr, this method will link against -// removexattr directly. When using earlier SDKs, this method will dynamically -// look up the removexattr symbol at runtime. If the symbol is not present, -// as will be the case when running on 10.3, this method returns -1 and sets -// errno to ENOSYS. -- (int)removeXAttr:(const char*)name - fromFile:(NSString*)file - options:(int)options; - -// Removes the directory tree rooted at |root| from the file quarantine. -// The quarantine was introduced on Mac OS X 10.5 and is described at: -// -// http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html -//#apple_ref/doc/uid/TP40001369-DontLinkElementID_2 -// -// If |root| is not a directory, then it alone is removed from the quarantine. -// Symbolic links, including |root| if it is a symbolic link, will not be -// traversed. -// -// Ordinarily, the quarantine is managed by calling LSSetItemAttribute -// to set the kLSItemQuarantineProperties attribute to a dictionary specifying -// the quarantine properties to be applied. However, it does not appear to be -// possible to remove an item from the quarantine directly through any public -// Launch Services calls. Instead, this method takes advantage of the fact -// that the quarantine is implemented in part by setting an extended attribute, -// "com.apple.quarantine", on affected files. Removing this attribute is -// sufficient to remove files from the quarantine. -- (void)releaseFromQuarantine:(NSString*)root; - -@end - -#endif diff --git a/NSFileManager+ExtendedAttributes.m b/NSFileManager+ExtendedAttributes.m deleted file mode 100644 index 4a2c3d86..00000000 --- a/NSFileManager+ExtendedAttributes.m +++ /dev/null @@ -1,98 +0,0 @@ -// -// NSFileManager+ExtendedAttributes.m -// Sparkle -// -// Created by Mark Mentovai on 2008-01-22. -// Copyright 2008 Mark Mentovai. All rights reserved. -// - -#import "NSFileManager+ExtendedAttributes.h" - -#include -#include - -// Extended attribute support was introduced in Mac OS X 10.4 ("Tiger"). -// If building with an earlier SDK, provide definitions needed to handle -// extended attributes at runtime. -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 // SDK >= 10.4 -#include -#else // SDK >= 10.4 -#define XATTR_NOFOLLOW 1 -#endif // SDK >= 10.4 - -@implementation NSFileManager (MMExtendedAttributes) - -- (int)removeXAttr:(const char*)name - fromFile:(NSString*)file - options:(int)options -{ - typedef int (*removexattr_type)(const char*, const char*, int); -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 // SDK >= 10.4 - // Reference removexattr directly, it's in the SDK. - static removexattr_type removexattr_func = removexattr; -#else // SDK >= 10.4 - // removexattr isn't in this SDK, look it up at runtime. - static removexattr_type removexattr_func = NULL; - static BOOL didSymbolLookup = NO; - if (!didSymbolLookup) { - didSymbolLookup = YES; - removexattr_func = dlsym(RTLD_NEXT, "removexattr"); - } -#endif // SDK >= 10.4 - -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 // DT < 10.4 - // Make sure that the symbol is present. This checks the deployment - // target instead of the SDK so that it's able to catch dlsym failures - // as well as the null symbol that would result from building with the - // 10.4 SDK and a lower deployment target, and running on 10.3. - if (!removexattr_func) { - errno = ENOSYS; - return -1; - } -#endif // DT < 10.4 - - const char* path = NULL; - @try { - path = [file fileSystemRepresentation]; - } - @catch (id exception) { - // -[NSString fileSystemRepresentation] throws an exception if it's - // unable to convert the string to something suitable. Map that to - // EDOM, "argument out of domain", which sort of conveys that there - // was a conversion failure. - errno = EDOM; - return -1; - } - - return removexattr_func(path, name, options); -} - -- (void)releaseFromQuarantine:(NSString*)root -{ - const char* quarantineAttribute = "com.apple.quarantine"; - const int removeXAttrOptions = XATTR_NOFOLLOW; - - [self removeXAttr:quarantineAttribute - fromFile:root - options:removeXAttrOptions]; - - // Only recurse if it's actually a directory. Don't recurse into a - // root-level symbolic link. - NSDictionary* rootAttributes = - [self fileAttributesAtPath:root traverseLink:NO]; - NSString* rootType = [rootAttributes objectForKey:NSFileType]; - - if (rootType == NSFileTypeDirectory) { - // The NSDirectoryEnumerator will avoid recursing into any contained - // symbolic links, so no further type checks are needed. - NSDirectoryEnumerator* directoryEnumerator = [self enumeratorAtPath:root]; - NSString* file = nil; - while ((file = [directoryEnumerator nextObject])) { - [self removeXAttr:quarantineAttribute - fromFile:[root stringByAppendingPathComponent:file] - options:removeXAttrOptions]; - } - } -} - -@end diff --git a/NSWorkspace+SystemVersion.h b/NSWorkspace+SystemVersion.h deleted file mode 100644 index 52e81afc..00000000 --- a/NSWorkspace+SystemVersion.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// NSWorkspace+SystemVersion.h -// Sparkle -// -// Created by Andy Matuschak on 5/7/08. -// Copyright 2008 Andy Matuschak. All rights reserved. -// - -#ifndef NSWORKSPACE_PLUS_SYSTEMVERSION_H -#define NSWORKSPACE_PLUS_SYSTEMVERSION_H - -#import - -@interface NSWorkspace (SUSystemVersion) -+ (NSString *)systemVersionString; -@end - -#endif diff --git a/NSWorkspace+SystemVersion.m b/NSWorkspace+SystemVersion.m deleted file mode 100644 index 408cb872..00000000 --- a/NSWorkspace+SystemVersion.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// NSWorkspace+SystemVersion.m -// Sparkle -// -// Created by Andy Matuschak on 5/7/08. -// Copyright 2008 Andy Matuschak. All rights reserved. -// - -#import "NSWorkspace+SystemVersion.h" - - -@implementation NSWorkspace (SUSystemVersion) -+ (NSString *)systemVersionString -{ - // This returns a version string of the form X.Y.Z - // There may be a better way to deal with the problem that gestaltSystemVersionMajor - // et al. are not defined in 10.3, but this is probably good enough. - NSString* verStr = nil; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 - SInt32 major, minor, bugfix; - OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major); - OSErr err2 = Gestalt(gestaltSystemVersionMinor, &minor); - OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix); - if (!err1 && !err2 && !err3) - { - verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix]; - } - else -#endif - { - NSString *versionPlistPath = @"/System/Library/CoreServices/SystemVersion.plist"; - verStr = [[[NSDictionary dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"] retain]; - } - return verStr; -} -@end diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index 8d437a36..a9a850da 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -9,6 +9,8 @@ #import "Sparkle.h" #import "SUBasicUpdateDriver.h" +#import "SUDSAVerifier.h" + @implementation SUBasicUpdateDriver - (void)checkForUpdatesAtURL:(NSURL *)appcastURL host:(SUHost *)aHost @@ -54,7 +56,7 @@ - (BOOL)hostSupportsItem:(SUAppcastItem *)ui { if ([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) { return YES; } - return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[NSWorkspace systemVersionString]] != NSOrderedDescending; + return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedDescending; } - (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui @@ -176,7 +178,7 @@ // DSA verification, if activated by the developer if ([[host objectForInfoDictionaryKey:SUExpectsDSASignatureKey] boolValue]) { - if (![[NSFileManager defaultManager] validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[host publicDSAKey]]) + if (![SUDSAVerifier validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[host publicDSAKey]]) { [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:[NSDictionary dictionaryWithObject:@"The update is improperly signed." forKey:NSLocalizedDescriptionKey]]]; return; diff --git a/NSFileManager+Verification.h b/SUDSAVerifier.h similarity index 50% rename from NSFileManager+Verification.h rename to SUDSAVerifier.h index 9a97eacd..8043f945 100644 --- a/NSFileManager+Verification.h +++ b/SUDSAVerifier.h @@ -1,17 +1,17 @@ // -// NSFileManager+Verification.h +// SUDSAVerifier.h // Sparkle // // Created by Andy Matuschak on 3/16/06. // Copyright 2006 Andy Matuschak. All rights reserved. // -#ifndef NSFILEMANAGER_PLUS_VERIFICATION_H -#define NSFILEMANAGER_PLUS_VERIFICATION_H +#ifndef SUDSAVERIFIER_H +#define SUDSAVERIFIER_H // For the paranoid folks! -@interface NSFileManager (SUVerification) -- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString; +@interface SUDSAVerifier {} ++ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString; @end #endif diff --git a/NSFileManager+Verification.m b/SUDSAVerifier.m similarity index 95% rename from NSFileManager+Verification.m rename to SUDSAVerifier.m index 51d0a62d..e9ee03e5 100644 --- a/NSFileManager+Verification.m +++ b/SUDSAVerifier.m @@ -1,5 +1,5 @@ // -// NSFileManager+Verification.m +// SUDSAVerifier.m // Sparkle // // Created by Andy Matuschak on 3/16/06. @@ -8,8 +8,7 @@ // DSA stuff adapted from code provided by Allan Odgaard. Thanks, Allan! -#import "Sparkle.h" -#import "NSFileManager+Verification.h" +#import "SUDSAVerifier.h" #import #import @@ -102,9 +101,9 @@ EVP_PKEY* load_dsa_key(char *key) return pkey; } -@implementation NSFileManager (SUVerification) +@implementation SUDSAVerifier -- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString ++ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString { BOOL result = NO; if (!encodedSignature) { return NO; } diff --git a/SUHost.h b/SUHost.h index 24c41525..3c2b9ab1 100644 --- a/SUHost.h +++ b/SUHost.h @@ -12,6 +12,8 @@ NSBundle *bundle; } ++ (NSString *)systemVersionString; + - (id)initWithBundle:(NSBundle *)aBundle; - (NSBundle *)bundle; - (NSString *)bundlePath; diff --git a/SUHost.m b/SUHost.m index 78359c92..f764f9e5 100644 --- a/SUHost.m +++ b/SUHost.m @@ -170,4 +170,28 @@ [[NSUserDefaults standardUserDefaults] synchronize]; } ++ (NSString *)systemVersionString +{ + // This returns a version string of the form X.Y.Z + // There may be a better way to deal with the problem that gestaltSystemVersionMajor + // et al. are not defined in 10.3, but this is probably good enough. + NSString* verStr = nil; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 + SInt32 major, minor, bugfix; + OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major); + OSErr err2 = Gestalt(gestaltSystemVersionMinor, &minor); + OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix); + if (!err1 && !err2 && !err3) + { + verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix]; + } + else +#endif + { + NSString *versionPlistPath = @"/System/Library/CoreServices/SystemVersion.plist"; + verStr = [[[NSDictionary dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"] retain]; + } + return verStr; +} + @end diff --git a/SUInstaller.m b/SUInstaller.m index d35488c8..c73c3bc2 100644 --- a/SUInstaller.m +++ b/SUInstaller.m @@ -16,6 +16,26 @@ NSString *SUInstallerDelegateKey = @"SUInstallerDelegate"; @implementation SUInstaller ++ (BOOL)_isAliasFolderAtPath:(NSString *)path +{ + FSRef fileRef; + OSStatus err = noErr; + Boolean aliasFileFlag, folderFlag; + NSURL *fileURL = [NSURL fileURLWithPath:path]; + + if (FALSE == CFURLGetFSRef((CFURLRef)fileURL, &fileRef)) + err = coreFoundationUnknownErr; + + if (noErr == err) + err = FSIsAliasFile(&fileRef, &aliasFileFlag, &folderFlag); + + if (noErr == err) + return (BOOL)(aliasFileFlag && folderFlag); + else + return NO; +} + + + (void)installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously { // Search subdirectories for the application @@ -41,7 +61,7 @@ NSString *SUInstallerDelegateKey = @"SUInstallerDelegate"; } // Some DMGs have symlinks into /Applications! That's no good! And there's no point in looking in bundles. - if ([[NSFileManager defaultManager] isAliasFolderAtPath:currentPath] || + if ([self _isAliasFolderAtPath:currentPath] || [[currentFile pathExtension] isEqualToString:[[host bundlePath] pathExtension]] || [[currentFile pathExtension] isEqualToString:@"pkg"] || [[currentFile pathExtension] isEqualToString:@"mpkg"]) diff --git a/SUPlainInstaller.h b/SUPlainInstaller.h index 142d2e07..8cd31ce2 100644 --- a/SUPlainInstaller.h +++ b/SUPlainInstaller.h @@ -10,6 +10,7 @@ #define SUPLAININSTALLER_H #import "Sparkle.h" +#import "SUInstaller.h" @interface SUPlainInstaller : SUInstaller { } + (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously; diff --git a/SUPlainInstaller.m b/SUPlainInstaller.m index 940d55d2..3e1876b0 100644 --- a/SUPlainInstaller.m +++ b/SUPlainInstaller.m @@ -7,6 +7,7 @@ // #import "SUPlainInstaller.h" +#import "SUPlainInstallerInternals.h" extern NSString *SUInstallerPathKey; extern NSString *SUInstallerHostKey; @@ -17,7 +18,7 @@ extern NSString *SUInstallerDelegateKey; + (void)installPath:(NSString *)path overHost:(SUHost *)bundle delegate:delegate { NSError *error; - BOOL result = [[NSFileManager defaultManager] copyPathWithAuthentication:path overPath:[bundle bundlePath] error:&error]; + BOOL result = [self copyPathWithAuthentication:path overPath:[bundle bundlePath] error:&error]; [self _finishInstallationWithResult:result host:bundle error:error delegate:delegate]; } diff --git a/SUPlainInstallerInternals.h b/SUPlainInstallerInternals.h new file mode 100644 index 00000000..1214394b --- /dev/null +++ b/SUPlainInstallerInternals.h @@ -0,0 +1,18 @@ +// +// SUPlainInstallerInternals.m +// Sparkle +// +// Created by Andy Matuschak on 3/9/06. +// Copyright 2006 Andy Matuschak. All rights reserved. +// + +#ifndef SUPLAININSTALLERINTERNALS_H +#define SUPLAININSTALLERINTERNALS_H + +#import "SUPlainInstaller.h" + +@interface SUPlainInstaller (Internals) ++ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error; +@end + +#endif diff --git a/NSFileManager+Authentication.m b/SUPlainInstallerInternals.m similarity index 69% rename from NSFileManager+Authentication.m rename to SUPlainInstallerInternals.m index a0c922e5..bcb2db75 100644 --- a/NSFileManager+Authentication.m +++ b/SUPlainInstallerInternals.m @@ -1,15 +1,13 @@ // -// NSFileManager+Authentication.m +// SUPlainInstallerInternals.m // Sparkle // // Created by Andy Matuschak on 3/9/06. // Copyright 2006 Andy Matuschak. All rights reserved. // -// This code based on generous contribution from Allan Odgaard. Thanks, Allan! - #import "Sparkle.h" -#import "NSFileManager+Authentication.h" +#import "SUPlainInstallerInternals.h" #import #import @@ -17,7 +15,30 @@ #import #import -#import "NSFileManager+ExtendedAttributes.h" +@interface SUPlainInstaller (MMExtendedAttributes) +// Removes the directory tree rooted at |root| from the file quarantine. +// The quarantine was introduced on Mac OS X 10.5 and is described at: +// +// http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html +//#apple_ref/doc/uid/TP40001369-DontLinkElementID_2 +// +// If |root| is not a directory, then it alone is removed from the quarantine. +// Symbolic links, including |root| if it is a symbolic link, will not be +// traversed. +// +// Ordinarily, the quarantine is managed by calling LSSetItemAttribute +// to set the kLSItemQuarantineProperties attribute to a dictionary specifying +// the quarantine properties to be applied. However, it does not appear to be +// possible to remove an item from the quarantine directly through any public +// Launch Services calls. Instead, this method takes advantage of the fact +// that the quarantine is implemented in part by setting an extended attribute, +// "com.apple.quarantine", on affected files. Removing this attribute is +// sufficient to remove files from the quarantine. ++ (void)releaseFromQuarantine:(NSString*)root; +@end + +// Authorization code based on generous contribution from Allan Odgaard. Thanks, Allan! + static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authorization, const char* executablePath, AuthorizationFlags options, const char* const* arguments) { sig_t oldSigChildHandler = signal(SIGCHLD, SIG_DFL); @@ -37,9 +58,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza return returnValue; } -@implementation NSFileManager (SUAuthenticationAdditions) +@implementation SUPlainInstaller (Internals) -- (BOOL)currentUserOwnsPath:(NSString *)oPath ++ (BOOL)currentUserOwnsPath:(NSString *)oPath { const char *path = [oPath fileSystemRepresentation]; uid_t uid = getuid(); @@ -74,7 +95,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza return res; } -- (NSString *)_temporaryCopyNameForPath:(NSString *)path ++ (NSString *)_temporaryCopyNameForPath:(NSString *)path { // Let's try to read the version number so the filename will be more meaningful. NSString *postFix; @@ -98,7 +119,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza return tempDir; } -- (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst error:(NSError **)error ++ (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst error:(NSError **)error { NSString *tmp = [self _temporaryCopyNameForPath:dst]; const char* srcPath = [src fileSystemRepresentation]; @@ -199,7 +220,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza return res; } -- (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error ++ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error { if (![[NSFileManager defaultManager] fileExistsAtPath:dst]) { @@ -247,3 +268,72 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza } @end + +#include +#include +#include + +@implementation SUPlainInstaller (MMExtendedAttributes) + ++ (int)removeXAttr:(const char*)name + fromFile:(NSString*)file + options:(int)options +{ + typedef int (*removexattr_type)(const char*, const char*, int); + // Reference removexattr directly, it's in the SDK. + static removexattr_type removexattr_func = removexattr; + + // Make sure that the symbol is present. This checks the deployment + // target instead of the SDK so that it's able to catch dlsym failures + // as well as the null symbol that would result from building with the + // 10.4 SDK and a lower deployment target, and running on 10.3. + if (!removexattr_func) { + errno = ENOSYS; + return -1; + } + + const char* path = NULL; + @try { + path = [file fileSystemRepresentation]; + } + @catch (id exception) { + // -[NSString fileSystemRepresentation] throws an exception if it's + // unable to convert the string to something suitable. Map that to + // EDOM, "argument out of domain", which sort of conveys that there + // was a conversion failure. + errno = EDOM; + return -1; + } + + return removexattr_func(path, name, options); +} + ++ (void)releaseFromQuarantine:(NSString*)root +{ + const char* quarantineAttribute = "com.apple.quarantine"; + const int removeXAttrOptions = XATTR_NOFOLLOW; + + [self removeXAttr:quarantineAttribute + fromFile:root + options:removeXAttrOptions]; + + // Only recurse if it's actually a directory. Don't recurse into a + // root-level symbolic link. + NSDictionary* rootAttributes = + [[NSFileManager defaultManager] fileAttributesAtPath:root traverseLink:NO]; + NSString* rootType = [rootAttributes objectForKey:NSFileType]; + + if (rootType == NSFileTypeDirectory) { + // The NSDirectoryEnumerator will avoid recursing into any contained + // symbolic links, so no further type checks are needed. + NSDirectoryEnumerator* directoryEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:root]; + NSString* file = nil; + while ((file = [directoryEnumerator nextObject])) { + [self removeXAttr:quarantineAttribute + fromFile:[root stringByAppendingPathComponent:file] + options:removeXAttrOptions]; + } + } +} + +@end diff --git a/SUSystemProfiler.m b/SUSystemProfiler.m index 0d36cbd7..1f72aab5 100644 --- a/SUSystemProfiler.m +++ b/SUSystemProfiler.m @@ -39,7 +39,7 @@ unsigned long length = sizeof(value) ; // OS version - NSString *currentSystemVersion = [NSWorkspace systemVersionString]; + NSString *currentSystemVersion = [SUHost systemVersionString]; if (currentSystemVersion != nil) [profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"osVersion",@"OS Version",currentSystemVersion,currentSystemVersion,nil] forKeys:profileDictKeys]]; diff --git a/Sparkle.h b/Sparkle.h index dfee4405..921575e1 100644 --- a/Sparkle.h +++ b/Sparkle.h @@ -25,13 +25,7 @@ // This list should include the shared headers. It doesn't matter if some of them aren't shared (unless // there are name-space collisions) so we can list all of them to start with: -#import "NSFileManager+Aliases.h" -#import "NSFileManager+Authentication.h" -#import "NSFileManager+Verification.h" -#import "NSWorkspace+SystemVersion.h" - #import "NTSynchronousTask.h" - #import "SUAppcast.h" #import "SUAppcastItem.h" #import "SUAutomaticUpdateAlert.h" diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index c3c5e005..8ce94a94 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -9,8 +9,6 @@ /* Begin PBXBuildFile section */ 610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134710DD250470049ACDF /* SUUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; }; 610134740DD250470049ACDF /* SUUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 610134720DD250470049ACDF /* SUUpdateDriver.m */; }; - 610134770DD252E60049ACDF /* NSWorkspace+SystemVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134750DD252E60049ACDF /* NSWorkspace+SystemVersion.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 610134780DD252E60049ACDF /* NSWorkspace+SystemVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 610134760DD252E60049ACDF /* NSWorkspace+SystemVersion.m */; }; 6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6101347C0DD2541A0049ACDF /* SUProbingUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6101347A0DD2541A0049ACDF /* SUProbingUpdateDriver.m */; }; 6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -28,9 +26,9 @@ 6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */; }; 61227A160DB548B800AB99EA /* SUVersionComparisonTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */; }; - 61299A2F09CA2DAB00B7442F /* NSFileManager+Verification.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 61299A3009CA2DAB00B7442F /* NSFileManager+Verification.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* NSFileManager+Verification.m */; }; - 61299A4A09CA2DD000B7442F /* NSFileManager+Authentication.h in Headers */ = {isa = PBXBuildFile; fileRef = 6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 61299A3009CA2DAB00B7442F /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */; }; + 61299A4A09CA2DD000B7442F /* SUPlainInstallerInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 6129984309C9E2DA00B7442F /* SUPlainInstallerInternals.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A5B09CA6D4500B7442F /* SUConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61299A6009CA6EB100B7442F /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; 61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A8B09CA790200B7442F /* SUUnarchiver.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -42,8 +40,6 @@ 615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; }; 6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61699BCC0DDB92BD005878A4 /* SUVersionComparisonTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6171D9070D57B81800BFE886 /* NSFileManager+Aliases.h in Headers */ = {isa = PBXBuildFile; fileRef = 6171D9050D57B81800BFE886 /* NSFileManager+Aliases.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6171D9080D57B81800BFE886 /* NSFileManager+Aliases.m in Sources */ = {isa = PBXBuildFile; fileRef = 6171D9060D57B81800BFE886 /* NSFileManager+Aliases.m */; }; 618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (Public, ); }; }; 618FA5020DAE88B40026945C /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; }; 618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -64,7 +60,7 @@ 61AAE82A0A321A8000D8810D /* SUUpdateAlert.nib in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8260A321A7F00D8810D /* SUUpdateAlert.nib */; }; 61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */; }; - 61B5F8EF09C4CE3C00B25A18 /* NSFileManager+Authentication.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* NSFileManager+Authentication.m */; }; + 61B5F8EF09C4CE3C00B25A18 /* SUPlainInstallerInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */; }; 61B5F8F709C4CEB300B25A18 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; 61B5F90F09C4CF3A00B25A18 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; }; 61B5F92E09C4CFD800B25A18 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61B5F92A09C4CFD800B25A18 /* InfoPlist.strings */; }; @@ -84,8 +80,6 @@ 61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */; }; 61BBDF820A49220C00378739 /* Sparkle.icns in Resources */ = {isa = PBXBuildFile; fileRef = 61BBDF810A49220C00378739 /* Sparkle.icns */; }; - 61C1F2780DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 61C1F2760DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 61C1F2790DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C1F2770DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m */; }; 61C2680A0E2DB5D000175E6C /* License.txt in Resources */ = {isa = PBXBuildFile; fileRef = 61C268090E2DB5D000175E6C /* License.txt */; }; 61C46F340D9C54F300B06326 /* SUUpdatePermissionPrompt.nib in Resources */ = {isa = PBXBuildFile; fileRef = 61C46F330D9C54F300B06326 /* SUUpdatePermissionPrompt.nib */; }; 61D85D6D0E10B2ED00F9B4A9 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; }; @@ -152,8 +146,6 @@ 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 610134710DD250470049ACDF /* SUUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdateDriver.h; sourceTree = ""; }; 610134720DD250470049ACDF /* SUUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdateDriver.m; sourceTree = ""; }; - 610134750DD252E60049ACDF /* NSWorkspace+SystemVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSWorkspace+SystemVersion.h"; sourceTree = ""; }; - 610134760DD252E60049ACDF /* NSWorkspace+SystemVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSWorkspace+SystemVersion.m"; sourceTree = ""; }; 610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUProbingUpdateDriver.h; sourceTree = ""; }; 6101347A0DD2541A0049ACDF /* SUProbingUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUProbingUpdateDriver.m; sourceTree = ""; }; 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPipedUnarchiver.h; sourceTree = ""; }; @@ -174,9 +166,9 @@ 612279DA0DB5470200AB99EA /* Sparkle Unit Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Sparkle Unit Tests-Info.plist"; path = "Tests/Sparkle Unit Tests-Info.plist"; sourceTree = ""; }; 61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUVersionComparisonTest.h; path = Tests/SUVersionComparisonTest.h; sourceTree = ""; }; 61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUVersionComparisonTest.m; path = Tests/SUVersionComparisonTest.m; sourceTree = ""; }; - 6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Authentication.h"; sourceTree = ""; }; - 61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Verification.h"; sourceTree = ""; }; - 61299A2E09CA2DAB00B7442F /* NSFileManager+Verification.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+Verification.m"; sourceTree = ""; }; + 6129984309C9E2DA00B7442F /* SUPlainInstallerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPlainInstallerInternals.h; sourceTree = ""; }; + 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDSAVerifier.h; sourceTree = ""; }; + 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDSAVerifier.m; sourceTree = ""; }; 61299A5B09CA6D4500B7442F /* SUConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUConstants.h; sourceTree = ""; }; 61299A5F09CA6EB100B7442F /* SUConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUConstants.m; sourceTree = ""; }; 61299A8B09CA790200B7442F /* SUUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver.h; sourceTree = ""; }; @@ -187,8 +179,6 @@ 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPrompt.m; sourceTree = ""; }; 613242130CD06CEF00106AA4 /* relaunch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = relaunch.m; sourceTree = ""; }; 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SUModelTranslation.plist; sourceTree = ""; }; - 6171D9050D57B81800BFE886 /* NSFileManager+Aliases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Aliases.h"; sourceTree = ""; }; - 6171D9060D57B81800BFE886 /* NSFileManager+Aliases.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+Aliases.m"; sourceTree = ""; }; 618915700E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; }; 618915710E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUUpdateAlert.nib; sourceTree = ""; }; 618915720E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; }; @@ -220,7 +210,7 @@ 61AAE8710A321F7700D8810D /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Sparkle.strings; sourceTree = ""; }; 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SUUpdater.h; sourceTree = ""; }; 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUUpdater.m; sourceTree = ""; }; - 61B5F8E509C4CE3C00B25A18 /* NSFileManager+Authentication.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+Authentication.m"; sourceTree = ""; }; + 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUPlainInstallerInternals.m; sourceTree = ""; }; 61B5F8F609C4CEB300B25A18 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; }; 61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sparkle Test App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 61B5F90409C4CEE200B25A18 /* Test Application-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Test Application-Info.plist"; path = "Test Application/Test Application-Info.plist"; sourceTree = ""; }; @@ -241,8 +231,6 @@ 61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUScheduledUpdateDriver.h; sourceTree = ""; }; 61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUScheduledUpdateDriver.m; sourceTree = ""; }; 61BBDF810A49220C00378739 /* Sparkle.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Sparkle.icns; sourceTree = ""; }; - 61C1F2760DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+ExtendedAttributes.h"; sourceTree = ""; }; - 61C1F2770DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+ExtendedAttributes.m"; sourceTree = ""; }; 61C268090E2DB5D000175E6C /* License.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = License.txt; sourceTree = ""; }; 61C46F350D9C54F300B06326 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; }; 61EF67550E25B58D00F754E0 /* SUHost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUHost.m; sourceTree = ""; }; @@ -336,7 +324,7 @@ 0867D691FE84028FC02AAC07 /* Sparkle */ = { isa = PBXGroup; children = ( - 61F83F6E0DBFE07A006FDD30 /* Update Drivers */, + 61F83F6E0DBFE07A006FDD30 /* Update Control */, 61299B3909CB055000B7442F /* Appcast Support */, 618FA6DB0DB485440026945C /* Installation */, 6101354A0DD25B7F0049ACDF /* Unarchiving */, @@ -400,14 +388,6 @@ isa = PBXGroup; children = ( 613242130CD06CEF00106AA4 /* relaunch.m */, - 6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */, - 61B5F8E509C4CE3C00B25A18 /* NSFileManager+Authentication.m */, - 61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */, - 61299A2E09CA2DAB00B7442F /* NSFileManager+Verification.m */, - 6171D9050D57B81800BFE886 /* NSFileManager+Aliases.h */, - 6171D9060D57B81800BFE886 /* NSFileManager+Aliases.m */, - 61C1F2760DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h */, - 61C1F2770DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m */, ); name = Support; sourceTree = ""; @@ -462,6 +442,8 @@ 618FA5000DAE88B40026945C /* SUInstaller.m */, 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */, 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */, + 6129984309C9E2DA00B7442F /* SUPlainInstallerInternals.h */, + 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */, 618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */, 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */, 6101355D0DD25BB70049ACDF /* Support */, @@ -474,8 +456,6 @@ children = ( 61EF67580E25C5B400F754E0 /* SUHost.h */, 61EF67550E25B58D00F754E0 /* SUHost.m */, - 610134750DD252E60049ACDF /* NSWorkspace+SystemVersion.h */, - 610134760DD252E60049ACDF /* NSWorkspace+SystemVersion.m */, 61299B3509CB04E000B7442F /* Sparkle.h */, 61299A5B09CA6D4500B7442F /* SUConstants.h */, 61299A5F09CA6EB100B7442F /* SUConstants.m */, @@ -496,11 +476,18 @@ name = "Test Application Sources"; sourceTree = ""; }; - 61F83F6E0DBFE07A006FDD30 /* Update Drivers */ = { + 61CFB2C10E384958007A1735 /* Support */ = { + isa = PBXGroup; + children = ( + 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */, + 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */, + ); + name = Support; + sourceTree = ""; + }; + 61CFB2C20E38496B007A1735 /* Drivers */ = { isa = PBXGroup; children = ( - 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */, - 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */, 610134710DD250470049ACDF /* SUUpdateDriver.h */, 610134720DD250470049ACDF /* SUUpdateDriver.m */, 61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */, @@ -516,7 +503,18 @@ 61A354530DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h */, 61A354540DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m */, ); - name = "Update Drivers"; + name = Drivers; + sourceTree = ""; + }; + 61F83F6E0DBFE07A006FDD30 /* Update Control */ = { + isa = PBXGroup; + children = ( + 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */, + 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */, + 61CFB2C20E38496B007A1735 /* Drivers */, + 61CFB2C10E384958007A1735 /* Support */, + ); + name = "Update Control"; sourceTree = ""; }; FA1941C40D94A6EA00DD942E /* Configurations */ = { @@ -551,8 +549,8 @@ 61B5FC7009C51F4A00B25A18 /* SUAppcastItem.h in Headers */, 61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */, 6196CFF909C72148000DC222 /* SUStatusController.h in Headers */, - 61299A2F09CA2DAB00B7442F /* NSFileManager+Verification.h in Headers */, - 61299A4A09CA2DD000B7442F /* NSFileManager+Authentication.h in Headers */, + 61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */, + 61299A4A09CA2DD000B7442F /* SUPlainInstallerInternals.h in Headers */, 61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */, 61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */, 61299B3609CB04E000B7442F /* Sparkle.h in Headers */, @@ -562,9 +560,7 @@ 61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */, 6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */, 612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */, - 6171D9070D57B81800BFE886 /* NSFileManager+Aliases.h in Headers */, 61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */, - 61C1F2780DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h in Headers */, 618FA5010DAE88B40026945C /* SUInstaller.h in Headers */, 618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */, 618FA5220DAE8E8A0026945C /* SUPackageInstaller.h in Headers */, @@ -573,7 +569,6 @@ 61B93B270DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h in Headers */, 61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */, 610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */, - 610134770DD252E60049ACDF /* NSWorkspace+SystemVersion.h in Headers */, 6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */, 61699BCC0DDB92BD005878A4 /* SUVersionComparisonTest.h in Headers */, 61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */, @@ -807,12 +802,12 @@ buildActionMask = 2147483647; files = ( 61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */, - 61B5F8EF09C4CE3C00B25A18 /* NSFileManager+Authentication.m in Sources */, + 61B5F8EF09C4CE3C00B25A18 /* SUPlainInstallerInternals.m in Sources */, 61B5FBB709C4FAFF00B25A18 /* SUAppcast.m in Sources */, 61B5FC6F09C51F4900B25A18 /* SUAppcastItem.m in Sources */, 61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */, 6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */, - 61299A3009CA2DAB00B7442F /* NSFileManager+Verification.m in Sources */, + 61299A3009CA2DAB00B7442F /* SUDSAVerifier.m in Sources */, 61299A6009CA6EB100B7442F /* SUConstants.m in Sources */, 61299A8E09CA790200B7442F /* SUUnarchiver.m in Sources */, 6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */, @@ -820,9 +815,7 @@ 61A225A50D1C4AC000430CCD /* SUStandardVersionComparator.m in Sources */, 61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */, 612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */, - 6171D9080D57B81800BFE886 /* NSFileManager+Aliases.m in Sources */, 61180BCB0D64138900B4E0D1 /* SUWindowController.m in Sources */, - 61C1F2790DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m in Sources */, 618FA5020DAE88B40026945C /* SUInstaller.m in Sources */, 618FA5060DAE8AB80026945C /* SUPlainInstaller.m in Sources */, 618FA5230DAE8E8A0026945C /* SUPackageInstaller.m in Sources */, @@ -831,7 +824,6 @@ 61B93B280DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m in Sources */, 61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */, 610134740DD250470049ACDF /* SUUpdateDriver.m in Sources */, - 610134780DD252E60049ACDF /* NSWorkspace+SystemVersion.m in Sources */, 6101347C0DD2541A0049ACDF /* SUProbingUpdateDriver.m in Sources */, 61A354560DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m in Sources */, 6102FE4B0E07803800F85D09 /* SUDiskImageUnarchiver.m in Sources */,