From 75f86a6d989ff9e5ecb1bac214320ad523f7026a Mon Sep 17 00:00:00 2001 From: Eugene Krupnov Date: Mon, 20 Jan 2014 19:59:46 +0200 Subject: [PATCH 1/2] Add Sandbox XPC Service --- Configurations/ConfigBinaryDelta.xcconfig | 2 - Configurations/ConfigCommon.xcconfig | 10 +- Configurations/ConfigCommonDebug.xcconfig | 2 +- .../ConfigFrameworkReleaseGCSupport.xcconfig | 3 - Configurations/ConfigService.xcconfig | 5 + Configurations/ConfigServiceDebug.xcconfig | 5 + Configurations/ConfigServiceRelease.xcconfig | 3 + .../ConfigTestAppReleaseGCSupport.xcconfig | 3 - .../ConfigUnitTestReleaseGCSupport.xcconfig | 3 - SUBasicUpdateDriver.m | 18 +- SUBinaryDeltaCommon.m | 2 +- SUHost.m | 2 +- SUPipedUnarchiver.m | 1 + SUPlainInstallerInternals.m | 9 +- SUStandardVersionComparator.m | 2 +- SUUIBasedUpdateDriver.m | 2 +- SUXPC.h | 16 + SUXPC.m | 72 ++++ SandboxService.plist | 31 ++ SandboxService/SandboxService-Info.plist | 31 ++ SandboxService/SandboxService-Prefix.pch | 6 + SandboxService/en.lproj/InfoPlist.strings | 2 + SandboxService/main.m | 49 +++ Sparkle.xcodeproj/project.pbxproj | 344 +++++++++++++----- finish_installation.m | 4 +- sandbox_service.m | 91 +++++ 26 files changed, 602 insertions(+), 116 deletions(-) create mode 100644 Configurations/ConfigService.xcconfig create mode 100644 Configurations/ConfigServiceDebug.xcconfig create mode 100644 Configurations/ConfigServiceRelease.xcconfig create mode 100644 SUXPC.h create mode 100644 SUXPC.m create mode 100644 SandboxService.plist create mode 100644 SandboxService/SandboxService-Info.plist create mode 100644 SandboxService/SandboxService-Prefix.pch create mode 100644 SandboxService/en.lproj/InfoPlist.strings create mode 100644 SandboxService/main.m create mode 100644 sandbox_service.m diff --git a/Configurations/ConfigBinaryDelta.xcconfig b/Configurations/ConfigBinaryDelta.xcconfig index 2f84a51e..f0738497 100644 --- a/Configurations/ConfigBinaryDelta.xcconfig +++ b/Configurations/ConfigBinaryDelta.xcconfig @@ -3,6 +3,4 @@ PRODUCT_NAME = BinaryDelta GCC_PREFIX_HEADER = MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.5 -MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5 -MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.5 MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5 diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index a1c0b540..35758c54 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -3,11 +3,7 @@ PREBINDING = NO ZERO_LINK = NO CURRENT_PROJECT_VERSION = 1.5 -SDKROOT = macosx10.7 -MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.4 -MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5 -MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4 -MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5 +SDKROOT = macosx GCC_C_LANGUAGE_STANDARD = c99 GCC_ENABLE_OBJC_EXCEPTIONS = YES GCC_DEBUGGING_SYMBOLS = full @@ -15,7 +11,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = $(SDKROOT)/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h GCC_FAST_OBJC_DISPATCH = YES GCC_ENABLE_PASCAL_STRINGS = NO -ARCHS = ppc i386 x86_64 +ARCHS = i386 x86_64 GCC_VERSION = com.apple.compilers.llvm.clang.1_0 CLANG_LINK_OBJC_RUNTIME = NO @@ -48,4 +44,4 @@ GCC_WARN_UNUSED_VALUE = YES GCC_WARN_UNUSED_PARAMETER = YES GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES GCC_WARN_UNDECLARED_SELECTOR = YES -WARNING_CFLAGS = -Wall -Wno-unused-parameter -Werror -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-format-attribute -Wpacked -Wredundant-decls -Winline -Wdisabled-optimization -Winvalid-pch +WARNING_CFLAGS = -Wall -Wno-unused-parameter -Werror -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-format-attribute -Wpacked -Wredundant-decls -Winline -Wdisabled-optimization -Wformat -Wformat-security -Wformat-y2k -Winvalid-pch diff --git a/Configurations/ConfigCommonDebug.xcconfig b/Configurations/ConfigCommonDebug.xcconfig index 36003c98..5a80bfad 100644 --- a/Configurations/ConfigCommonDebug.xcconfig +++ b/Configurations/ConfigCommonDebug.xcconfig @@ -3,7 +3,7 @@ GCC_OPTIMIZATION_LEVEL = 0 DEBUG_INFORMATION_FORMAT = dwarf GCC_GENERATE_DEBUGGING_SYMBOLS = YES -SPARKLE_EXTRA_DEBUG_10_5_ONLY = -fstack-protector -D_FORTIFY_SOURCE=2 +//SPARKLE_EXTRA_DEBUG_10_5_ONLY = -fstack-protector -D_FORTIFY_SOURCE=2 SPARKLE_EXTRA_DEBUG = -DDEBUG OTHER_CFLAGS = $(SPARKLE_EXTRA_DEBUG) diff --git a/Configurations/ConfigFrameworkReleaseGCSupport.xcconfig b/Configurations/ConfigFrameworkReleaseGCSupport.xcconfig index a332aaf9..e69de29b 100644 --- a/Configurations/ConfigFrameworkReleaseGCSupport.xcconfig +++ b/Configurations/ConfigFrameworkReleaseGCSupport.xcconfig @@ -1,3 +0,0 @@ -#include "ConfigFrameworkRelease.xcconfig" - -GCC_ENABLE_OBJC_GC = supported \ No newline at end of file diff --git a/Configurations/ConfigService.xcconfig b/Configurations/ConfigService.xcconfig new file mode 100644 index 00000000..0972c5cc --- /dev/null +++ b/Configurations/ConfigService.xcconfig @@ -0,0 +1,5 @@ +// Sandbox Service only + +PRODUCT_NAME = com.andymatuschak.Sparkle.SandboxService +WRAPPER_EXTENSION = xpc +MACH_O_TYPE = mh_execute \ No newline at end of file diff --git a/Configurations/ConfigServiceDebug.xcconfig b/Configurations/ConfigServiceDebug.xcconfig new file mode 100644 index 00000000..95179370 --- /dev/null +++ b/Configurations/ConfigServiceDebug.xcconfig @@ -0,0 +1,5 @@ +#include "ConfigCommon.xcconfig" +#include "ConfigCommonDebug.xcconfig" +#include "ConfigService.xcconfig" + +OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG \ No newline at end of file diff --git a/Configurations/ConfigServiceRelease.xcconfig b/Configurations/ConfigServiceRelease.xcconfig new file mode 100644 index 00000000..c3ea785a --- /dev/null +++ b/Configurations/ConfigServiceRelease.xcconfig @@ -0,0 +1,3 @@ +#include "ConfigCommon.xcconfig" +#include "ConfigCommonRelease.xcconfig" +#include "ConfigService.xcconfig" \ No newline at end of file diff --git a/Configurations/ConfigTestAppReleaseGCSupport.xcconfig b/Configurations/ConfigTestAppReleaseGCSupport.xcconfig index 0ac40c55..e69de29b 100644 --- a/Configurations/ConfigTestAppReleaseGCSupport.xcconfig +++ b/Configurations/ConfigTestAppReleaseGCSupport.xcconfig @@ -1,3 +0,0 @@ -#include "ConfigTestAppRelease.xcconfig" - -GCC_ENABLE_OBJC_GC = required \ No newline at end of file diff --git a/Configurations/ConfigUnitTestReleaseGCSupport.xcconfig b/Configurations/ConfigUnitTestReleaseGCSupport.xcconfig index 1b648d16..e69de29b 100644 --- a/Configurations/ConfigUnitTestReleaseGCSupport.xcconfig +++ b/Configurations/ConfigUnitTestReleaseGCSupport.xcconfig @@ -1,3 +0,0 @@ -#include "ConfigUnitTestRelease.xcconfig" - -GCC_ENABLE_OBJC_GC = required \ No newline at end of file diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index cb23e877..9392f325 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -20,6 +20,7 @@ #import "SUBinaryDeltaCommon.h" #import "SUCodeSigningVerifier.h" #import "SUUpdater_Private.h" +#import "SUXPC.h" @interface SUBasicUpdateDriver () ; @end @@ -297,6 +298,10 @@ return; } + BOOL running10_7 = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6; + BOOL useXPC = running10_7 && [[NSFileManager defaultManager] fileExistsAtPath:[[host bundlePath] stringByAppendingPathComponent:@"Contents/XPCServices/com.andymatuschak.Sparkle.SandboxService.xpc"]]; + + // Give the host app an opportunity to postpone the install and relaunch. static BOOL postponedOnce = NO; if (!postponedOnce && [[updater delegate] respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)]) @@ -326,7 +331,12 @@ #endif // Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems. - if( [SUPlainInstaller copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: nil error: &error] ) + BOOL copiedRelaunchTool = FALSE; + if( useXPC ) + copiedRelaunchTool = [SUXPC copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: nil error: &error]; + else + copiedRelaunchTool = [SUPlainInstaller copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: nil error: &error]; + if( copiedRelaunchTool ) relaunchPath = [targetPath retain]; else [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil), NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't copy relauncher (%@) to temporary path (%@)! %@", relaunchPathToCopy, targetPath, (error ? [error localizedDescription] : @"")], NSLocalizedFailureReasonErrorKey, nil]]]; @@ -347,7 +357,11 @@ if ([[updater delegate] respondsToSelector:@selector(pathToRelaunchForUpdater:)]) pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater]; NSString *relaunchToolPath = [relaunchPath stringByAppendingPathComponent: @"/Contents/MacOS/finish_installation"]; - [NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:[NSArray arrayWithObjects:[host bundlePath], pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], tempDir, relaunch ? @"1" : @"0", nil]]; + NSArray *arguments = [NSArray arrayWithObjects:[host bundlePath], pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], tempDir, relaunch ? @"1" : @"0", nil]; + if( useXPC ) + [SUXPC launchTaskWithLaunchPath: relaunchToolPath arguments:arguments]; + else + [NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:arguments]; [NSApp terminate:self]; } diff --git a/SUBinaryDeltaCommon.m b/SUBinaryDeltaCommon.m index 4315d95d..d0241234 100644 --- a/SUBinaryDeltaCommon.m +++ b/SUBinaryDeltaCommon.m @@ -44,7 +44,7 @@ NSString *temporaryFilename(NSString *base) NSString *template = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.XXXXXXXXXX", base]]; char buffer[MAXPATHLEN]; strcpy(buffer, [template fileSystemRepresentation]); - return [NSString stringWithUTF8String:mktemp(buffer)]; + return [NSString stringWithUTF8String:mkstemp(buffer)]; } static void _hashOfBuffer(unsigned char *hash, const char* buffer, size_t bufferLength) diff --git a/SUHost.m b/SUHost.m index e12af606..e87738ad 100644 --- a/SUHost.m +++ b/SUHost.m @@ -256,7 +256,7 @@ OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix); if (!err1 && !err2 && !err3) { - verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)major, (long)minor, (long)bugfix]; + verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", (long) major, (long) minor, (long) bugfix]; } else #endif diff --git a/SUPipedUnarchiver.m b/SUPipedUnarchiver.m index e70f0797..cdb4fc26 100644 --- a/SUPipedUnarchiver.m +++ b/SUPipedUnarchiver.m @@ -61,6 +61,7 @@ #else NSNumber *fs = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil] objectForKey:NSFileSize]; #endif + if (fs == nil) goto reportError; // Thank you, Allan Odgaard! diff --git a/SUPlainInstallerInternals.m b/SUPlainInstallerInternals.m index 1eb6b8a8..738c8dec 100644 --- a/SUPlainInstallerInternals.m +++ b/SUPlainInstallerInternals.m @@ -465,7 +465,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza { err = FSPathMakeRef((UInt8 *)[[tmpPath stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); if (err != noErr) - err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); + FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); } err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &dstDirRef, NULL); @@ -505,7 +505,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza { // We better move the old version back to its old location if( hadFileAtDest ) - success = [manager moveItemAtPath:tmpPath toPath:dst error:error]; + [manager moveItemAtPath:tmpPath toPath:dst error:error]; if (error != NULL) *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]]; return NO; @@ -534,7 +534,10 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza // new home in case it's moved across filesystems: if that // happens, the move is actually a copy, and it may result // in the application being quarantined. - [self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES]; + if ([NSThread isMultiThreaded]) + [self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES]; + else + [self releaseFromQuarantine:dst]; return YES; } diff --git a/SUStandardVersionComparator.m b/SUStandardVersionComparator.m index f6f894c3..5a9a91f1 100644 --- a/SUStandardVersionComparator.m +++ b/SUStandardVersionComparator.m @@ -88,7 +88,7 @@ typedef enum { long long valueA, valueB; SUCharacterType typeA, typeB; - n = MIN([partsA count], [partsB count]); + n = MIN((int)[partsA count], (int)[partsB count]); for (i = 0; i < n; ++i) { partA = [partsA objectAtIndex:i]; partB = [partsB objectAtIndex:i]; diff --git a/SUUIBasedUpdateDriver.m b/SUUIBasedUpdateDriver.m index 3975165b..62953ab7 100644 --- a/SUUIBasedUpdateDriver.m +++ b/SUUIBasedUpdateDriver.m @@ -201,7 +201,7 @@ - (void)abortUpdateWithError:(NSError *)error { - NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"Update Error!", nil) + NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"Update Error!", nil) defaultButton:SULocalizedString(@"Cancel Update", nil) alternateButton:nil otherButton:nil diff --git a/SUXPC.h b/SUXPC.h new file mode 100644 index 00000000..ac8fb661 --- /dev/null +++ b/SUXPC.h @@ -0,0 +1,16 @@ +// +// SUXPC.h +// Sparkle +// +// Created by Whitney Young on 3/19/12. +// Copyright (c) 2012 FadingRed. All rights reserved. +// + +#import + +@interface SUXPC : NSObject + ++ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst temporaryName:(NSString *)tmp error:(NSError **)error; ++ (void)launchTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)arguments; + +@end diff --git a/SUXPC.m b/SUXPC.m new file mode 100644 index 00000000..a732623a --- /dev/null +++ b/SUXPC.m @@ -0,0 +1,72 @@ +// +// SUXPC.m +// Sparkle +// +// Created by Whitney Young on 3/19/12. +// Copyright (c) 2012 FadingRed. All rights reserved. +// + +#import +#import "SUXPC.h" + + +@implementation SUXPC + ++ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst temporaryName:(NSString *)tmp error:(NSError **)error { + xpc_connection_t connection = xpc_connection_create("com.andymatuschak.Sparkle.SandboxService", NULL); + xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { + xpc_dictionary_apply(event, ^bool(const char *key, xpc_object_t value) { + NSLog(@"XPC %s: %s", key, xpc_string_get_string_ptr(value)); + return true; + }); + }); + xpc_connection_resume(connection); + + xpc_object_t message = xpc_dictionary_create(NULL, NULL, 0); + xpc_dictionary_set_string(message, "id", "copy_path"); + + if( src ) + xpc_dictionary_set_string(message, "source", [src fileSystemRepresentation]); + if( dst ) + xpc_dictionary_set_string(message, "destination", [dst fileSystemRepresentation]); + if( tmp ) + xpc_dictionary_set_string(message, "tmp", [tmp UTF8String]); + + xpc_object_t response = xpc_connection_send_message_with_reply_sync(connection, message); + xpc_type_t type = xpc_get_type(response); + return type == XPC_TYPE_DICTIONARY; +} + ++ (void)launchTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)arguments { + xpc_connection_t connection = xpc_connection_create("com.andymatuschak.Sparkle.SandboxService", NULL); + xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { + xpc_dictionary_apply(event, ^bool(const char *key, xpc_object_t value) { + NSLog(@"XPC %s: %s", key, xpc_string_get_string_ptr(value)); + return true; + }); + }); + xpc_connection_resume(connection); + + xpc_object_t message = xpc_dictionary_create(NULL, NULL, 0); + xpc_dictionary_set_string(message, "id", "launch_task"); + + if( path ) + xpc_dictionary_set_string(message, "path", [path fileSystemRepresentation]); + + xpc_object_t array = xpc_array_create(NULL, 0); + for (id argument in arguments) { + xpc_array_append_value(array, xpc_string_create([argument UTF8String])); + } + + xpc_dictionary_set_value(message, "arguments", array); + + xpc_object_t response = xpc_connection_send_message_with_reply_sync(connection, message); + xpc_type_t type = xpc_get_type(response); + BOOL success = (type == XPC_TYPE_DICTIONARY); + + if (!success) { + NSLog(@"XPC launch error"); + } +} + +@end \ No newline at end of file diff --git a/SandboxService.plist b/SandboxService.plist new file mode 100644 index 00000000..5bfff823 --- /dev/null +++ b/SandboxService.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${EXECUTABLE_NAME} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + XPCService + + ServiceType + Application + JoinExistingSession + + + + \ No newline at end of file diff --git a/SandboxService/SandboxService-Info.plist b/SandboxService/SandboxService-Info.plist new file mode 100644 index 00000000..000681be --- /dev/null +++ b/SandboxService/SandboxService-Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${EXECUTABLE_NAME} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + XPCService + + JoinExistingSession + + ServiceType + Application + + + diff --git a/SandboxService/SandboxService-Prefix.pch b/SandboxService/SandboxService-Prefix.pch new file mode 100644 index 00000000..fbe8d115 --- /dev/null +++ b/SandboxService/SandboxService-Prefix.pch @@ -0,0 +1,6 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + diff --git a/SandboxService/en.lproj/InfoPlist.strings b/SandboxService/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..477b28ff --- /dev/null +++ b/SandboxService/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/SandboxService/main.m b/SandboxService/main.m new file mode 100644 index 00000000..aea62f76 --- /dev/null +++ b/SandboxService/main.m @@ -0,0 +1,49 @@ +// +// main.m +// SandboxService +// +// Created by UJey on 1/20/14. +// +// + +#include +#include + +static void SandboxService_peer_event_handler(xpc_connection_t peer, xpc_object_t event) +{ + xpc_type_t type = xpc_get_type(event); + if (type == XPC_TYPE_ERROR) { + if (event == XPC_ERROR_CONNECTION_INVALID) { + // The client process on the other end of the connection has either + // crashed or cancelled the connection. After receiving this error, + // the connection is in an invalid state, and you do not need to + // call xpc_connection_cancel(). Just tear down any associated state + // here. + } else if (event == XPC_ERROR_TERMINATION_IMMINENT) { + // Handle per-connection termination cleanup. + } + } else { + assert(type == XPC_TYPE_DICTIONARY); + // Handle the message. + } +} + +static void SandboxService_event_handler(xpc_connection_t peer) +{ + // By defaults, new connections will target the default dispatch + // concurrent queue. + xpc_connection_set_event_handler(peer, ^(xpc_object_t event) { + SandboxService_peer_event_handler(peer, event); + }); + + // This will tell the connection to begin listening for events. If you + // have some other initialization that must be done asynchronously, then + // you can defer this call until after that initialization is done. + xpc_connection_resume(peer); +} + +int main(int argc, const char *argv[]) +{ + xpc_main(SandboxService_event_handler); + return 0; +} diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 641075dc..c9a2247e 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -7,6 +7,22 @@ objects = { /* Begin PBXBuildFile section */ + 290DE102188D8C6400434ED0 /* SUXPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 290DE100188D8C6400434ED0 /* SUXPC.h */; }; + 290DE103188D8C6400434ED0 /* SUXPC.m in Sources */ = {isa = PBXBuildFile; fileRef = 290DE101188D8C6400434ED0 /* SUXPC.m */; }; + 290DE127188D912F00434ED0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE126188D912F00434ED0 /* Foundation.framework */; }; + 290DE12D188D912F00434ED0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 290DE12B188D912F00434ED0 /* InfoPlist.strings */; }; + 290DE130188D912F00434ED0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 290DE12F188D912F00434ED0 /* main.m */; }; + 290DE134188D914500434ED0 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55C14F31136EFC2400649790 /* SystemConfiguration.framework */; }; + 290DE136188D914E00434ED0 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE135188D914E00434ED0 /* IOKit.framework */; }; + 290DE138188D915800434ED0 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE137188D915800434ED0 /* AppKit.framework */; }; + 290DE13A188D916600434ED0 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE139188D916600434ED0 /* Security.framework */; }; + 290DE13E188D934A00434ED0 /* sandbox_service.m in Sources */ = {isa = PBXBuildFile; fileRef = 290DE107188D8E3200434ED0 /* sandbox_service.m */; }; + 290DE13F188D938F00434ED0 /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; }; + 290DE140188D93AC00434ED0 /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */; }; + 290DE141188D93B300434ED0 /* SUPlainInstallerInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */; }; + 290DE142188D93C800434ED0 /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */; }; + 290DE143188D93EB00434ED0 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; + 290DE144188D93FA00434ED0 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 525A2790133D6AE900FD8D70 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 525A278F133D6AE900FD8D70 /* Cocoa.framework */; }; 525A27A0133D6B9700FD8D70 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 525A278F133D6AE900FD8D70 /* Cocoa.framework */; }; @@ -190,6 +206,22 @@ 0263187714FEBB42005EBF43 /* uk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = uk; path = uk.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; }; 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 290DE0FD188D84A700434ED0 /* ConfigService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigService.xcconfig; sourceTree = ""; }; + 290DE0FE188D84D300434ED0 /* ConfigServiceDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigServiceDebug.xcconfig; sourceTree = ""; }; + 290DE0FF188D84F300434ED0 /* ConfigServiceRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigServiceRelease.xcconfig; sourceTree = ""; }; + 290DE100188D8C6400434ED0 /* SUXPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUXPC.h; sourceTree = ""; }; + 290DE101188D8C6400434ED0 /* SUXPC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUXPC.m; sourceTree = ""; }; + 290DE104188D8CB200434ED0 /* SandboxService.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SandboxService.plist; sourceTree = ""; }; + 290DE107188D8E3200434ED0 /* sandbox_service.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = sandbox_service.m; sourceTree = ""; }; + 290DE124188D912E00434ED0 /* com.andymatuschak.Sparkle.SandboxService.xpc */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = com.andymatuschak.Sparkle.SandboxService.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; + 290DE126188D912F00434ED0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 290DE12A188D912F00434ED0 /* SandboxService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SandboxService-Info.plist"; sourceTree = ""; }; + 290DE12C188D912F00434ED0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 290DE12E188D912F00434ED0 /* SandboxService-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SandboxService-Prefix.pch"; sourceTree = ""; }; + 290DE12F188D912F00434ED0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 290DE135188D914E00434ED0 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 290DE137188D915800434ED0 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 290DE139188D916600434ED0 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUVersionDisplayProtocol.h; sourceTree = ""; }; 525A278F133D6AE900FD8D70 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 550347001370023A00AE7681 /* Sparkle.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Sparkle.icns; sourceTree = ""; }; @@ -429,6 +461,18 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 290DE121188D912E00434ED0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 290DE13A188D916600434ED0 /* Security.framework in Frameworks */, + 290DE138188D915800434ED0 /* AppKit.framework in Frameworks */, + 290DE136188D914E00434ED0 /* IOKit.framework in Frameworks */, + 290DE134188D914500434ED0 /* SystemConfiguration.framework in Frameworks */, + 290DE127188D912F00434ED0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 55C14BB5136EEF1500649790 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -494,6 +538,7 @@ 612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */, 5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */, 55C14BB7136EEF1500649790 /* finish_installation.app */, + 290DE124188D912E00434ED0 /* com.andymatuschak.Sparkle.SandboxService.xpc */, ); name = Products; sourceTree = ""; @@ -501,6 +546,7 @@ 0867D691FE84028FC02AAC07 /* Sparkle */ = { isa = PBXGroup; children = ( + 290DE13B188D930100434ED0 /* Sandbox Service */, 61F83F6E0DBFE07A006FDD30 /* Update Control */, 61299B3909CB055000B7442F /* Appcast Support */, 618FA6DB0DB485440026945C /* Installation */, @@ -513,6 +559,8 @@ 61B5F91D09C4CF7F00B25A18 /* Test Application Sources */, 0867D69AFE84028FC02AAC07 /* Apple Frameworks and Libraries */, FA1941C40D94A6EA00DD942E /* Configurations */, + 290DE128188D912F00434ED0 /* SandboxService */, + 290DE125188D912E00434ED0 /* Frameworks */, 034768DFFF38A50411DB9C8B /* Products */, ); name = Sparkle; @@ -552,6 +600,63 @@ name = "Framework Resources"; sourceTree = ""; }; + 290DE125188D912E00434ED0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 290DE139188D916600434ED0 /* Security.framework */, + 290DE137188D915800434ED0 /* AppKit.framework */, + 290DE135188D914E00434ED0 /* IOKit.framework */, + 290DE126188D912F00434ED0 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 290DE128188D912F00434ED0 /* SandboxService */ = { + isa = PBXGroup; + children = ( + 290DE12F188D912F00434ED0 /* main.m */, + 290DE129188D912F00434ED0 /* Supporting Files */, + ); + path = SandboxService; + sourceTree = ""; + }; + 290DE129188D912F00434ED0 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 290DE12A188D912F00434ED0 /* SandboxService-Info.plist */, + 290DE12B188D912F00434ED0 /* InfoPlist.strings */, + 290DE12E188D912F00434ED0 /* SandboxService-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 290DE13B188D930100434ED0 /* Sandbox Service */ = { + isa = PBXGroup; + children = ( + 290DE13C188D931800434ED0 /* Service */, + 290DE13D188D932000434ED0 /* Interface */, + ); + name = "Sandbox Service"; + sourceTree = ""; + }; + 290DE13C188D931800434ED0 /* Service */ = { + isa = PBXGroup; + children = ( + 290DE107188D8E3200434ED0 /* sandbox_service.m */, + 290DE104188D8CB200434ED0 /* SandboxService.plist */, + ); + name = Service; + sourceTree = ""; + }; + 290DE13D188D932000434ED0 /* Interface */ = { + isa = PBXGroup; + children = ( + 290DE100188D8C6400434ED0 /* SUXPC.h */, + 290DE101188D8C6400434ED0 /* SUXPC.m */, + ); + name = Interface; + sourceTree = ""; + }; 55C14BD5136EEFD000649790 /* finish_installation tool */ = { isa = PBXGroup; children = ( @@ -723,11 +828,11 @@ 61F83F6E0DBFE07A006FDD30 /* Update Control */ = { isa = PBXGroup; children = ( - 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */, - 6158A1C4137904B300487EC1 /* SUUpdater_Private.h */, - 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */, 61CFB2C20E38496B007A1735 /* Drivers */, 61CFB2C10E384958007A1735 /* Support */, + 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */, + 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */, + 6158A1C4137904B300487EC1 /* SUUpdater_Private.h */, ); name = "Update Control"; sourceTree = ""; @@ -745,13 +850,16 @@ FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */, FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */, 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */, + FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */, + FA1941D30D94A70100DD942E /* ConfigRelaunchDebug.xcconfig */, + FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */, + 290DE0FD188D84A700434ED0 /* ConfigService.xcconfig */, + 290DE0FE188D84D300434ED0 /* ConfigServiceDebug.xcconfig */, + 290DE0FF188D84F300434ED0 /* ConfigServiceRelease.xcconfig */, FA1941CD0D94A70100DD942E /* ConfigTestApp.xcconfig */, FA1941CB0D94A70100DD942E /* ConfigTestAppDebug.xcconfig */, FA1941D20D94A70100DD942E /* ConfigTestAppRelease.xcconfig */, 615409A8103BA09100125AF1 /* ConfigTestAppReleaseGCSupport.xcconfig */, - FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */, - FA1941D30D94A70100DD942E /* ConfigRelaunchDebug.xcconfig */, - FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */, FA3AAF3B1050B273004B3130 /* ConfigUnitTest.xcconfig */, FA3AAF3A1050B273004B3130 /* ConfigUnitTestDebug.xcconfig */, FA3AAF391050B273004B3130 /* ConfigUnitTestRelease.xcconfig */, @@ -767,6 +875,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 290DE102188D8C6400434ED0 /* SUXPC.h in Headers */, 61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */, 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */, 61B5FC0D09C4FC8200B25A18 /* SUAppcast.h in Headers */, @@ -814,6 +923,23 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 290DE123188D912E00434ED0 /* SandboxService */ = { + isa = PBXNativeTarget; + buildConfigurationList = 290DE131188D912F00434ED0 /* Build configuration list for PBXNativeTarget "SandboxService" */; + buildPhases = ( + 290DE120188D912E00434ED0 /* Sources */, + 290DE121188D912E00434ED0 /* Frameworks */, + 290DE122188D912E00434ED0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SandboxService; + productName = SandboxService; + productReference = 290DE124188D912E00434ED0 /* com.andymatuschak.Sparkle.SandboxService.xpc */; + productType = "com.apple.product-type.bundle"; + }; 55C14BB6136EEF1500649790 /* finish_installation */ = { isa = PBXNativeTarget; buildConfigurationList = 55C14BBE136EEF1500649790 /* Build configuration list for PBXNativeTarget "finish_installation" */; @@ -973,11 +1099,20 @@ 612279D80DB5470200AB99EA /* Sparkle Unit Tests */, 5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */, 55C14BB6136EEF1500649790 /* finish_installation */, + 290DE123188D912E00434ED0 /* SandboxService */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 290DE122188D912E00434ED0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 290DE12D188D912F00434ED0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 55C14BB3136EEF1500649790 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1101,6 +1236,21 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 290DE120188D912E00434ED0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 290DE141188D93B300434ED0 /* SUPlainInstallerInternals.m in Sources */, + 290DE140188D93AC00434ED0 /* SUPlainInstaller.m in Sources */, + 290DE13F188D938F00434ED0 /* SUInstaller.m in Sources */, + 290DE130188D912F00434ED0 /* main.m in Sources */, + 290DE144188D93FA00434ED0 /* SULog.m in Sources */, + 290DE13E188D934A00434ED0 /* sandbox_service.m in Sources */, + 290DE143188D93EB00434ED0 /* SUConstants.m in Sources */, + 290DE142188D93C800434ED0 /* SUPackageInstaller.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 55C14BB4136EEF1500649790 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1151,6 +1301,7 @@ files = ( 61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */, 61B5F8EF09C4CE3C00B25A18 /* SUPlainInstallerInternals.m in Sources */, + 290DE103188D8C6400434ED0 /* SUXPC.m in Sources */, 61B5FBB709C4FAFF00B25A18 /* SUAppcast.m in Sources */, 61B5FC6F09C51F4900B25A18 /* SUAppcastItem.m in Sources */, 61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */, @@ -1214,6 +1365,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 290DE12B188D912F00434ED0 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 290DE12C188D912F00434ED0 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; 55C14BDA136EF20D00649790 /* SUAutomaticUpdateAlert.xib */ = { isa = PBXVariantGroup; children = ( @@ -1400,7 +1559,9 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ONLY_ACTIVE_ARCH = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = NO; SDKROOT = macosx; VALID_ARCHS = x86_64; }; @@ -1409,11 +1570,93 @@ 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = NO; SDKROOT = macosx; VALID_ARCHS = x86_64; }; name = Release; }; + 290DE132188D912F00434ED0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SandboxService/SandboxService-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = "SandboxService/SandboxService-Info.plist"; + MACH_O_TYPE = mh_execute; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = "com.andymatuschak.Sparkle.$(TARGET_NAME:rfc1034identifier)"; + WRAPPER_EXTENSION = xpc; + }; + name = Debug; + }; + 290DE133188D912F00434ED0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SandboxService/SandboxService-Prefix.pch"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = "SandboxService/SandboxService-Info.plist"; + MACH_O_TYPE = mh_execute; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_NAME = "com.andymatuschak.Sparkle.$(TARGET_NAME:rfc1034identifier)"; + WRAPPER_EXTENSION = xpc; + }; + name = Release; + }; 55C14BBB136EEF1500649790 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = FA1941D30D94A70100DD942E /* ConfigRelaunchDebug.xcconfig */; @@ -1466,29 +1709,6 @@ }; name = Release; }; - 55C14BBD136EEF1500649790 /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; - COMBINE_HIDPI_IMAGES = YES; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = finish_installation.pch; - INFOPLIST_FILE = "finish_installation-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PRODUCT_NAME = finish_installation; - SDKROOT = macosx; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; 5D06E8D20FD68C7D005AE3F6 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D06E8F20FD68D21005AE3F6 /* ConfigBinaryDeltaDebug.xcconfig */; @@ -1507,56 +1727,6 @@ }; name = Release; }; - 5D06E8D40FD68C7D005AE3F6 /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D06E8F30FD68D21005AE3F6 /* ConfigBinaryDeltaRelease.xcconfig */; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; - SDKROOT = macosx; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - buildSettings = { - SDKROOT = macosx; - VALID_ARCHS = x86_64; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EAE0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; - COMBINE_HIDPI_IMAGES = YES; - GCC_ENABLE_OBJC_GC = unsupported; - SDKROOT = macosx; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EAF0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 615409A8103BA09100125AF1 /* ConfigTestAppReleaseGCSupport.xcconfig */; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; - COMBINE_HIDPI_IMAGES = YES; - GCC_ENABLE_OBJC_GC = unsupported; - SDKROOT = macosx; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EB10DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA302AFD109D13190060F891 /* ConfigUnitTestReleaseGCSupport.xcconfig */; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; - COMBINE_HIDPI_IMAGES = YES; - GCC_ENABLE_OBJC_GC = unsupported; - SDKROOT = macosx; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; 612279DB0DB5470300AB99EA /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = FA3AAF3A1050B273004B3130 /* ConfigUnitTestDebug.xcconfig */; @@ -1605,7 +1775,6 @@ buildConfigurations = ( 1DEB91AE08733DA50010E9CD /* Debug */, 1DEB91AF08733DA50010E9CD /* Release */, - 61072EAE0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1615,17 +1784,23 @@ buildConfigurations = ( 1DEB91B208733DA50010E9CD /* Debug */, 1DEB91B308733DA50010E9CD /* Release */, - 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 290DE131188D912F00434ED0 /* Build configuration list for PBXNativeTarget "SandboxService" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 290DE132188D912F00434ED0 /* Debug */, + 290DE133188D912F00434ED0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 55C14BBE136EEF1500649790 /* Build configuration list for PBXNativeTarget "finish_installation" */ = { isa = XCConfigurationList; buildConfigurations = ( 55C14BBB136EEF1500649790 /* Debug */, 55C14BBC136EEF1500649790 /* Release */, - 55C14BBD136EEF1500649790 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1635,7 +1810,6 @@ buildConfigurations = ( 5D06E8D20FD68C7D005AE3F6 /* Debug */, 5D06E8D30FD68C7D005AE3F6 /* Release */, - 5D06E8D40FD68C7D005AE3F6 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1645,7 +1819,6 @@ buildConfigurations = ( 612279DB0DB5470300AB99EA /* Debug */, 612279DC0DB5470300AB99EA /* Release */, - 61072EB10DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1655,7 +1828,6 @@ buildConfigurations = ( 61B5F90609C4CEE300B25A18 /* Debug */, 61B5F90709C4CEE300B25A18 /* Release */, - 61072EAF0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/finish_installation.m b/finish_installation.m index 740de4b4..6783b227 100644 --- a/finish_installation.m +++ b/finish_installation.m @@ -118,7 +118,7 @@ if( !folderpath || strcmp(executablepath, hostpath) != 0 ) appPath = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:executablepath length:strlen(executablepath)]; else - appPath = installationPath; + appPath = [host installationPath]; [[NSWorkspace sharedWorkspace] openFile: appPath]; } @@ -146,7 +146,7 @@ // Perhaps a poor assumption but: if we're not relaunching, we assume we shouldn't be showing any UI either. Because non-relaunching installations are kicked off without any user interaction, we shouldn't be interrupting them. if (shouldRelaunch) { - SUStatusController* statusCtl = [[SUStatusController alloc] initWithHost: host]; // We quit anyway after we've installed, so leak this for now. + SUStatusController* statusCtl = [[[SUStatusController alloc] initWithHost: host] autorelease]; // We quit anyway after we've installed, so leak this for now. [statusCtl setButtonTitle: SULocalizedString(@"Cancel Update",@"") target: nil action: Nil isDefault: NO]; [statusCtl beginActionWithTitle: SULocalizedString(@"Installing update...",@"") maxProgressValue: 0 statusText: @""]; diff --git a/sandbox_service.m b/sandbox_service.m new file mode 100644 index 00000000..824a8758 --- /dev/null +++ b/sandbox_service.m @@ -0,0 +1,91 @@ +// +// main.m +// Update +// +// Created by Whitney Young on 3/19/12. +// Copyright (c) 2012 FadingRed. All rights reserved. +// + +#include +#include +#import "SUPlainInstallerInternals.h" + +static void peer_event_handler(xpc_connection_t peer, xpc_object_t event) +{ + xpc_type_t type = xpc_get_type(event); + if (type == XPC_TYPE_ERROR) { + if (event == XPC_ERROR_CONNECTION_INVALID) { + // The client process on the other end of the connection has either + // crashed or cancelled the connection. After receiving this error, + // the connection is in an invalid state, and you do not need to + // call xpc_connection_cancel(). Just tear down any associated state + // here. + } else if (event == XPC_ERROR_TERMINATION_IMMINENT) { + // Handle per-connection termination cleanup. + } + } else { + assert(type == XPC_TYPE_DICTIONARY); + // Handle the message. + const char *identifier = xpc_dictionary_get_string(event, "id"); + BOOL copyPath = strcmp(identifier, "copy_path") == 0; + BOOL launchTask = strcmp(identifier, "launch_task") == 0; + + if( copyPath ) + { + const char *src = xpc_dictionary_get_string(event, "source"); + const char *dst = xpc_dictionary_get_string(event, "destination"); + const char *tmp = xpc_dictionary_get_string(event, "tmp"); + + NSFileManager *manager = [NSFileManager defaultManager]; + NSString *relaunchPathToCopy = src ? [manager stringWithFileSystemRepresentation:src length:strlen(src)] : nil; + NSString *targetPath = dst ? [manager stringWithFileSystemRepresentation:dst length:strlen(dst)] : nil; + NSString *temporaryName = tmp ? [NSString stringWithUTF8String:tmp] : nil; + NSError *error = nil; + [SUPlainInstaller copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: temporaryName error: &error]; + + // send response to indicate ok + xpc_object_t reply = xpc_dictionary_create_reply(event); + xpc_connection_send_message(peer, reply); + } + else if( launchTask ) + { + const char *path = xpc_dictionary_get_string(event, "path"); + xpc_object_t array = xpc_dictionary_get_value(event, "arguments"); + + NSFileManager *manager = [NSFileManager defaultManager]; + NSString *relaunchToolPath = path ? [manager stringWithFileSystemRepresentation:path length:strlen(path)] : nil;; + NSMutableArray *arguments = [NSMutableArray array]; + + for (size_t i = 0; i < xpc_array_get_count(array); i++) { + [arguments addObject: + [NSString stringWithUTF8String:xpc_array_get_string(array, i)]]; + } + + [NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:arguments]; + + // send response to indicate ok + xpc_object_t reply = xpc_dictionary_create_reply(event); + xpc_connection_send_message(peer, reply); + } + } +} + +static void event_handler(xpc_connection_t peer) +{ + // By defaults, new connections will target the default dispatch + // concurrent queue. + xpc_connection_set_event_handler(peer, ^(xpc_object_t event) { + peer_event_handler(peer, event); + }); + + // This will tell the connection to begin listening for events. If you + // have some other initialization that must be done asynchronously, then + // you can defer this call until after that initialization is done. + xpc_connection_resume(peer); +} + +int main(int argc, const char *argv[]) +{ + xpc_main(event_handler); + return 0; +} \ No newline at end of file From 3a52b7a503d95378f59097bb3d6decab6c204b28 Mon Sep 17 00:00:00 2001 From: Oleg Krupnov Date: Tue, 21 Jan 2014 14:55:37 +0200 Subject: [PATCH 2/2] Added XPC service for relaunching from sandboxed mode --- SUXPC.m | 3 +- .../SandboxService-Prefix.pch | 0 .../SandboxService.plist | 0 .../sandbox_service.m | 0 SandboxService/SandboxService-Info.plist | 31 ---- SandboxService/en.lproj/InfoPlist.strings | 2 - SandboxService/main.m | 49 ------- Sparkle.xcodeproj/project.pbxproj | 135 +++++++----------- 8 files changed, 55 insertions(+), 165 deletions(-) rename {SandboxService => Sandbox Service}/SandboxService-Prefix.pch (100%) rename SandboxService.plist => Sandbox Service/SandboxService.plist (100%) rename sandbox_service.m => Sandbox Service/sandbox_service.m (100%) delete mode 100644 SandboxService/SandboxService-Info.plist delete mode 100644 SandboxService/en.lproj/InfoPlist.strings delete mode 100644 SandboxService/main.m diff --git a/SUXPC.m b/SUXPC.m index a732623a..4e978e3b 100644 --- a/SUXPC.m +++ b/SUXPC.m @@ -69,4 +69,5 @@ } } -@end \ No newline at end of file +@end + diff --git a/SandboxService/SandboxService-Prefix.pch b/Sandbox Service/SandboxService-Prefix.pch similarity index 100% rename from SandboxService/SandboxService-Prefix.pch rename to Sandbox Service/SandboxService-Prefix.pch diff --git a/SandboxService.plist b/Sandbox Service/SandboxService.plist similarity index 100% rename from SandboxService.plist rename to Sandbox Service/SandboxService.plist diff --git a/sandbox_service.m b/Sandbox Service/sandbox_service.m similarity index 100% rename from sandbox_service.m rename to Sandbox Service/sandbox_service.m diff --git a/SandboxService/SandboxService-Info.plist b/SandboxService/SandboxService-Info.plist deleted file mode 100644 index 000681be..00000000 --- a/SandboxService/SandboxService-Info.plist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${EXECUTABLE_NAME} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - XPC! - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - XPCService - - JoinExistingSession - - ServiceType - Application - - - diff --git a/SandboxService/en.lproj/InfoPlist.strings b/SandboxService/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff..00000000 --- a/SandboxService/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/SandboxService/main.m b/SandboxService/main.m deleted file mode 100644 index aea62f76..00000000 --- a/SandboxService/main.m +++ /dev/null @@ -1,49 +0,0 @@ -// -// main.m -// SandboxService -// -// Created by UJey on 1/20/14. -// -// - -#include -#include - -static void SandboxService_peer_event_handler(xpc_connection_t peer, xpc_object_t event) -{ - xpc_type_t type = xpc_get_type(event); - if (type == XPC_TYPE_ERROR) { - if (event == XPC_ERROR_CONNECTION_INVALID) { - // The client process on the other end of the connection has either - // crashed or cancelled the connection. After receiving this error, - // the connection is in an invalid state, and you do not need to - // call xpc_connection_cancel(). Just tear down any associated state - // here. - } else if (event == XPC_ERROR_TERMINATION_IMMINENT) { - // Handle per-connection termination cleanup. - } - } else { - assert(type == XPC_TYPE_DICTIONARY); - // Handle the message. - } -} - -static void SandboxService_event_handler(xpc_connection_t peer) -{ - // By defaults, new connections will target the default dispatch - // concurrent queue. - xpc_connection_set_event_handler(peer, ^(xpc_object_t event) { - SandboxService_peer_event_handler(peer, event); - }); - - // This will tell the connection to begin listening for events. If you - // have some other initialization that must be done asynchronously, then - // you can defer this call until after that initialization is done. - xpc_connection_resume(peer); -} - -int main(int argc, const char *argv[]) -{ - xpc_main(SandboxService_event_handler); - return 0; -} diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index c9a2247e..1f03d303 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -7,16 +7,11 @@ objects = { /* Begin PBXBuildFile section */ - 290DE102188D8C6400434ED0 /* SUXPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 290DE100188D8C6400434ED0 /* SUXPC.h */; }; - 290DE103188D8C6400434ED0 /* SUXPC.m in Sources */ = {isa = PBXBuildFile; fileRef = 290DE101188D8C6400434ED0 /* SUXPC.m */; }; 290DE127188D912F00434ED0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE126188D912F00434ED0 /* Foundation.framework */; }; - 290DE12D188D912F00434ED0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 290DE12B188D912F00434ED0 /* InfoPlist.strings */; }; - 290DE130188D912F00434ED0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 290DE12F188D912F00434ED0 /* main.m */; }; 290DE134188D914500434ED0 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55C14F31136EFC2400649790 /* SystemConfiguration.framework */; }; 290DE136188D914E00434ED0 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE135188D914E00434ED0 /* IOKit.framework */; }; 290DE138188D915800434ED0 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE137188D915800434ED0 /* AppKit.framework */; }; 290DE13A188D916600434ED0 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290DE139188D916600434ED0 /* Security.framework */; }; - 290DE13E188D934A00434ED0 /* sandbox_service.m in Sources */ = {isa = PBXBuildFile; fileRef = 290DE107188D8E3200434ED0 /* sandbox_service.m */; }; 290DE13F188D938F00434ED0 /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; }; 290DE140188D93AC00434ED0 /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */; }; 290DE141188D93B300434ED0 /* SUPlainInstallerInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */; }; @@ -149,7 +144,9 @@ 61F83F720DBFE140006FDD30 /* SUBasicUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */; }; 61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */; settings = {ATTRIBUTES = (); }; }; 61FA52880E2D9EA400EF58AD /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (Required, ); }; }; - 7C2258BA187D86C300638F7C /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8DC2EF5A0486A6940098B216 /* Info.plist */; }; + 7C41C954188E954400EBFECB /* sandbox_service.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C41C950188E954400EBFECB /* sandbox_service.m */; }; + 7C41C95B188E96BC00EBFECB /* SUXPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C41C959188E96BC00EBFECB /* SUXPC.h */; }; + 7C41C95C188E96BC00EBFECB /* SUXPC.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C41C95A188E96BC00EBFECB /* SUXPC.m */; }; 93FB277A156BD80D001937C7 /* SUPasswordPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FB2778156BD80D001937C7 /* SUPasswordPrompt.h */; }; 93FB277B156BD80D001937C7 /* SUPasswordPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 93FB2779156BD80D001937C7 /* SUPasswordPrompt.m */; }; 93FB277F156BD826001937C7 /* SUPasswordPrompt.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93FB277D156BD826001937C7 /* SUPasswordPrompt.xib */; }; @@ -184,6 +181,13 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = Sparkle; }; + 7C41C944188E936F00EBFECB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 290DE123188D912E00434ED0; + remoteInfo = SandboxService; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -209,16 +213,8 @@ 290DE0FD188D84A700434ED0 /* ConfigService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigService.xcconfig; sourceTree = ""; }; 290DE0FE188D84D300434ED0 /* ConfigServiceDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigServiceDebug.xcconfig; sourceTree = ""; }; 290DE0FF188D84F300434ED0 /* ConfigServiceRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigServiceRelease.xcconfig; sourceTree = ""; }; - 290DE100188D8C6400434ED0 /* SUXPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUXPC.h; sourceTree = ""; }; - 290DE101188D8C6400434ED0 /* SUXPC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUXPC.m; sourceTree = ""; }; - 290DE104188D8CB200434ED0 /* SandboxService.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SandboxService.plist; sourceTree = ""; }; - 290DE107188D8E3200434ED0 /* sandbox_service.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = sandbox_service.m; sourceTree = ""; }; 290DE124188D912E00434ED0 /* com.andymatuschak.Sparkle.SandboxService.xpc */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = com.andymatuschak.Sparkle.SandboxService.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; 290DE126188D912F00434ED0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 290DE12A188D912F00434ED0 /* SandboxService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SandboxService-Info.plist"; sourceTree = ""; }; - 290DE12C188D912F00434ED0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 290DE12E188D912F00434ED0 /* SandboxService-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SandboxService-Prefix.pch"; sourceTree = ""; }; - 290DE12F188D912F00434ED0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 290DE135188D914E00434ED0 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 290DE137188D915800434ED0 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 290DE139188D916600434ED0 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; @@ -436,6 +432,11 @@ 61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBasicUpdateDriver.h; sourceTree = ""; }; 61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBasicUpdateDriver.m; sourceTree = ""; }; 7C2258B9187D86C300638F7C /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/SUPasswordPrompt.xib; sourceTree = ""; }; + 7C41C950188E954400EBFECB /* sandbox_service.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = sandbox_service.m; sourceTree = ""; }; + 7C41C951188E954400EBFECB /* SandboxService.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SandboxService.plist; sourceTree = ""; }; + 7C41C957188E95D500EBFECB /* SandboxService-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SandboxService-Prefix.pch"; sourceTree = ""; }; + 7C41C959188E96BC00EBFECB /* SUXPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUXPC.h; sourceTree = ""; }; + 7C41C95A188E96BC00EBFECB /* SUXPC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUXPC.m; sourceTree = ""; }; 7CE02099187E7F0100D88621 /* pl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pl; path = pl.lproj/SUPasswordPrompt.xib; sourceTree = ""; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* Sparkle.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -546,7 +547,7 @@ 0867D691FE84028FC02AAC07 /* Sparkle */ = { isa = PBXGroup; children = ( - 290DE13B188D930100434ED0 /* Sandbox Service */, + 7C41C94F188E954400EBFECB /* Sandbox Service */, 61F83F6E0DBFE07A006FDD30 /* Update Control */, 61299B3909CB055000B7442F /* Appcast Support */, 618FA6DB0DB485440026945C /* Installation */, @@ -559,7 +560,6 @@ 61B5F91D09C4CF7F00B25A18 /* Test Application Sources */, 0867D69AFE84028FC02AAC07 /* Apple Frameworks and Libraries */, FA1941C40D94A6EA00DD942E /* Configurations */, - 290DE128188D912F00434ED0 /* SandboxService */, 290DE125188D912E00434ED0 /* Frameworks */, 034768DFFF38A50411DB9C8B /* Products */, ); @@ -611,52 +611,6 @@ name = Frameworks; sourceTree = ""; }; - 290DE128188D912F00434ED0 /* SandboxService */ = { - isa = PBXGroup; - children = ( - 290DE12F188D912F00434ED0 /* main.m */, - 290DE129188D912F00434ED0 /* Supporting Files */, - ); - path = SandboxService; - sourceTree = ""; - }; - 290DE129188D912F00434ED0 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 290DE12A188D912F00434ED0 /* SandboxService-Info.plist */, - 290DE12B188D912F00434ED0 /* InfoPlist.strings */, - 290DE12E188D912F00434ED0 /* SandboxService-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 290DE13B188D930100434ED0 /* Sandbox Service */ = { - isa = PBXGroup; - children = ( - 290DE13C188D931800434ED0 /* Service */, - 290DE13D188D932000434ED0 /* Interface */, - ); - name = "Sandbox Service"; - sourceTree = ""; - }; - 290DE13C188D931800434ED0 /* Service */ = { - isa = PBXGroup; - children = ( - 290DE107188D8E3200434ED0 /* sandbox_service.m */, - 290DE104188D8CB200434ED0 /* SandboxService.plist */, - ); - name = Service; - sourceTree = ""; - }; - 290DE13D188D932000434ED0 /* Interface */ = { - isa = PBXGroup; - children = ( - 290DE100188D8C6400434ED0 /* SUXPC.h */, - 290DE101188D8C6400434ED0 /* SUXPC.m */, - ); - name = Interface; - sourceTree = ""; - }; 55C14BD5136EEFD000649790 /* finish_installation tool */ = { isa = PBXGroup; children = ( @@ -828,6 +782,8 @@ 61F83F6E0DBFE07A006FDD30 /* Update Control */ = { isa = PBXGroup; children = ( + 7C41C959188E96BC00EBFECB /* SUXPC.h */, + 7C41C95A188E96BC00EBFECB /* SUXPC.m */, 61CFB2C20E38496B007A1735 /* Drivers */, 61CFB2C10E384958007A1735 /* Support */, 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */, @@ -837,6 +793,16 @@ name = "Update Control"; sourceTree = ""; }; + 7C41C94F188E954400EBFECB /* Sandbox Service */ = { + isa = PBXGroup; + children = ( + 7C41C957188E95D500EBFECB /* SandboxService-Prefix.pch */, + 7C41C950188E954400EBFECB /* sandbox_service.m */, + 7C41C951188E954400EBFECB /* SandboxService.plist */, + ); + path = "Sandbox Service"; + sourceTree = ""; + }; FA1941C40D94A6EA00DD942E /* Configurations */ = { isa = PBXGroup; children = ( @@ -875,7 +841,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 290DE102188D8C6400434ED0 /* SUXPC.h in Headers */, + 7C41C95B188E96BC00EBFECB /* SUXPC.h in Headers */, 61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */, 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */, 61B5FC0D09C4FC8200B25A18 /* SUAppcast.h in Headers */, @@ -1028,6 +994,7 @@ buildRules = ( ); dependencies = ( + 7C41C945188E936F00EBFECB /* PBXTargetDependency */, 55C14F97136F044100649790 /* PBXTargetDependency */, ); name = Sparkle; @@ -1109,7 +1076,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 290DE12D188D912F00434ED0 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1153,7 +1119,6 @@ 55C14C04136EF26100649790 /* SUUpdateAlert.xib in Resources */, 55C14C19136EF2C700649790 /* SUUpdatePermissionPrompt.xib in Resources */, 55C14F3B136EFCB300649790 /* finish_installation.app in Resources */, - 7C2258BA187D86C300638F7C /* Info.plist in Resources */, 93FB277F156BD826001937C7 /* SUPasswordPrompt.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1242,10 +1207,9 @@ files = ( 290DE141188D93B300434ED0 /* SUPlainInstallerInternals.m in Sources */, 290DE140188D93AC00434ED0 /* SUPlainInstaller.m in Sources */, + 7C41C954188E954400EBFECB /* sandbox_service.m in Sources */, 290DE13F188D938F00434ED0 /* SUInstaller.m in Sources */, - 290DE130188D912F00434ED0 /* main.m in Sources */, 290DE144188D93FA00434ED0 /* SULog.m in Sources */, - 290DE13E188D934A00434ED0 /* sandbox_service.m in Sources */, 290DE143188D93EB00434ED0 /* SUConstants.m in Sources */, 290DE142188D93C800434ED0 /* SUPackageInstaller.m in Sources */, ); @@ -1301,7 +1265,7 @@ files = ( 61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */, 61B5F8EF09C4CE3C00B25A18 /* SUPlainInstallerInternals.m in Sources */, - 290DE103188D8C6400434ED0 /* SUXPC.m in Sources */, + 7C41C95C188E96BC00EBFECB /* SUXPC.m in Sources */, 61B5FBB709C4FAFF00B25A18 /* SUAppcast.m in Sources */, 61B5FC6F09C51F4900B25A18 /* SUAppcastItem.m in Sources */, 61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */, @@ -1362,17 +1326,14 @@ target = 8DC2EF4F0486A6940098B216 /* Sparkle */; targetProxy = 61FA528C0E2D9EB200EF58AD /* PBXContainerItemProxy */; }; + 7C41C945188E936F00EBFECB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 290DE123188D912E00434ED0 /* SandboxService */; + targetProxy = 7C41C944188E936F00EBFECB /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 290DE12B188D912F00434ED0 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 290DE12C188D912F00434ED0 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; 55C14BDA136EF20D00649790 /* SUAutomaticUpdateAlert.xib */ = { isa = PBXVariantGroup; children = ( @@ -1542,6 +1503,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; COMBINE_HIDPI_IMAGES = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; SDKROOT = macosx; }; name = Debug; @@ -1552,6 +1514,8 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; COMBINE_HIDPI_IMAGES = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; SDKROOT = macosx; }; name = Release; @@ -1584,7 +1548,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_ARC = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; @@ -1600,7 +1564,7 @@ GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SandboxService/SandboxService-Prefix.pch"; + GCC_PREFIX_HEADER = "Sandbox Service/SandboxService-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -1612,7 +1576,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "SandboxService/SandboxService-Info.plist"; + INFOPLIST_FILE = "Sandbox Service/SandboxService.plist"; MACH_O_TYPE = mh_execute; MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = "com.andymatuschak.Sparkle.$(TARGET_NAME:rfc1034identifier)"; @@ -1626,7 +1590,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_ARC = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; @@ -1642,14 +1606,14 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SandboxService/SandboxService-Prefix.pch"; + GCC_PREFIX_HEADER = "Sandbox Service/SandboxService-Prefix.pch"; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "SandboxService/SandboxService-Info.plist"; + INFOPLIST_FILE = "Sandbox Service/SandboxService.plist"; MACH_O_TYPE = mh_execute; MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = "com.andymatuschak.Sparkle.$(TARGET_NAME:rfc1034identifier)"; @@ -1670,6 +1634,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = finish_installation.pch; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; INFOPLIST_FILE = "finish_installation-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; OTHER_LDFLAGS = ( @@ -1695,6 +1660,8 @@ GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = finish_installation.pch; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; INFOPLIST_FILE = "finish_installation-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; OTHER_LDFLAGS = ( @@ -1723,6 +1690,7 @@ baseConfigurationReference = 5D06E8F30FD68D21005AE3F6 /* ConfigBinaryDeltaRelease.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; SDKROOT = macosx; }; name = Release; @@ -1743,6 +1711,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; COMBINE_HIDPI_IMAGES = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; SDKROOT = macosx; }; name = Release; @@ -1763,6 +1732,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; COMBINE_HIDPI_IMAGES = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; SDKROOT = macosx; }; name = Release; @@ -1795,6 +1765,7 @@ 290DE133188D912F00434ED0 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 55C14BBE136EEF1500649790 /* Build configuration list for PBXNativeTarget "finish_installation" */ = { isa = XCConfigurationList;