Compare commits

..
19 Commits
Author SHA1 Message Date
Kornel 558cfd2153 Bump 2017-08-14 13:19:03 +01:00
Kornel 94074e2bdc Merge pull request #1111 from sparkle-project/swift4
Update to Xcode 9/Swift 4
2017-08-14 13:02:21 +01:00
Kornel 56065fcf95 Merge pull request #1119 from 1024jp/patch-1
Update Xcode version for Travis CI
2017-08-14 12:46:30 +01:00
1024jp f24189e848 Update Xcode version for Travis CI 2017-08-14 18:05:49 +09:00
Kornel 65b12a2be1 Merge pull request #1116 from fujisoft/patch-3
Workaround for timing issue of termination detection.

Not sure if that is correct.
2017-08-11 19:03:05 +01:00
fujisoft 900de556a8 Fix for the timing issue of termination detection. 2017-08-08 11:12:47 +09:00
App Tyrant 7c8ff2b969 Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115)
* Added updaterDidRelaunchApplication: delegate method.

* Removed isUpdaterRelaunching property.

* Revert SUHost.
2017-08-08 00:21:51 +01:00
Kornel 43b4472d3c Better error message 2017-08-01 15:55:25 +01:00
Kornel 260170f372 Warning 2017-08-01 15:54:52 +01:00
Kornel ea85fc6442 Update to Xcode 9/Swift 4 2017-07-27 16:42:44 +01:00
Kornel a52604a264 Revert "Ensure UI code always runs on the main thread"
This reverts commit 423ee5a9d6.
2017-07-20 13:20:20 +01:00
Kornel 39d6c616b0 Merge pull request #1051 from sparkle-project/mainalert
Ensure UI code always runs on the main thread
2017-07-16 21:03:20 +01:00
Kornel 043ad0464a Merge pull request #1098 from Eitot/dutch
Update Dutch localization for informal style and changed terminology
2017-06-24 22:19:09 +01:00
Kornel d99339cf08 Merge pull request #1097 from Eitot/german
Update German localization for informal style and changed terminology
2017-06-24 22:11:16 +01:00
Eitot c541f95036 Update German localization with some terminology changes
Apple uses the term "Update" instead of "Aktualisierung" and
"laden" instead of "herunterladen".
2017-06-23 10:00:05 +02:00
Eitot e678ffb3ca Update German localization for informal style
This is the style in Apple's localizations in macOS Sierra.
Also makes some slight changes to wording.
2017-06-23 09:59:48 +02:00
Eitot 070ea362a2 Update Dutch localization for informal style
This is the style in Apple's localizations in macOS Sierra.
2017-06-23 09:57:55 +02:00
Eitot c4db636d0b Update Dutch localization with some style changes
This reflects Apple's localizations a bit better.
2017-06-23 09:57:49 +02:00
Kornel Lesiński 423ee5a9d6 Ensure UI code always runs on the main thread 2017-03-15 21:31:11 +00:00
15 changed files with 81 additions and 228 deletions

No files matched your search

+2 -3
View File
@@ -17,9 +17,8 @@ SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 18
SPARKLE_VERSION_PATCH = 2
TUNNELBEAR_ID = TB
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(TUNNELBEAR_ID)
SPARKLE_VERSION_PATCH = 1
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
ALWAYS_SEARCH_USER_PATHS = NO
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "1.18.2TB"
s.version = "1.18.1"
s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers."
s.homepage = "http://sparkle-project.org"
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
}
s.platform = :osx, '10.7'
s.source = { :http => "https://s3.amazonaws.com/tunnelbear/sparkle/Sparkle-#{s.version}.tar.bz2" }
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.bz2" }
s.source_files = 'Sparkle.framework/Versions/A/Headers/*.h'
s.preserve_paths = 'bin/*'
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -10,7 +10,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -31,7 +30,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
-25
View File
@@ -46,15 +46,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
- (void)showUpdateAlert
{
id<SUUpdaterPrivate> updater = self.updater;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if ([updaterDelegate suppressSparkleUI])
{
[self automaticUpdateAlertFinishedWithChoice:SUInstallLaterChoice];
return;
}
// NSLog(@"[Sparkle showUpdateAlert]");
self.interruptible = NO;
[self invalidateShowUpdateAlertTimer];
@@ -105,26 +96,10 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationInvocation:invocation];
}
//For Swift
else if ([updaterDelegate respondsToSelector:@selector(updater: willInstallUpdateOnQuit:immediateInstallationBlock:)])
{
BOOL relaunch = YES;
BOOL showUI = NO;
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:displayingUserInterface:)]];
[invocation setSelector:@selector(installWithToolAndRelaunch:displayingUserInterface:)];
[invocation setArgument:&relaunch atIndex:2];
[invocation setArgument:&showUI atIndex:3];
[invocation setTarget:self];
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationBlock:^{
[invocation invoke];
}];
}
// If this is marked as a critical update, we'll prompt the user to install it right away.
if ([self.updateItem isCriticalUpdate])
{
// NSLog(@"[Sparkle update deemed critical]");
[self showUpdateAlert];
}
else
+2 -26
View File
@@ -212,11 +212,7 @@
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification
object:self.updater
userInfo:@{ SUUpdaterAppcastItemNotificationKey: self.updateItem }];
// TB: Always download update.
// Stadard accounts will recieve an auth prompt before installation
[self downloadUpdate];
[self downloadUpdate];
}
- (void)didNotFindUpdate
@@ -596,27 +592,7 @@
// Note: this is overridden by the automatic update driver to not terminate in some cases
- (void)terminateApp
{
BOOL isMainBundle = [self.host.bundle isEqualTo:[NSBundle mainBundle]];
if (isMainBundle) {
[NSApp terminate:self];
}
else {
NSString *bundleID = self.host.bundle.bundleIdentifier;
if (bundleID.length > 0) {
NSArray *apps = [NSRunningApplication runningApplicationsWithBundleIdentifier:bundleID];
for (NSRunningApplication *app in apps) {
[app terminate];
}
}
// Notify the mainBundle host the target has been terminated
id<SUUpdaterPrivate> updater = self.updater;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if ([updaterDelegate respondsToSelector:@selector(updater:didTerminateTarget:)]) {
[updaterDelegate updater:self.updater didTerminateTarget:bundleID];
}
}
[NSApp terminate:self];
}
- (void)cleanUpDownload
-1
View File
@@ -31,7 +31,6 @@ typedef NS_ENUM(OSStatus, SUError) {
// Download phase errors.
SUTemporaryDirectoryError = 2000,
SUDownloadError = 2001,
SUHostDirectoryNotWritable = 2002,
// Extraction phase errors.
SUUnarchivingError = 3000,
+47 -25
View File
@@ -59,16 +59,42 @@
- (void)didFindValidUpdate
{
id<SUUpdaterPrivate> updater = self.updater;
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:respondWithChoice:)]) {
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem respondWithChoice:^(SUDUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:(SUUpdateAlertChoice)choice];
}];
return;
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
}
else if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
if (self.automaticallyInstallUpdates) {
[self updateAlertFinishedWithChoice:SUInstallUpdateChoice];
return;
}
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:self.updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:choice];
}];
id<SUVersionDisplay> versDisp = nil;
if ([[updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)]) {
versDisp = [[updater delegate] versionDisplayerForUpdater:self.updater];
}
[self.updateAlert setVersionDisplayer:versDisp];
// If the app is a menubar app or the like, we need to focus it first and alter the
// update prompt to behave like a normal window. Otherwise if the window were hidden
// there may be no way for the application to be activated to make it visible again.
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
[[self.updateAlert window] setHidesOnDeactivate:NO];
[NSApp activateIgnoringOtherApps:YES];
}
// Only show the update alert if the app is active; otherwise, we'll wait until it is.
if ([NSApp isActive]) {
NSWindow *window = [self.updateAlert window];
if ([self shouldDisableKeyboardShortcutForInstallButton]) {
[self.updateAlert disableKeyboardShortcutForInstallButton];
}
[window makeKeyAndOrderFront:self];
} else
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
}
- (BOOL)shouldDisableKeyboardShortcutForInstallButton {
@@ -109,7 +135,7 @@
break;
case SUOpenInfoURLChoice:
[[NSWorkspace sharedWorkspace] openURL:[self.updateItem releaseNotesURL]];
[[NSWorkspace sharedWorkspace] openURL:[self.updateItem infoURL]];
[self abortUpdate];
break;
@@ -126,22 +152,18 @@
- (void)downloadUpdate
{
id<SUUpdaterPrivate> updater = self.updater;
if(![[updater delegate] suppressSparkleUI])
{
BOOL createdStatusController = NO;
if (self.statusController == nil) {
self.statusController = [[SUStatusController alloc] initWithHost:self.host];
createdStatusController = YES;
}
[self.statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
[self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO];
[self.statusController setButtonEnabled:YES];
if (createdStatusController) {
[self.statusController showWindow:self];
}
BOOL createdStatusController = NO;
if (self.statusController == nil) {
self.statusController = [[SUStatusController alloc] initWithHost:self.host];
createdStatusController = YES;
}
[self.statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
[self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO];
[self.statusController setButtonEnabled:YES];
if (createdStatusController) {
[self.statusController showWindow:self];
}
[super downloadUpdate];
-6
View File
@@ -53,12 +53,6 @@ SU_EXPORT @interface SUUpdater : NSObject
*/
- (instancetype)initForBundle:(NSBundle *)bundle;
/*!
Suppress sparkle UI. This should prevent any Sparkle UI from popping up.
Updates should be handled by the host.
*/
-(BOOL)suppressSparkleUI;
/*!
Explicitly checks for updates and displays a progress dialog while doing so.
+5 -22
View File
@@ -10,7 +10,6 @@
#import "SUUpdaterDelegate.h"
#import "SUUpdaterPrivate.h"
#import "SUErrors.h"
#import "SUHost.h"
#import "SUUpdatePermissionResponse.h"
#import "SUUpdatePermissionPrompt.h"
@@ -150,9 +149,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
informativeText:[NSString stringWithFormat:SULocalizedString(@"For security reasons, the file (%@) indicated by the '%@' key needs to exist in the bundle's Resources.", nil), publicDSAKeyFileKey, SUPublicDSAKeyFileKey]];
} else {
if (!isMainBundle) {
// Sparkle documentation doesn't explain why this is a requirement. We won't be using DSA keys for now. Codesigning will suffice.
// [self showAlertText:SULocalizedString(@"Insecure update error!", nil)
// informativeText:SULocalizedString(@"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.", nil)];
[self showAlertText:SULocalizedString(@"Insecure update error!", nil)
informativeText:SULocalizedString(@"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.", nil)];
} else {
if (!hostIsCodeSigned) {
[self showAlertText:SULocalizedString(@"Insecure update error!", nil)
@@ -293,17 +291,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)checkForUpdatesInBackground
{
// Do not use reachability for a preflight check. This can be deceptive and a bad idea. Apple does not recommend doing it.
SUUpdateDriver *theUpdateDriver;
if ([self.delegate suppressSparkleUI])
{
theUpdateDriver = [[SUAutomaticUpdateDriver alloc] initWithUpdater:self];
}
else {
theUpdateDriver = [[SUScheduledUpdateDriver alloc] initWithUpdater:self];
}
SUUpdateDriver *theUpdateDriver = [[([self automaticallyDownloadsUpdates] ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class])alloc] initWithUpdater:self];
[self checkForUpdatesWithDriver:theUpdateDriver];
}
@@ -327,8 +315,6 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)installUpdatesIfAvailable
{
// NSLog(@"[Sparkle installUpdatesIfAvailable]");
if (self.driver && [self.driver isInterruptible]) {
if ([self.driver resumeUpdateInteractively]) {
return;
@@ -447,12 +433,9 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
if (![SUSystemUpdateInfo systemAllowsAutomaticUpdatesForHost:self.host]) {
return NO;
}
// Otherwise, automatically downloading updates is allowed. Does the user want it?
BOOL automatic = [self.host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
// NSLog(@"Automatic updates %@", automatic ? @"enabled" : @"disabled");
return automatic;
return [self.host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
}
- (void)setFeedURL:(NSURL *)feedURL
-41
View File
@@ -14,13 +14,6 @@
#import "SUExport.h"
typedef NS_ENUM(NSInteger, SUDUpdateAlertChoice) {
SUDInstallUpdateChoice,
SUDRemindMeLaterChoice,
SUDSkipThisVersionChoice,
SUDOpenInfoURLChoice
};
@protocol SUVersionComparison, SUVersionDisplay;
@class SUUpdater, SUAppcast, SUAppcastItem;
@@ -52,12 +45,6 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
@protocol SUUpdaterDelegate <NSObject>
@optional
/*!
Suppress sparkle UI. This should prevent any Sparkle UI from popping up.
Updates should be handled by the host.
*/
-(BOOL)suppressSparkleUI;
/*!
Returns whether to allow Sparkle to pop up.
@@ -134,16 +121,6 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
*/
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item;
/*!
Called when a valid update is found by the update driver and provides delegate ability to respond.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that is proposed to be installed.
\param responseBlock The block carrying the users response to update.
*/
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item respondWithChoice:(void (^)(SUDUpdateAlertChoice))responseBlock;
/*!
Called when a valid update is not found.
@@ -283,24 +260,6 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
*/
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation;
/*!
Called when an update is scheduled to be silently installed on quit. Swift compatible.
\param updater the SUUpdater instance.
\param item The appcast item corresponding to the udpate that is proposed to be installed.
\param restartBlock Can be used to trigger an immediate silent install and relaunch.
*/
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)()) restartBlock;
/*!
Called when the update target which is not from the host mainBundle has been terminated.
For example, a helper app updating its parent.
\param updater the SUUpdater instance.
\param targetBundleID the bundle ID of the terminated parent app
*/
- (void)updater:(SUUpdater *)updater didTerminateTarget: (NSString *)targetBundleID;
/*!
Calls after an update that was scheduled to be silently installed on quit has been canceled.
-2
View File
@@ -20,6 +20,4 @@
@property (strong, readonly) NSBundle *sparkleBundle;
@property BOOL automaticallyDownloadsUpdates;
@end
+14 -60
View File
@@ -1,135 +1,89 @@
/* No comment provided by engineer. */
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?";
/* No comment provided by engineer. */
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?";
/* No comment provided by engineer. */
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ can’t be updated when it’s running from a read-only volume like a disk image or an optical drive. Move %1$@ to Applications folder using Finder, relaunch it from there, and try again.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ is now available--you have %3$@. Would you like to download it now?";
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ is now available—you have %3$@. Would you like to download it now?";
/* Description text for SUUpdateAlert when the update informational with no download. */
"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ is now available--you have %3$@. Would you like to learn more about this update on the web?";
"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ is now available—you have %3$@. Would you like to learn more about this update on the web?";
/* No comment provided by engineer. */
"%@ downloaded" = "%@ downloaded";
/* No comment provided by engineer. */
"%@ of %@" = "%1$@ of %2$@";
/* No comment provided by engineer. */
"A new version of %@ is available!" = "A new version of %@ is available!";
/* No comment provided by engineer. */
"A new version of %@ is ready to install!" = "A new version of %@ is ready to install!";
/* No comment provided by engineer. */
"An error occurred in retrieving update information. Please try again later." = "An error occurred in retrieving update information. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while downloading the update. Please try again later." = "An error occurred while downloading the update. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while extracting the archive. Please try again later." = "An error occurred while extracting the archive. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while installing the update. Please try again later." = "An error occurred while installing the update. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while parsing the update feed." = "An error occurred while parsing the update feed.";
/* No comment provided by engineer. */
"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.";
/* No comment provided by engineer. */
"An important update to %@ is ready to install" = "An important update to %@ is ready to install";
/* the unit for bytes */
"B" = "B";
/* No comment provided by engineer. */
"Cancel" = "Cancel";
/* No comment provided by engineer. */
"Cancel Update" = "Cancel Update";
/* No comment provided by engineer. */
"Checking for updates..." = "Checking for updates...";
"Checking for updates..." = "Checking for updates…";
/* Take care not to overflow the status window. */
"Downloading update..." = "Downloading update...";
"Downloading update..." = "Downloading update…";
/* Take care not to overflow the status window. */
"Extracting update..." = "Extracting update...";
/* No comment provided by engineer. */
"For security reasons, the file (%@) indicated by the '%@' key needs to exist in the bundle's Resources." = "For security reasons, the file (%1$@) indicated by the '%2$@' key needs to exist in the bundle's Resources.";
/* No comment provided by engineer. */
"For security reasons, you need to code sign your application or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information." = "For security reasons, you need to code sign your application or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information.";
/* No comment provided by engineer. */
"For security reasons, you need to serve your updates over HTTPS and/or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information." = "For security reasons, you need to serve your updates over HTTPS and/or sign your updates with a DSA key. See https://sparkle-project.org/documentation/ for more information.";
/* No comment provided by engineer. */
"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information." = "For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.";
"Extracting update..." = "Extracting update…";
/* the unit for gigabytes */
"GB" = "GB";
/* No comment provided by engineer. */
"Insecure feed URL is blocked in macOS 10.11" = "Insecure feed URL is blocked in macOS 10.11";
/* No comment provided by engineer. */
"Insecure update error!" = "Insecure update error!";
/* No comment provided by engineer. */
"Install and Relaunch" = "Install and Relaunch";
/* Take care not to overflow the status window. */
"Installing update..." = "Installing update...";
"Installing update..." = "Installing update…";
/* the unit for kilobytes */
"KB" = "KB";
/* Alternate title for 'Install Update' button when there's no download in RSS feed. */
"Learn More..." = "Learn More...";
/* Alternative name for "Install" button if we have a paid update or other update
without a download but with a URL. */
"Learn More..." = "Learn More…";
/* the unit for megabytes */
"MB" = "MB";
/* No comment provided by engineer. */
/* OK button. */
"OK" = "OK";
/* No comment provided by engineer. */
/* Status message on progress window once download has finished. */
"Ready to Install" = "Ready to Install";
/* No comment provided by engineer. */
/* Message that is optionally shown at startup to allow users to turn on/off update checks. */
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu.";
/* No comment provided by engineer. */
"The update is improperly signed." = "The update is improperly signed.";
/* No comment provided by engineer. */
"The update will not be installed because the user requested for the system to power off" = "The update will not be installed because the user requested for the system to power off";
/* No comment provided by engineer. */
"Update Error!" = "Update Error!";
/* No comment provided by engineer. */
"Updating %@" = "Updating %@";
/* 'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI) */
"You already have the newest version of %@." = "You already have the newest version of %@.";
/* No comment provided by engineer. */
"You must change the feed URL (%@) to use HTTPS or disable App Transport Security.\n\nFor more information:\nhttps://sparkle-project.org/documentation/app-transport-security/" = "You must change the feed URL (%@) to use HTTPS or disable App Transport Security.\n\nFor more information:\nhttps://sparkle-project.org/documentation/app-transport-security/";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You're up-to-date!" = "You're up-to-date!";
"You're up-to-date!" = "You’re up-to-date!";
+9 -9
View File
@@ -7,17 +7,17 @@ import Foundation
func loadPrivateKey(privateKeyPath: URL) throws -> SecKey {
let data = try Data(contentsOf: privateKeyPath);
var cfitems: CFArray? = nil;
var format = SecExternalFormat.formatOpenSSL;
var type = SecExternalItemType.itemTypePrivateKey;
let status = SecItemImport(data as CFData, nil, &format, &type, SecItemImportExportFlags(rawValue: UInt32(0)), nil, nil, &cfitems);
if (status != errSecSuccess || cfitems == nil) {
print("Private DSA key file", privateKeyPath, "exists, but it could not be read. SecItemImport error", status);
throw NSError(domain: SUSparkleErrorDomain, code: Int(OSStatus(SUError.signatureError.rawValue)), userInfo: nil);
}
if (format != SecExternalFormat.formatOpenSSL || type != SecExternalItemType.itemTypePrivateKey) {
throw makeError(code: .signatureError, "Not an OpensSSL private key \(format) \(type)");
}
@@ -26,29 +26,29 @@ func loadPrivateKey(privateKeyPath: URL) throws -> SecKey {
}
func dsaSignature(path: URL, privateKey: SecKey) throws -> String {
var error: Unmanaged<CFError>?;
let stream = InputStream(fileAtPath:path.path)!;
let dataReadTransform = SecTransformCreateReadTransformWithReadStream(stream);
let dataDigestTransform = SecDigestTransformCreate(kSecDigestSHA1, 20, nil);
guard let dataSignTransform = SecSignTransformCreate(privateKey, &error) else {
print("can't use the key");
throw error!.takeRetainedValue();
}
let group = SecTransformCreateGroupTransform();
SecTransformConnectTransforms(dataReadTransform, kSecTransformOutputAttributeName, dataDigestTransform, kSecTransformInputAttributeName, group, &error);
if (error != nil) {
throw error!.takeRetainedValue();
}
SecTransformConnectTransforms(dataDigestTransform, kSecTransformOutputAttributeName, dataSignTransform, kSecTransformInputAttributeName, group, &error);
if (error != nil) {
throw error!.takeRetainedValue();
}
let result = SecTransformExecute(group, &error) as! Data;
return result.base64EncodedString();
}