From 4ba453f337e4f19d38c48c1d2f8405ee96f70c9f Mon Sep 17 00:00:00 2001 From: Rudy Richter Date: Tue, 22 May 2012 10:59:20 -0400 Subject: [PATCH 1/9] support for encrypted disk images --- NTSynchronousTask.h | 6 + NTSynchronousTask.m | 1 + SUDiskImageUnarchiver.m | 75 +- SUPasswordPrompt.h | 35 + SUPasswordPrompt.m | 94 +++ SUUpdateDriver.h | 2 + SUUpdateDriver.m | 11 + Sparkle.xcodeproj/project.pbxproj | 110 ++- en.lproj/SUPasswordPrompt.xib | 1194 +++++++++++++++++++++++++++++ ja.lproj/SUPasswordPrompt.xib | 597 +++++++++++++++ 10 files changed, 2118 insertions(+), 7 deletions(-) create mode 100644 SUPasswordPrompt.h create mode 100644 SUPasswordPrompt.m create mode 100644 en.lproj/SUPasswordPrompt.xib create mode 100644 ja.lproj/SUPasswordPrompt.xib diff --git a/NTSynchronousTask.h b/NTSynchronousTask.h index e8510731..be74ce38 100644 --- a/NTSynchronousTask.h +++ b/NTSynchronousTask.h @@ -25,6 +25,12 @@ // returns the result +(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData; ++(NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input; + +- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input; +- (int)result; +- (NSData *)output; + @end #endif diff --git a/NTSynchronousTask.m b/NTSynchronousTask.m index d564d243..1d2e3ef0 100644 --- a/NTSynchronousTask.m +++ b/NTSynchronousTask.m @@ -128,6 +128,7 @@ [[self task] setStandardInput:[self inputPipe]]; [[self task] setStandardOutput:[self outputPipe]]; + [[self task] setStandardError:[self outputPipe]]; } return self; diff --git a/SUDiskImageUnarchiver.m b/SUDiskImageUnarchiver.m index a905ee6b..674e1b1a 100644 --- a/SUDiskImageUnarchiver.m +++ b/SUDiskImageUnarchiver.m @@ -11,7 +11,7 @@ #import "NTSynchronousTask.h" #import "SULog.h" #import - +#import "SUPasswordPrompt.h" @implementation SUDiskImageUnarchiver @@ -48,18 +48,64 @@ } } while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL)); + +/* ASW_ADDITION */ +#pragma mark ASW_ADDITION + BOOL isEncrypted = NO; + NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:[NSArray arrayWithObjects: @"isencrypted", archivePath, nil] input:NULL]; + if([self isEncrypted:result]) + isEncrypted = YES; +/* ASW_ADDITION */ NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen", nil]; // set up a pipe and push "yes" (y works too), this will accept any license agreement crap // not every .dmg needs this, but this will make sure it works with everyone - NSData* yesData = [[[NSData alloc] initWithBytes:"yes\n" length:4] autorelease]; +/* ASW_ADDITION */ +#pragma mark ASW_ADDITION + NSData* promptData; + if(isEncrypted) { + SUPasswordPrompt *prompt = [[SUPasswordPrompt alloc] initWithHost:(SUHost*)[delegate host]]; + if([prompt run]) + { + NSString *password = [prompt password]; + if(![password length]) + goto reportError; + NSString *data = [NSString stringWithFormat:@"%@\nyes\n", password]; + const char *bytes = [data cStringUsingEncoding:NSUTF8StringEncoding]; + NSUInteger length = [data lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + promptData = [NSData dataWithBytes:bytes length:length]; + } + else + { + goto reportError; + } + [prompt release]; + } + else + promptData = [NSData dataWithBytes:"yes\n" length:4]; +/* ASW_ADDITION */ - NSData *output = nil; - int returnCode = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:yesData output: &output]; - if ( returnCode != 0 ) + NSData *output = nil; + NSInteger taskResult = -1; + @try + { + NTSynchronousTask* task = [[NTSynchronousTask alloc] init]; + + [task run:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:promptData]; + + taskResult = [task result]; + output = [[[task output] copy] autorelease]; + [task release]; + } + @catch (NSException *localException) + { + goto reportError; + } + + if (taskResult != 0) { NSString* resultStr = output ? [[[NSString alloc] initWithData: output encoding: NSUTF8StringEncoding] autorelease] : nil; - SULog( @"hdiutil failed with code: %d data: <<%@>>", returnCode, resultStr ); + SULog( @"hdiutil failed with code: %d data: <<%@>>", taskResult, resultStr ); goto reportError; } mountedSuccessfully = YES; @@ -132,4 +178,21 @@ finally: [self registerImplementation:self]; } +/* ASW_ADDITION */ +#pragma mark ASW_ADDITION +- (BOOL)isEncrypted:(NSData*)resultData +{ + BOOL result = NO; + if(resultData) + { + NSString *data = [NSString stringWithCString:(char*)[resultData bytes] encoding:NSUTF8StringEncoding]; + if (!NSEqualRanges([data rangeOfString:@"passphrase-count"], NSMakeRange(NSNotFound, 0))) + { + result = YES; + } + } + return result; +} +/* ASW_ADDITION */ + @end diff --git a/SUPasswordPrompt.h b/SUPasswordPrompt.h new file mode 100644 index 00000000..499bc4e4 --- /dev/null +++ b/SUPasswordPrompt.h @@ -0,0 +1,35 @@ +// +// SUPasswordPrompt.h +// Sparkle +// +// Created by rudy on 8/18/09. +// Copyright 2009 Ambrosia Software, Inc.. All rights reserved. +// + +#import +#import "Sparkle/SUWindowController.h" + +@interface SUPasswordPrompt : SUWindowController +{ + IBOutlet NSImageView *mIconView; + IBOutlet NSTextField *mTextDescription; + IBOutlet NSSecureTextField *mPasswordField; + NSString *mPassword; + NSString *mName; + NSImage *mIcon; +} + +- (id)initWithHost:(SUHost *)aHost; +- (void)awakeFromNib; +- (void)setName:(NSString*)name; +- (NSString*)name; +- (void)setIcon:(NSImage*)icon; +- (NSImage*)icon; +- (NSString *)password; +- (void)setPassword:(NSString*)password; +- (NSInteger)run; +- (IBAction)accept:(id)sender; +- (IBAction)cancel:(id)sender; +- (void)replaceTitle:(NSString*)name; + +@end diff --git a/SUPasswordPrompt.m b/SUPasswordPrompt.m new file mode 100644 index 00000000..6b66cc3a --- /dev/null +++ b/SUPasswordPrompt.m @@ -0,0 +1,94 @@ +// +// SUPasswordPrompt.m +// Sparkle +// +// Created by rudy on 8/18/09. +// Copyright 2009 Ambrosia Software, Inc.. All rights reserved. +// + +#import "SUPasswordPrompt.h" + + +@implementation SUPasswordPrompt + +- (id)initWithHost:(SUHost *)aHost +{ + self = [super initWithHost:aHost windowNibName:@"SUPasswordPrompt"]; + if (self) + { + [self setName:[aHost name]]; + [self setIcon:[aHost icon]]; + mPassword = nil; + [self setShouldCascadeWindows:NO]; + } + return self; +} + +- (void)awakeFromNib +{ + [self replaceTitle:[self name]]; + [mIconView setImage:[self icon]]; +} + +- (void)setName:(NSString*)name +{ + [mName release]; + mName = [name retain]; +} + +- (NSString*)name +{ + return mName; +} + +- (void)setIcon:(NSImage*)icon +{ + [mIcon release]; + mIcon = [icon retain]; +} + +- (NSImage*)icon +{ + return mIcon; +} + +- (NSString *)password +{ + return mPassword; +} + +- (void)setPassword:(NSString*)password +{ + [mPassword release]; + mPassword = [password retain]; +} + +- (NSInteger)run +{ + //modally run a password prompt + NSInteger result = [NSApp runModalForWindow:[self window]]; + if(result) + [self setPassword:[mPasswordField stringValue]]; + return result; +} + +- (IBAction)accept:(id)sender +{ + [[self window] orderOut:self]; + [NSApp stopModalWithCode:1]; +} + +- (IBAction)cancel:(id)sender +{ + [[self window] orderOut:self]; + [NSApp stopModalWithCode:0]; +} + +- (void)replaceTitle:(NSString*)name +{ + NSString *textString = [mTextDescription stringValue]; + NSString *replacementString = [textString stringByReplacingOccurrencesOfString:@"" withString:name]; + [mTextDescription setStringValue:replacementString]; +} + +@end diff --git a/SUUpdateDriver.h b/SUUpdateDriver.h index 1a305d11..9e8a73e2 100644 --- a/SUUpdateDriver.h +++ b/SUUpdateDriver.h @@ -27,6 +27,8 @@ extern NSString * const SUUpdateDriverFinishedNotification; - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host; - (void)abortUpdate; - (BOOL)finished; +- (SUHost*)host; +- (void)setHost:(SUHost*)newHost; @end diff --git a/SUUpdateDriver.m b/SUUpdateDriver.m index d98282a9..e1bae4ee 100644 --- a/SUUpdateDriver.m +++ b/SUUpdateDriver.m @@ -42,4 +42,15 @@ NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished"; [super dealloc]; } +- (SUHost*)host +{ + return host; +} + +- (void)setHost:(SUHost*)newHost +{ + [host release]; + host = [newHost retain]; +} + @end diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 022976a5..0d550897 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -131,6 +131,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, ); }; }; + 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 */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -318,7 +321,7 @@ 6160FD85134ABCD5007FFC5F /* tr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Sparkle.strings; sourceTree = ""; }; 6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = ""; }; 618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = ""; }; - 618E9CFC0E7328F1004646D8 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = "Test Application/dsa_pub.pem"; sourceTree = ""; }; + 618E9CFC0E7328F1004646D8 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = ../../config/dsa_pub.pem; sourceTree = ""; }; 618FA4FF0DAE88B40026945C /* SUInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstaller.h; sourceTree = ""; }; 618FA5000DAE88B40026945C /* SUInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstaller.m; sourceTree = ""; }; 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPlainInstaller.h; sourceTree = ""; }; @@ -381,6 +384,10 @@ 61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBasicUpdateDriver.m; 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; }; + 93FB2778156BD80D001937C7 /* SUPasswordPrompt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPasswordPrompt.h; sourceTree = ""; }; + 93FB2779156BD80D001937C7 /* SUPasswordPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPasswordPrompt.m; sourceTree = ""; }; + 93FB277E156BD826001937C7 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SUPasswordPrompt.xib; sourceTree = ""; }; + 93FB2780156BE06F001937C7 /* ja */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ja; path = ja.lproj/SUPasswordPrompt.xib; sourceTree = ""; }; FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigFrameworkDebug.xcconfig; sourceTree = ""; }; FA1941CB0D94A70100DD942E /* ConfigTestAppDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigTestAppDebug.xcconfig; sourceTree = ""; }; FA1941CC0D94A70100DD942E /* ConfigCommonRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigCommonRelease.xcconfig; sourceTree = ""; }; @@ -518,6 +525,7 @@ 55C14BF0136EF26100649790 /* SUUpdateAlert.xib */, 55C14BDA136EF20D00649790 /* SUAutomaticUpdateAlert.xib */, 55C14BD8136EF00C00649790 /* SUStatus.xib */, + 93FB277D156BD826001937C7 /* SUPasswordPrompt.xib */, ); name = "Framework Resources"; sourceTree = ""; @@ -608,6 +616,8 @@ 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */, 61180BC80D64138900B4E0D1 /* SUWindowController.h */, 61180BC90D64138900B4E0D1 /* SUWindowController.m */, + 93FB2778156BD80D001937C7 /* SUPasswordPrompt.h */, + 93FB2779156BD80D001937C7 /* SUPasswordPrompt.m */, ); name = "User Interface"; sourceTree = ""; @@ -772,6 +782,7 @@ 55C14F06136EF6DB00649790 /* SULog.h in Headers */, 55C14F0F136EF73600649790 /* finish_installation.pch in Headers */, 6158A1C5137904B300487EC1 /* SUUpdater_Private.h in Headers */, + 93FB277A156BD80D001937C7 /* SUPasswordPrompt.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -862,6 +873,7 @@ 6131B1910DDCDE32005215F0 /* Run Script: Set git Version Info */, 6195D4B40E40505A00D41A50 /* Run Script: Link fr_CA to fr */, 61E31A85103299750051D188 /* Run Script: Link pt to pt_BR */, + 93FB26EC15670DF5001937C7 /* Add SVN Revision */, ); buildRules = ( ); @@ -981,6 +993,7 @@ 55C14C04136EF26100649790 /* SUUpdateAlert.xib in Resources */, 55C14C19136EF2C700649790 /* SUUpdatePermissionPrompt.xib in Resources */, 55C14F3B136EFCB300649790 /* finish_installation.app in Resources */, + 93FB277F156BD826001937C7 /* SUPasswordPrompt.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1059,6 +1072,20 @@ shellPath = "/usr/bin/env ruby"; shellScript = "resources = \"#{ENV[\"BUILT_PRODUCTS_DIR\"]}/#{ENV[\"WRAPPER_NAME\"]}/Resources\"\n`ln -sfh \"pt_BR.lproj\" \"#{resources}/pt.lproj\"`"; }; + 93FB26EC15670DF5001937C7 /* Add SVN Revision */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Add SVN Revision"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "$SVNROOT/utilities/add-svn-revision.rb --source $SRCROOT --plist $BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\n"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1144,6 +1171,7 @@ 5D06E8ED0FD68CE4005AE3F6 /* SUBinaryDeltaCommon.m in Sources */, 5D06E93A0FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m in Sources */, 55C14F07136EF6DB00649790 /* SULog.m in Sources */, + 93FB277B156BD80D001937C7 /* SUPasswordPrompt.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1307,6 +1335,15 @@ name = MainMenu.nib; sourceTree = ""; }; + 93FB277D156BD826001937C7 /* SUPasswordPrompt.xib */ = { + isa = PBXVariantGroup; + children = ( + 93FB277E156BD826001937C7 /* en */, + 93FB2780156BE06F001937C7 /* ja */, + ); + name = SUPasswordPrompt.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -1314,6 +1351,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */; buildSettings = { + IBC_FLATTEN_NIBS = NO; }; name = Debug; }; @@ -1321,18 +1359,21 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */; buildSettings = { + IBC_FLATTEN_NIBS = YES; }; name = Release; }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + SVNROOT = ../..; }; name = Debug; }; 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + SVNROOT = ../..; }; name = Release; }; @@ -1426,6 +1467,7 @@ 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { isa = XCBuildConfiguration; buildSettings = { + SVNROOT = ../..; }; name = "Release (GC dual-mode; 10.5+)"; }; @@ -1433,6 +1475,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */; buildSettings = { + IBC_FLATTEN_NIBS = YES; }; name = "Release (GC dual-mode; 10.5+)"; }; @@ -1478,6 +1521,65 @@ }; name = Release; }; + 93FB264815670931001937C7 /* Beta */ = { + isa = XCBuildConfiguration; + buildSettings = { + SVNROOT = ../..; + }; + name = Beta; + }; + 93FB264915670931001937C7 /* Beta */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */; + buildSettings = { + IBC_FLATTEN_NIBS = NO; + }; + name = Beta; + }; + 93FB264A15670931001937C7 /* Beta */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA1941D20D94A70100DD942E /* ConfigTestAppRelease.xcconfig */; + buildSettings = { + }; + name = Beta; + }; + 93FB264B15670931001937C7 /* Beta */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA3AAF391050B273004B3130 /* ConfigUnitTestRelease.xcconfig */; + buildSettings = { + }; + name = Beta; + }; + 93FB264C15670931001937C7 /* Beta */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5D06E8F30FD68D21005AE3F6 /* ConfigBinaryDeltaRelease.xcconfig */; + buildSettings = { + }; + name = Beta; + }; + 93FB264D15670931001937C7 /* Beta */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + 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; + ZERO_LINK = NO; + }; + name = Beta; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1486,6 +1588,7 @@ buildConfigurations = ( 1DEB91AE08733DA50010E9CD /* Debug */, 1DEB91AF08733DA50010E9CD /* Release */, + 93FB264915670931001937C7 /* Beta */, 61072EAE0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1496,6 +1599,7 @@ buildConfigurations = ( 1DEB91B208733DA50010E9CD /* Debug */, 1DEB91B308733DA50010E9CD /* Release */, + 93FB264815670931001937C7 /* Beta */, 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1506,6 +1610,7 @@ buildConfigurations = ( 55C14BBB136EEF1500649790 /* Debug */, 55C14BBC136EEF1500649790 /* Release */, + 93FB264D15670931001937C7 /* Beta */, 55C14BBD136EEF1500649790 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1516,6 +1621,7 @@ buildConfigurations = ( 5D06E8D20FD68C7D005AE3F6 /* Debug */, 5D06E8D30FD68C7D005AE3F6 /* Release */, + 93FB264C15670931001937C7 /* Beta */, 5D06E8D40FD68C7D005AE3F6 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1526,6 +1632,7 @@ buildConfigurations = ( 612279DB0DB5470300AB99EA /* Debug */, 612279DC0DB5470300AB99EA /* Release */, + 93FB264B15670931001937C7 /* Beta */, 61072EB10DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1536,6 +1643,7 @@ buildConfigurations = ( 61B5F90609C4CEE300B25A18 /* Debug */, 61B5F90709C4CEE300B25A18 /* Release */, + 93FB264A15670931001937C7 /* Beta */, 61072EAF0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; diff --git a/en.lproj/SUPasswordPrompt.xib b/en.lproj/SUPasswordPrompt.xib new file mode 100644 index 00000000..41cba084 --- /dev/null +++ b/en.lproj/SUPasswordPrompt.xib @@ -0,0 +1,1194 @@ + + + + 1050 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 788 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + SUPasswordPrompt + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 372}, {362, 138}} + 544736256 + Password + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + + YES + + + 268 + {{90, 48}, {252, 22}} + + YES + + 343014976 + 272630784 + + + LucidaGrande + 13 + 1044 + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + YES + NSAllRomanInputSourcesLocaleIdentifier + + + + + + 268 + {{17, 51}, {68, 17}} + + YES + + 68288064 + 272630784 + Password: + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + + + + 268 + {{252, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + OK + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + {{156, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + Gw + 200 + 25 + + + + + 268 + {{73, 78}, {285, 48}} + + YES + + 67239424 + 272629760 + Enter password to Update <APPLICATION> + + LucidaGrande + 13 + 16 + + + + + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{20, 78}, {48, 48}} + + YES + + 130560 + 33554432 + 0 + 0 + 0 + NO + + YES + + + {362, 138} + + + {{0, 0}, {1680, 1028}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + mPasswordField + + + + 19 + + + + window + + + + 20 + + + + cancel: + + + + 21 + + + + accept: + + + + 22 + + + + mTextDescription + + + + 25 + + + + mIconView + + + + 26 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 5 + + + YES + + + + + + 6 + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 15 + + + YES + + + + + + 16 + + + + + 17 + + + YES + + + + + + 18 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 2.IBPluginDependency + 3.IBPluginDependency + 4.IBPluginDependency + 5.IBPluginDependency + 6.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + {{316, 826}, {362, 138}} + com.apple.InterfaceBuilder.CocoaPlugin + {{316, 826}, {362, 138}} + + {196, 240} + {{202, 428}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 26 + + + + YES + + NSObject + + IBProjectSource + SUAppcast.h + + + + NSObject + + IBProjectSource + SUAutomaticUpdateAlert.h + + + + NSObject + + IBProjectSource + SUInstaller.h + + + + NSObject + + IBProjectSource + SUUnarchiver.h + + + + NSObject + + IBProjectSource + SUUpdateAlert.h + + + + NSObject + + IBProjectSource + SUUpdatePermissionPrompt.h + + + + NSObject + + IBProjectSource + SUUpdater.h + + + + SUPasswordPrompt + SUWindowController + + YES + + YES + accept: + cancel: + + + YES + id + id + + + + YES + + YES + accept: + cancel: + + + YES + + accept: + id + + + cancel: + id + + + + + YES + + YES + mIconView + mPasswordField + mTextDescription + + + YES + NSImageView + NSSecureTextField + NSTextField + + + + YES + + YES + mIconView + mPasswordField + mTextDescription + + + YES + + mIconView + NSImageView + + + mPasswordField + NSSecureTextField + + + mTextDescription + NSTextField + + + + + IBProjectSource + SUPasswordPrompt.h + + + + SUWindowController + NSWindowController + + IBProjectSource + SUWindowController.h + + + + + YES + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBDocumentRelativeSource + ../../../../../../../../../../Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindowController.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSSecureTextField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSecureTextField.h + + + + NSSecureTextFieldCell + NSTextFieldCell + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../Sparkle.xcodeproj + 3 + + diff --git a/ja.lproj/SUPasswordPrompt.xib b/ja.lproj/SUPasswordPrompt.xib new file mode 100644 index 00000000..62243272 --- /dev/null +++ b/ja.lproj/SUPasswordPrompt.xib @@ -0,0 +1,597 @@ + + + + 1050 + 11B26 + 1617 + 1138 + 566.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1617 + + + YES + NSTextField + NSView + NSWindowTemplate + NSSecureTextField + NSTextFieldCell + NSImageView + NSButtonCell + NSImageCell + NSButton + NSSecureTextFieldCell + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + + + YES + + SUPasswordPrompt + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 372}, {362, 138}} + 544736256 + パスワード + NSWindow + + + + + 256 + + YES + + + 268 + {{90, 48}, {252, 22}} + + + YES + + 343014976 + 272630784 + + + LucidaGrande + 13 + 1044 + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + YES + NSAllRomanInputSourcesLocaleIdentifier + + + + + + 268 + {{11, 51}, {74, 17}} + + + YES + + 68288064 + 272630784 + パスワード: + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + + + + 268 + {{252, 12}, {96, 32}} + + + YES + + 67239424 + 134217728 + OK + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 268 + {{156, 12}, {96, 32}} + + + YES + + 67239424 + 134217728 + 取消す + + + -2038284033 + 1 + + + Gw + 200 + 25 + + + + + 268 + {{73, 78}, {285, 48}} + + + YES + + 67239424 + 272629760 + <APPLICATION> の更新パスワードを入力 + + LucidaGrande + 13 + 16 + + + + + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{20, 78}, {48, 48}} + + + YES + + 130560 + 33554432 + 0 + 0 + 0 + NO + + YES + + + {362, 138} + + + + {{0, 0}, {1920, 1178}} + {10000000000000, 10000000000000} + YES + + + + + YES + + + mPasswordField + + + + 19 + + + + window + + + + 20 + + + + cancel: + + + + 21 + + + + accept: + + + + 22 + + + + mTextDescription + + + + 25 + + + + mIconView + + + + 26 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 5 + + + YES + + + + + + 6 + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 15 + + + YES + + + + + + 16 + + + + + 17 + + + YES + + + + + + 18 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 10.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 2.IBPluginDependency + 3.IBPluginDependency + 4.IBPluginDependency + 5.IBPluginDependency + 6.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{857, 608}, {362, 138}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 26 + + + + YES + + SUPasswordPrompt + SUWindowController + + YES + + YES + accept: + cancel: + + + YES + id + id + + + + YES + + YES + accept: + cancel: + + + YES + + accept: + id + + + cancel: + id + + + + + YES + + YES + mIconView + mPasswordField + mTextDescription + + + YES + NSImageView + NSSecureTextField + NSTextField + + + + YES + + YES + mIconView + mPasswordField + mTextDescription + + + YES + + mIconView + NSImageView + + + mPasswordField + NSSecureTextField + + + mTextDescription + NSTextField + + + + + IBProjectSource + ./Classes/SUPasswordPrompt.h + + + + SUWindowController + NSWindowController + + IBProjectSource + ./Classes/SUWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + From 0a3051349a6c9d3b614b5100326e49198ce3bc00 Mon Sep 17 00:00:00 2001 From: Rudy Richter Date: Wed, 23 May 2012 17:11:31 -0400 Subject: [PATCH 2/9] remove the ASW tags since we're submitting this as a pull request to andy --- SUDiskImageUnarchiver.m | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/SUDiskImageUnarchiver.m b/SUDiskImageUnarchiver.m index 674e1b1a..45220b68 100644 --- a/SUDiskImageUnarchiver.m +++ b/SUDiskImageUnarchiver.m @@ -49,19 +49,15 @@ } while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL)); -/* ASW_ADDITION */ -#pragma mark ASW_ADDITION BOOL isEncrypted = NO; NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:[NSArray arrayWithObjects: @"isencrypted", archivePath, nil] input:NULL]; if([self isEncrypted:result]) isEncrypted = YES; -/* ASW_ADDITION */ NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen", nil]; // set up a pipe and push "yes" (y works too), this will accept any license agreement crap // not every .dmg needs this, but this will make sure it works with everyone -/* ASW_ADDITION */ -#pragma mark ASW_ADDITION + NSData* promptData; if(isEncrypted) { SUPasswordPrompt *prompt = [[SUPasswordPrompt alloc] initWithHost:(SUHost*)[delegate host]]; @@ -83,7 +79,6 @@ } else promptData = [NSData dataWithBytes:"yes\n" length:4]; -/* ASW_ADDITION */ NSData *output = nil; NSInteger taskResult = -1; @@ -178,8 +173,6 @@ finally: [self registerImplementation:self]; } -/* ASW_ADDITION */ -#pragma mark ASW_ADDITION - (BOOL)isEncrypted:(NSData*)resultData { BOOL result = NO; @@ -193,6 +186,5 @@ finally: } return result; } -/* ASW_ADDITION */ @end From 9c8e825289e60557d72cea22aac82214973bcbb8 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 26 Jun 2012 18:43:52 -0700 Subject: [PATCH 3/9] Removed methods from SUPasswordPrompt.h that didn't need to be exposed there --- SUPasswordPrompt.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/SUPasswordPrompt.h b/SUPasswordPrompt.h index 499bc4e4..c70372a5 100644 --- a/SUPasswordPrompt.h +++ b/SUPasswordPrompt.h @@ -20,16 +20,7 @@ } - (id)initWithHost:(SUHost *)aHost; -- (void)awakeFromNib; -- (void)setName:(NSString*)name; -- (NSString*)name; -- (void)setIcon:(NSImage*)icon; -- (NSImage*)icon; -- (NSString *)password; -- (void)setPassword:(NSString*)password; - (NSInteger)run; -- (IBAction)accept:(id)sender; -- (IBAction)cancel:(id)sender; -- (void)replaceTitle:(NSString*)name; +- (NSString *)password; @end From a4082a0e54a80160a5e1b46dfad4a56525473658 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 26 Jun 2012 18:44:55 -0700 Subject: [PATCH 4/9] Redesigned password prompt UI --- SUPasswordPrompt.m | 8 - en.lproj/SUPasswordPrompt.xib | 768 ++++------------------------------ 2 files changed, 90 insertions(+), 686 deletions(-) diff --git a/SUPasswordPrompt.m b/SUPasswordPrompt.m index 6b66cc3a..4cff46dc 100644 --- a/SUPasswordPrompt.m +++ b/SUPasswordPrompt.m @@ -26,7 +26,6 @@ - (void)awakeFromNib { - [self replaceTitle:[self name]]; [mIconView setImage:[self icon]]; } @@ -84,11 +83,4 @@ [NSApp stopModalWithCode:0]; } -- (void)replaceTitle:(NSString*)name -{ - NSString *textString = [mTextDescription stringValue]; - NSString *replacementString = [textString stringByReplacingOccurrencesOfString:@"" withString:name]; - [mTextDescription setStringValue:replacementString]; -} - @end diff --git a/en.lproj/SUPasswordPrompt.xib b/en.lproj/SUPasswordPrompt.xib index 41cba084..2002c8e7 100644 --- a/en.lproj/SUPasswordPrompt.xib +++ b/en.lproj/SUPasswordPrompt.xib @@ -2,30 +2,35 @@ 1050 - 10F569 - 788 - 1038.29 - 461.00 + 12A251 + 2488 + 1183 + 622.00 com.apple.InterfaceBuilder.CocoaPlugin - 788 + 2488 - + YES - + NSButton + NSButtonCell + NSCustomObject + NSImageCell + NSImageView + NSSecureTextField + NSSecureTextFieldCell + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate YES com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -41,12 +46,12 @@ 1 2 - {{196, 372}, {362, 138}} + {{196, 372}, {394, 118}} 544736256 Password NSWindow - {1.79769e+308, 1.79769e+308} + 256 @@ -54,12 +59,14 @@ YES - 268 - {{90, 48}, {252, 22}} + 290 + {{179, 49}, {195, 22}} + + YES - 343014976 + 342884416 272630784 @@ -92,15 +99,18 @@ NSAllRomanInputSourcesLocaleIdentifier + NO - 268 - {{17, 51}, {68, 17}} + 292 + {{106, 51}, {68, 17}} + + YES - 68288064 + 68157504 272630784 Password: @@ -121,59 +131,67 @@ + NO - 268 - {{252, 12}, {96, 32}} + 289 + {{297, 13}, {83, 32}} + YES - 67239424 + 67108864 134217728 - OK + Unlock - -2038284033 + -2038284288 129 DQ 200 25 + NO - 268 - {{156, 12}, {96, 32}} + 289 + {{215, 13}, {82, 32}} + + YES - 67239424 + 67108864 134217728 Cancel - -2038284033 + -2038284288 129 Gw 200 25 + NO - 268 - {{73, 78}, {285, 48}} + 266 + {{106, 86}, {271, 17}} + + YES - 67239424 + 67108864 272629760 - Enter password to Update <APPLICATION> + This update is locked with a password. - LucidaGrande + LucidaGrande-Bold 13 16 @@ -181,6 +199,7 @@ + NO @@ -197,25 +216,31 @@ NeXT TIFF v4.0 pasteboard type - {{20, 78}, {48, 48}} + {{20, 39}, {64, 64}} + + YES - 130560 + 0 33554432 0 0 0 NO + NO YES - {362, 138} + {394, 118} + + - {{0, 0}, {1680, 1028}} - {1.79769e+308, 1.79769e+308} + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + YES @@ -275,7 +300,9 @@ YES 0 - + + YES + @@ -313,8 +340,8 @@ YES - + @@ -410,12 +437,12 @@ YES YES - 1.IBEditorWindowLastContentRect + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency 1.IBPluginDependency 1.IBWindowTemplateEditedContentRect 1.NSWindowTemplate.visibleAtLaunch - 1.WindowOrigin - 1.editorWindowContentRectSynchronizationRect 10.IBPluginDependency 15.IBPluginDependency 16.IBPluginDependency @@ -430,14 +457,14 @@ 8.IBPluginDependency 9.IBPluginDependency - + YES - {{316, 826}, {362, 138}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{316, 826}, {362, 138}} - {196, 240} - {{202, 428}, {480, 270}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -456,17 +483,13 @@ YES - - YES - + YES - - YES - + 26 @@ -474,55 +497,6 @@ YES - - NSObject - - IBProjectSource - SUAppcast.h - - - - NSObject - - IBProjectSource - SUAutomaticUpdateAlert.h - - - - NSObject - - IBProjectSource - SUInstaller.h - - - - NSObject - - IBProjectSource - SUUnarchiver.h - - - - NSObject - - IBProjectSource - SUUpdateAlert.h - - - - NSObject - - IBProjectSource - SUUpdatePermissionPrompt.h - - - - NSObject - - IBProjectSource - SUUpdater.h - - SUPasswordPrompt SUWindowController @@ -533,7 +507,7 @@ accept: cancel: - + YES id id @@ -546,7 +520,7 @@ accept: cancel: - + YES accept: @@ -566,7 +540,7 @@ mPasswordField mTextDescription - + YES NSImageView NSSecureTextField @@ -581,7 +555,7 @@ mPasswordField mTextDescription - + YES mIconView @@ -599,7 +573,7 @@ IBProjectSource - SUPasswordPrompt.h + ./Classes/SUPasswordPrompt.h @@ -607,588 +581,26 @@ NSWindowController IBProjectSource - SUWindowController.h - - - - - YES - - NSWindowController - NSResponder - - showWindow: - id - - - showWindow: - - showWindow: - id - - - - IBDocumentRelativeSource - ../../../../../../../../../../Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindowController.h - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSImageCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSImageCell.h - - - - NSImageView - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSImageView.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSSecureTextField - NSTextField - - IBFrameworkSource - AppKit.framework/Headers/NSSecureTextField.h - - - - NSSecureTextFieldCell - NSTextFieldCell - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - NSWindowController - NSResponder - - showWindow: - id - - - showWindow: - - showWindow: - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSWindowController.h + ./Classes/SUWindowController.h 0 IBCocoaFramework - + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 YES - ../Sparkle.xcodeproj 3 From ae52d2743e53decccb35aed46f975f2ecd90ba12 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 26 Jun 2012 18:45:41 -0700 Subject: [PATCH 5/9] Removed changes to the project.pbxproj that were unrelated to the password prompt --- Sparkle.xcodeproj/project.pbxproj | 88 +------------------------------ 1 file changed, 1 insertion(+), 87 deletions(-) diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 0d550897..f4a833a0 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -321,7 +321,7 @@ 6160FD85134ABCD5007FFC5F /* tr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Sparkle.strings; sourceTree = ""; }; 6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = ""; }; 618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = ""; }; - 618E9CFC0E7328F1004646D8 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = ../../config/dsa_pub.pem; sourceTree = ""; }; + 618E9CFC0E7328F1004646D8 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = "Test Application/dsa_pub.pem"; sourceTree = ""; }; 618FA4FF0DAE88B40026945C /* SUInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstaller.h; sourceTree = ""; }; 618FA5000DAE88B40026945C /* SUInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstaller.m; sourceTree = ""; }; 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPlainInstaller.h; sourceTree = ""; }; @@ -873,7 +873,6 @@ 6131B1910DDCDE32005215F0 /* Run Script: Set git Version Info */, 6195D4B40E40505A00D41A50 /* Run Script: Link fr_CA to fr */, 61E31A85103299750051D188 /* Run Script: Link pt to pt_BR */, - 93FB26EC15670DF5001937C7 /* Add SVN Revision */, ); buildRules = ( ); @@ -1072,20 +1071,6 @@ shellPath = "/usr/bin/env ruby"; shellScript = "resources = \"#{ENV[\"BUILT_PRODUCTS_DIR\"]}/#{ENV[\"WRAPPER_NAME\"]}/Resources\"\n`ln -sfh \"pt_BR.lproj\" \"#{resources}/pt.lproj\"`"; }; - 93FB26EC15670DF5001937C7 /* Add SVN Revision */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Add SVN Revision"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "$SVNROOT/utilities/add-svn-revision.rb --source $SRCROOT --plist $BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\n"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1351,7 +1336,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */; buildSettings = { - IBC_FLATTEN_NIBS = NO; }; name = Debug; }; @@ -1359,21 +1343,18 @@ isa = XCBuildConfiguration; baseConfigurationReference = FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */; buildSettings = { - IBC_FLATTEN_NIBS = YES; }; name = Release; }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - SVNROOT = ../..; }; name = Debug; }; 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - SVNROOT = ../..; }; name = Release; }; @@ -1467,7 +1448,6 @@ 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { isa = XCBuildConfiguration; buildSettings = { - SVNROOT = ../..; }; name = "Release (GC dual-mode; 10.5+)"; }; @@ -1475,7 +1455,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */; buildSettings = { - IBC_FLATTEN_NIBS = YES; }; name = "Release (GC dual-mode; 10.5+)"; }; @@ -1521,65 +1500,6 @@ }; name = Release; }; - 93FB264815670931001937C7 /* Beta */ = { - isa = XCBuildConfiguration; - buildSettings = { - SVNROOT = ../..; - }; - name = Beta; - }; - 93FB264915670931001937C7 /* Beta */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */; - buildSettings = { - IBC_FLATTEN_NIBS = NO; - }; - name = Beta; - }; - 93FB264A15670931001937C7 /* Beta */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941D20D94A70100DD942E /* ConfigTestAppRelease.xcconfig */; - buildSettings = { - }; - name = Beta; - }; - 93FB264B15670931001937C7 /* Beta */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA3AAF391050B273004B3130 /* ConfigUnitTestRelease.xcconfig */; - buildSettings = { - }; - name = Beta; - }; - 93FB264C15670931001937C7 /* Beta */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D06E8F30FD68D21005AE3F6 /* ConfigBinaryDeltaRelease.xcconfig */; - buildSettings = { - }; - name = Beta; - }; - 93FB264D15670931001937C7 /* Beta */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - 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; - ZERO_LINK = NO; - }; - name = Beta; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1588,7 +1508,6 @@ buildConfigurations = ( 1DEB91AE08733DA50010E9CD /* Debug */, 1DEB91AF08733DA50010E9CD /* Release */, - 93FB264915670931001937C7 /* Beta */, 61072EAE0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1599,7 +1518,6 @@ buildConfigurations = ( 1DEB91B208733DA50010E9CD /* Debug */, 1DEB91B308733DA50010E9CD /* Release */, - 93FB264815670931001937C7 /* Beta */, 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1610,7 +1528,6 @@ buildConfigurations = ( 55C14BBB136EEF1500649790 /* Debug */, 55C14BBC136EEF1500649790 /* Release */, - 93FB264D15670931001937C7 /* Beta */, 55C14BBD136EEF1500649790 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1621,7 +1538,6 @@ buildConfigurations = ( 5D06E8D20FD68C7D005AE3F6 /* Debug */, 5D06E8D30FD68C7D005AE3F6 /* Release */, - 93FB264C15670931001937C7 /* Beta */, 5D06E8D40FD68C7D005AE3F6 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1632,7 +1548,6 @@ buildConfigurations = ( 612279DB0DB5470300AB99EA /* Debug */, 612279DC0DB5470300AB99EA /* Release */, - 93FB264B15670931001937C7 /* Beta */, 61072EB10DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; @@ -1643,7 +1558,6 @@ buildConfigurations = ( 61B5F90609C4CEE300B25A18 /* Debug */, 61B5F90709C4CEE300B25A18 /* Release */, - 93FB264A15670931001937C7 /* Beta */, 61072EAF0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; From d3f975816ea14f3eecd33e5b87b856e72b983c20 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 3 Jul 2012 18:37:50 -0700 Subject: [PATCH 6/9] Delegated password prompting to the update driver. The SUDiskImageUnarchiver shouldn't know about UI, and besides, it's important that update drivers which should not display UI (like the automatically-installing and probing drivers) should not display password prompts. --- SUDiskImageUnarchiver.m | 73 ++++++++++++++++++++++++----------------- SUUIBasedUpdateDriver.m | 14 ++++++++ SUUnarchiver.h | 1 + 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/SUDiskImageUnarchiver.m b/SUDiskImageUnarchiver.m index 45220b68..e0099066 100644 --- a/SUDiskImageUnarchiver.m +++ b/SUDiskImageUnarchiver.m @@ -11,7 +11,6 @@ #import "NTSynchronousTask.h" #import "SULog.h" #import -#import "SUPasswordPrompt.h" @implementation SUDiskImageUnarchiver @@ -20,11 +19,28 @@ return [[path pathExtension] isEqualToString:@"dmg"]; } +// Called on a non-main thread. - (void)extractDMG -{ - // GETS CALLED ON NON-MAIN THREAD!!! +{ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:[NSArray arrayWithObjects: @"isencrypted", archivePath, nil] input:NULL]; + if([self isEncrypted:result] && [delegate respondsToSelector:@selector(unarchiver:requiresPasswordReturnedViaInvocation:)]) { + [self performSelectorOnMainThread:@selector(requestPasswordFromDelegate) withObject:nil waitUntilDone:NO]; + } else { + [self extractDMGWithPassword:nil]; + } + + [pool release]; +} + +// Called on a non-main thread. +- (void)extractDMGWithPassword:(NSString *)password +{ + + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + BOOL mountedSuccessfully = NO; SULog(@"Extracting %@ as a DMG", archivePath); @@ -49,37 +65,18 @@ } while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL)); - BOOL isEncrypted = NO; - NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:[NSArray arrayWithObjects: @"isencrypted", archivePath, nil] input:NULL]; - if([self isEncrypted:result]) - isEncrypted = YES; - - NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen", nil]; - // set up a pipe and push "yes" (y works too), this will accept any license agreement crap - // not every .dmg needs this, but this will make sure it works with everyone - - NSData* promptData; - if(isEncrypted) { - SUPasswordPrompt *prompt = [[SUPasswordPrompt alloc] initWithHost:(SUHost*)[delegate host]]; - if([prompt run]) - { - NSString *password = [prompt password]; - if(![password length]) - goto reportError; - NSString *data = [NSString stringWithFormat:@"%@\nyes\n", password]; - const char *bytes = [data cStringUsingEncoding:NSUTF8StringEncoding]; - NSUInteger length = [data lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; - promptData = [NSData dataWithBytes:bytes length:length]; - } - else - { - goto reportError; - } - [prompt release]; + NSData *promptData = nil; + if (password) { + NSString *data = [NSString stringWithFormat:@"%@\nyes\n", password]; + const char *bytes = [data cStringUsingEncoding:NSUTF8StringEncoding]; + NSUInteger length = [data lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + promptData = [NSData dataWithBytes:bytes length:length]; } else promptData = [NSData dataWithBytes:"yes\n" length:4]; + NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen", nil]; + NSData *output = nil; NSInteger taskResult = -1; @try @@ -92,7 +89,7 @@ output = [[[task output] copy] autorelease]; [task release]; } - @catch (NSException *localException) + @catch (NSException *localException) { goto reportError; } @@ -187,4 +184,18 @@ finally: return result; } +- (void)requestPasswordFromDelegate +{ + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(continueWithPassword:)]]; + [invocation setSelector:@selector(continueWithPassword:)]; + [invocation setTarget:self]; + [invocation retainArguments]; + [delegate unarchiver:self requiresPasswordReturnedViaInvocation:invocation]; +} + +- (void)continueWithPassword:(NSString *)password +{ + [NSThread detachNewThreadSelector:@selector(extractDMGWithPassword:) toTarget:self withObject:password]; +} + @end diff --git a/SUUIBasedUpdateDriver.m b/SUUIBasedUpdateDriver.m index 2b209590..dc37e056 100644 --- a/SUUIBasedUpdateDriver.m +++ b/SUUIBasedUpdateDriver.m @@ -13,6 +13,7 @@ #import "SUHost.h" #import "SUStatusController.h" #import "SUConstants.h" +#import "SUPasswordPrompt.h" @implementation SUUIBasedUpdateDriver @@ -160,6 +161,19 @@ [NSApp requestUserAttention:NSInformationalRequest]; } +- (void)unarchiver:(SUUnarchiver *)unarchiver requiresPasswordReturnedViaInvocation:(NSInvocation *)invocation +{ + SUPasswordPrompt *prompt = [[SUPasswordPrompt alloc] initWithHost:host]; + NSString *password = nil; + if([prompt run]) + { + password = [prompt password]; + } + [prompt release]; + [invocation setArgument:&password atIndex:2]; + [invocation invoke]; +} + - (void)installAndRestart: (id)sender { [self installWithToolAndRelaunch:YES]; diff --git a/SUUnarchiver.h b/SUUnarchiver.h index 261187c5..c726d174 100644 --- a/SUUnarchiver.h +++ b/SUUnarchiver.h @@ -28,6 +28,7 @@ - (void)unarchiver:(SUUnarchiver *)unarchiver extractedLength:(unsigned long)length; - (void)unarchiverDidFinish:(SUUnarchiver *)unarchiver; - (void)unarchiverDidFail:(SUUnarchiver *)unarchiver; +- (void)unarchiver:(SUUnarchiver *)unarchiver requiresPasswordReturnedViaInvocation:(NSInvocation *)invocation; @end #endif From d620dc0b52342c86adf9258705250dca5b6e8f49 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 3 Jul 2012 18:43:22 -0700 Subject: [PATCH 7/9] Removing Japanese localization of the password prompt, since I changed the design --- ja.lproj/SUPasswordPrompt.xib | 597 ---------------------------------- 1 file changed, 597 deletions(-) delete mode 100644 ja.lproj/SUPasswordPrompt.xib diff --git a/ja.lproj/SUPasswordPrompt.xib b/ja.lproj/SUPasswordPrompt.xib deleted file mode 100644 index 62243272..00000000 --- a/ja.lproj/SUPasswordPrompt.xib +++ /dev/null @@ -1,597 +0,0 @@ - - - - 1050 - 11B26 - 1617 - 1138 - 566.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1617 - - - YES - NSTextField - NSView - NSWindowTemplate - NSSecureTextField - NSTextFieldCell - NSImageView - NSButtonCell - NSImageCell - NSButton - NSSecureTextFieldCell - NSCustomObject - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - - - YES - - SUPasswordPrompt - - - FirstResponder - - - NSApplication - - - 1 - 2 - {{196, 372}, {362, 138}} - 544736256 - パスワード - NSWindow - - - - - 256 - - YES - - - 268 - {{90, 48}, {252, 22}} - - - YES - - 343014976 - 272630784 - - - LucidaGrande - 13 - 1044 - - - YES - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 6 - System - textColor - - 3 - MAA - - - - YES - NSAllRomanInputSourcesLocaleIdentifier - - - - - - 268 - {{11, 51}, {74, 17}} - - - YES - - 68288064 - 272630784 - パスワード: - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - - - - 268 - {{252, 12}, {96, 32}} - - - YES - - 67239424 - 134217728 - OK - - - -2038284033 - 1 - - - DQ - 200 - 25 - - - - - 268 - {{156, 12}, {96, 32}} - - - YES - - 67239424 - 134217728 - 取消す - - - -2038284033 - 1 - - - Gw - 200 - 25 - - - - - 268 - {{73, 78}, {285, 48}} - - - YES - - 67239424 - 272629760 - <APPLICATION> の更新パスワードを入力 - - LucidaGrande - 13 - 16 - - - - - - - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{20, 78}, {48, 48}} - - - YES - - 130560 - 33554432 - 0 - 0 - 0 - NO - - YES - - - {362, 138} - - - - {{0, 0}, {1920, 1178}} - {10000000000000, 10000000000000} - YES - - - - - YES - - - mPasswordField - - - - 19 - - - - window - - - - 20 - - - - cancel: - - - - 21 - - - - accept: - - - - 22 - - - - mTextDescription - - - - 25 - - - - mIconView - - - - 26 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - YES - - - - - - 2 - - - YES - - - - - - - - - - - 3 - - - YES - - - - - - 4 - - - - - 5 - - - YES - - - - - - 6 - - - - - 7 - - - YES - - - - - - 8 - - - - - 9 - - - YES - - - - - - 10 - - - - - 15 - - - YES - - - - - - 16 - - - - - 17 - - - YES - - - - - - 18 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 1.IBPluginDependency - 1.IBWindowTemplateEditedContentRect - 1.NSWindowTemplate.visibleAtLaunch - 10.IBPluginDependency - 15.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 18.IBPluginDependency - 2.IBPluginDependency - 3.IBPluginDependency - 4.IBPluginDependency - 5.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{857, 608}, {362, 138}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 26 - - - - YES - - SUPasswordPrompt - SUWindowController - - YES - - YES - accept: - cancel: - - - YES - id - id - - - - YES - - YES - accept: - cancel: - - - YES - - accept: - id - - - cancel: - id - - - - - YES - - YES - mIconView - mPasswordField - mTextDescription - - - YES - NSImageView - NSSecureTextField - NSTextField - - - - YES - - YES - mIconView - mPasswordField - mTextDescription - - - YES - - mIconView - NSImageView - - - mPasswordField - NSSecureTextField - - - mTextDescription - NSTextField - - - - - IBProjectSource - ./Classes/SUPasswordPrompt.h - - - - SUWindowController - NSWindowController - - IBProjectSource - ./Classes/SUWindowController.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - From 69d471aefb040cb2c96ede4d1b3f7fc24e1abbbc Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 3 Jul 2012 18:49:53 -0700 Subject: [PATCH 8/9] Allow the user to try reentering his password if authentication fails. --- SUDiskImageUnarchiver.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SUDiskImageUnarchiver.m b/SUDiskImageUnarchiver.m index e0099066..c8425aef 100644 --- a/SUDiskImageUnarchiver.m +++ b/SUDiskImageUnarchiver.m @@ -97,8 +97,13 @@ if (taskResult != 0) { NSString* resultStr = output ? [[[NSString alloc] initWithData: output encoding: NSUTF8StringEncoding] autorelease] : nil; - SULog( @"hdiutil failed with code: %d data: <<%@>>", taskResult, resultStr ); - goto reportError; + if (password != nil && [resultStr rangeOfString:@"Authentication error"].location != NSNotFound && [delegate respondsToSelector:@selector(unarchiver:requiresPasswordReturnedViaInvocation:)]) { + [self performSelectorOnMainThread:@selector(requestPasswordFromDelegate) withObject:nil waitUntilDone:NO]; + goto finally; + } else { + SULog( @"hdiutil failed with code: %d data: <<%@>>", taskResult, resultStr ); + goto reportError; + } } mountedSuccessfully = YES; From ab74bdca7980fdda6fdeb672d62f4456281815f2 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 3 Jul 2012 18:52:08 -0700 Subject: [PATCH 9/9] Removed Japanese localization of password prompt from the Xcode project --- Sparkle.xcodeproj/project.pbxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index f4a833a0..57900f36 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -387,7 +387,6 @@ 93FB2778156BD80D001937C7 /* SUPasswordPrompt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPasswordPrompt.h; sourceTree = ""; }; 93FB2779156BD80D001937C7 /* SUPasswordPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPasswordPrompt.m; sourceTree = ""; }; 93FB277E156BD826001937C7 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SUPasswordPrompt.xib; sourceTree = ""; }; - 93FB2780156BE06F001937C7 /* ja */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ja; path = ja.lproj/SUPasswordPrompt.xib; sourceTree = ""; }; FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigFrameworkDebug.xcconfig; sourceTree = ""; }; FA1941CB0D94A70100DD942E /* ConfigTestAppDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigTestAppDebug.xcconfig; sourceTree = ""; }; FA1941CC0D94A70100DD942E /* ConfigCommonRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigCommonRelease.xcconfig; sourceTree = ""; }; @@ -1324,7 +1323,6 @@ isa = PBXVariantGroup; children = ( 93FB277E156BD826001937C7 /* en */, - 93FB2780156BE06F001937C7 /* ja */, ); name = SUPasswordPrompt.xib; sourceTree = "";