From f9b534a6b6a14469f8af75de6756b1a01a081d83 Mon Sep 17 00:00:00 2001 From: BobZombie Date: Fri, 17 May 2019 17:15:41 +0900 Subject: [PATCH 01/16] add delegate userDidSkipThisVersion --- Sparkle/SUUIBasedUpdateDriver.m | 2 ++ Sparkle/SUUpdaterDelegate.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index 55acd66a..d79ae576 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -149,6 +149,7 @@ { self.updateAlert = nil; [self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey]; + id updater = self.updater; switch (choice) { case SUInstallUpdateChoice: [self didDismissAlertPermanently:NO forItem:item]; @@ -162,6 +163,7 @@ break; case SUSkipThisVersionChoice: + [[updater delegate] userDidSkipThisVersion:self.updater]; [self didDismissAlertPermanently:YES forItem:item]; [self.host setObject:[self.updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey]; [self abortUpdate]; diff --git a/Sparkle/SUUpdaterDelegate.h b/Sparkle/SUUpdaterDelegate.h index b86debe3..d211a9f1 100644 --- a/Sparkle/SUUpdaterDelegate.h +++ b/Sparkle/SUUpdaterDelegate.h @@ -141,6 +141,13 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; */ - (void)updaterDidNotFindUpdate:(SUUpdater *)updater; +/*! + Called when the user clicks the Skip This Version button. + + \param updater The SUUpdater instance. + */ +- (void)userDidSkipThisVersion:(SUUpdater *)updater; + /*! Called immediately before downloading the specified update. From 79f110a17bd8de29b09dc7d8c48bc2e74eddc9db Mon Sep 17 00:00:00 2001 From: Yakuhzi Date: Fri, 5 Jul 2019 13:12:11 +0200 Subject: [PATCH 02/16] Support providing private key as argument --- generate_appcast/main.swift | 46 +++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/generate_appcast/main.swift b/generate_appcast/main.swift index ac7a1309..0592596d 100644 --- a/generate_appcast/main.swift +++ b/generate_appcast/main.swift @@ -25,22 +25,39 @@ func printUsage() { ) } -func loadPrivateKeys(_ privateDSAKey: SecKey?) -> PrivateKeys { +func loadPrivateKeys(_ privateDSAKey: SecKey?, _ privateEdString: String?) -> PrivateKeys { var privateEdKey: Data?; var publicEdKey: Data?; var item: CFTypeRef?; - let res = SecItemCopyMatching([ - kSecClass as String: kSecClassGenericPassword, - kSecAttrService as String: "https://sparkle-project.org", - kSecAttrAccount as String: "ed25519", - kSecAttrProtocol as String: kSecAttrProtocolSSH, - kSecReturnData as String: kCFBooleanTrue, - ] as CFDictionary, &item); - if res == errSecSuccess, let encoded = item as? Data, let keys = Data(base64Encoded: encoded) { + var keys: Data? + + // private + public key is provided as argument + if let privateEdString = privateEdString { + if privateEdString.count == 128, let data = privateEdString.data(using: .utf8) { + keys = data + } else { + print("Warning: Private key not found in the argument. Please provide a valid key."); + } + } + // get keys from kechain instead + else { + let res = SecItemCopyMatching([ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: "https://sparkle-project.org", + kSecAttrAccount as String: "ed25519", + kSecAttrProtocol as String: kSecAttrProtocolSSH, + kSecReturnData as String: kCFBooleanTrue, + ] as CFDictionary, &item); + if res == errSecSuccess, let encoded = item as? Data, let data = Data(base64Encoded: encoded) { + keys = data + } else { + print("Warning: Private key not found in the Keychain (\(res)). Please run the generate_keys tool"); + } + } + + if let keys = keys { privateEdKey = keys[0..<64]; publicEdKey = keys[64...]; - } else { - print("Warning: Private key not found in the Keychain (\(res)). Please run the generate_keys tool"); } return PrivateKeys(privateDSAKey: privateDSAKey, privateEdKey: privateEdKey, publicEdKey: publicEdKey); } @@ -53,6 +70,7 @@ func main() { } var privateDSAKey: SecKey? = nil; + var privateEdString: String? = nil; // this was typical usage for DSA keys if args.count == 3 || (args.count == 4 && args[1] == "-f") { @@ -98,13 +116,17 @@ func main() { exit(1) } } + // private + public EdDSA keys are provided via command line argument + else if args.count == 4 && args[1] == "-s" { + privateEdString = args[2] + } else if args.count != 2 { printUsage() exit(1) } let archivesSourceDir = URL(fileURLWithPath: args.last!, isDirectory: true) - let keys = loadPrivateKeys(privateDSAKey) + let keys = loadPrivateKeys(privateDSAKey, privateEdString) do { let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, keys: keys, verbose:verbose); From efd1840f35ba61e85942c4da836a02e961a6c651 Mon Sep 17 00:00:00 2001 From: CoreCode Date: Mon, 8 Jul 2019 20:51:16 +0200 Subject: [PATCH 03/16] Update SUUpdater.m --- Sparkle/SUUpdater.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index e1c7b1f8..9ba5ec15 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -37,6 +37,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification @interface SUUpdater () @property (strong) NSTimer *checkTimer; +@property (assign) BOOL shouldRescheduleOnWake; @property (strong) NSBundle *sparkleBundle; - (instancetype)initForBundle:(NSBundle *)bundle; @@ -59,6 +60,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification @synthesize delegate; @synthesize checkTimer; +@synthesize shouldRescheduleOnWake; @synthesize userAgentString = customUserAgentString; @synthesize httpHeaders; @synthesize driver; @@ -113,6 +115,9 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if (self) { [self registerAsObserver]; } + + [NSWorkspace.sharedWorkspace.notificationCenter addObserver:self selector:@selector(receiveSleepNote) name:NSWorkspaceWillSleepNotification object:NULL]; + [NSWorkspace.sharedWorkspace.notificationCenter addObserver:self selector:@selector(receiveWakeNote) name:NSWorkspaceDidWakeNotification object:NULL]; id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]]; if (updater) @@ -294,6 +299,24 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults self.checkTimer = [NSTimer scheduledTimerWithTimeInterval:delayUntilCheck target:self selector:@selector(checkForUpdatesInBackground) userInfo:nil repeats:NO]; // Timer is non-repeating, may have invalidated itself, so we had to retain it. } +- (void)receiveSleepNote +{ + if (self.checkTimer) + { + [self.checkTimer invalidate]; + self.checkTimer = nil; + self.shouldRescheduleOnWake = YES; + } + else + self.shouldRescheduleOnWake = NO; +} + +- (void)receiveWakeNote +{ + if (self.shouldRescheduleOnWake) // the reason for rescheduling the update-check timer is that NSTimer does behave as if the time the Mac spends asleep did not exist at all, which can significantly prolong the time between update checks + [self scheduleNextUpdateCheck]; +} + - (void)checkForUpdatesInBackground { BOOL automatic = [self automaticallyDownloadsUpdates]; From 3e53979236deaa92dc0a3115079f2c7f8c5ea259 Mon Sep 17 00:00:00 2001 From: Marga Keuvelaar Date: Fri, 12 Jul 2019 21:53:29 +0200 Subject: [PATCH 04/16] cast to NSInteger to get rid of warning on Xcode 11 --- Sparkle/SPUURLRequest.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sparkle/SPUURLRequest.m b/Sparkle/SPUURLRequest.m index b4866797..d707e42f 100644 --- a/Sparkle/SPUURLRequest.m +++ b/Sparkle/SPUURLRequest.m @@ -62,9 +62,9 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ - (void)encodeWithCoder:(NSCoder *)coder { [coder encodeObject:self.url forKey:SPUURLRequestURLKey]; - [coder encodeInteger:self.cachePolicy forKey:SPUURLRequestCachePolicyKey]; + [coder encodeInteger:(NSInteger)self.cachePolicy forKey:SPUURLRequestCachePolicyKey]; [coder encodeDouble:self.timeoutInterval forKey:SPUURLRequestTimeoutIntervalKey]; - [coder encodeInteger:self.networkServiceType forKey:SPUURLRequestNetworkServiceTypeKey]; + [coder encodeInteger:(NSInteger)self.networkServiceType forKey:SPUURLRequestNetworkServiceTypeKey]; if (self.httpHeaderFields != nil) { [coder encodeObject:self.httpHeaderFields forKey:SPUURLRequestHttpHeaderFieldsKey]; From f2bd7ea2b263f4090a3e3faea7fcb29251b1ef6a Mon Sep 17 00:00:00 2001 From: gotow Date: Thu, 1 Aug 2019 22:35:28 -0600 Subject: [PATCH 05/16] Update SUUIBasedUpdateDriver.m --- Sparkle/SUUIBasedUpdateDriver.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index 6fa6e6b9..51d75e1d 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -126,7 +126,7 @@ alert.messageText = SULocalizedString(@"You're up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates."); if (self.latestAppcastItemComparisonResult == NSOrderedDescending ) { // this means the user is a 'newer than latest' version. give a slight hint to the user instead of wrongly claiming this version is identical to the latest feed version. - alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.\n(You are currently running version %@.)", nil), [self.host name], self.latestAppcastItem.versionString, [self.host displayVersion]]; + alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.\n(You are currently running version %@.)", nil), [self.host name], self.latestAppcastItem.displayVersionString, [self.host displayVersion]]; } else { alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]]; From b0d29ae7989417d7352280372a42c21c2749c5de Mon Sep 17 00:00:00 2001 From: Jake Fenton Date: Fri, 2 Aug 2019 09:29:12 -0400 Subject: [PATCH 06/16] check if SUBundleName is set before normalizing When changing the name of an app, there's a couple things to do in order to ensure auto-updates still work: 1. set SUBundle Name. This basically tells Sparkle "ey, expect an app of {SUBundleName}.(app|pkg) instead of the normal name." 2. set `SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME` in commonConfig.xccconfig to reset the name of the app. in (2), we always used the host's bundle name, instead of checking to see if SUBundleName was set, which means normalization doesn't work as expected during app name changes. --- Sparkle/SUInstaller.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUInstaller.m b/Sparkle/SUInstaller.m index 23d8c6e8..67e90417 100644 --- a/Sparkle/SUInstaller.m +++ b/Sparkle/SUInstaller.m @@ -152,8 +152,14 @@ { NSBundle *bundle = host.bundle; assert(bundle != nil); - - NSString *normalizedAppPath = [[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", [host objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[bundle bundlePath] pathExtension]]]; + + NSString * baseBundleName = [host objectForInfoDictionaryKey:@"SUBundleName"]; + + if (baseBundleName == nil) { + baseBundleName = [host objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey]; + } + + NSString *normalizedAppPath = [[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", baseBundleName, [[bundle bundlePath] pathExtension]]]; // Roundtrip string through fileSystemRepresentation to ensure it uses filesystem's Unicode normalization // rather than arbitrary Unicode form from Info.plist - #1017 From 6ac853271df9333c26665c8312e3ed62ba20fa69 Mon Sep 17 00:00:00 2001 From: fujisoft Date: Sat, 3 Aug 2019 13:38:13 +0900 Subject: [PATCH 07/16] Update Japanese localization #1429 --- Sparkle/ja.lproj/Sparkle.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sparkle/ja.lproj/Sparkle.strings b/Sparkle/ja.lproj/Sparkle.strings index 3bb4d030..f65de104 100644 --- a/Sparkle/ja.lproj/Sparkle.strings +++ b/Sparkle/ja.lproj/Sparkle.strings @@ -8,7 +8,7 @@ "%@ %@ is currently the newest version available." = "%1$@ %2$@は現在入手できる最新バージョンです。"; -"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@は現在入手できる最新バージョンです。\n(You are currently running version %3$@.)"; +"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@は現在入手できる最新バージョンです。\n(現在使用中のバージョンは%3$@です。)"; /* Description text for SUUpdateAlert when the update is downloadable. */ "%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@が入手できます(使用中のバージョンは%3$@です)。今すぐダウンロードしますか?"; From 28ff3069ff99681f8af28f56467ed0180f5b5620 Mon Sep 17 00:00:00 2001 From: Tom Vos Date: Tue, 13 Aug 2019 09:45:10 +0200 Subject: [PATCH 08/16] Update ArchiveItem.swift When the SUFeedURL extention is "php", replace filename.php with appcast.xml in generate_appcast --- generate_appcast/ArchiveItem.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 32b276f9..49d1eba6 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -94,6 +94,10 @@ class ArchiveItem: CustomStringConvertible { var feedURL:URL? = nil; if let feedURLStr = infoPlist["SUFeedURL"] as? String { feedURL = URL(string: feedURLStr); + if feedURL?.pathExtension == "php" { + let feedFileAndExtention = feedURL?.lastPathComponent + "." + feedURL?.pathExtension as? String + feedURL = URL(string: feedURL?.absoluteString.replacingOccurrences(of: feedFileAndExtention, with: "appcast.xml")) + } } try self.init(version: version, From 48fc202f367a91a71fb831ffb401d207ce5aa510 Mon Sep 17 00:00:00 2001 From: Tom Vos Date: Tue, 13 Aug 2019 12:17:12 +0200 Subject: [PATCH 09/16] Processed requested changes Instead of using find and replace, use the correct methods on URL to change the file name and extention. --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ generate_appcast/ArchiveItem.swift | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 Sparkle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Sparkle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Sparkle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Sparkle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 49d1eba6..4978bbfb 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -95,8 +95,8 @@ class ArchiveItem: CustomStringConvertible { if let feedURLStr = infoPlist["SUFeedURL"] as? String { feedURL = URL(string: feedURLStr); if feedURL?.pathExtension == "php" { - let feedFileAndExtention = feedURL?.lastPathComponent + "." + feedURL?.pathExtension as? String - feedURL = URL(string: feedURL?.absoluteString.replacingOccurrences(of: feedFileAndExtention, with: "appcast.xml")) + feedURL?.deletingLastPathComponent() + feedURL?.appendingPathComponent("appcast.php") } } From 035bfc4919c15e60f5412f6ddb6f62dab8e6bebf Mon Sep 17 00:00:00 2001 From: Tom Vos Date: Tue, 13 Aug 2019 12:18:42 +0200 Subject: [PATCH 10/16] Fix typo --- generate_appcast/ArchiveItem.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 4978bbfb..151ce5fe 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -96,7 +96,7 @@ class ArchiveItem: CustomStringConvertible { feedURL = URL(string: feedURLStr); if feedURL?.pathExtension == "php" { feedURL?.deletingLastPathComponent() - feedURL?.appendingPathComponent("appcast.php") + feedURL?.appendingPathComponent("appcast.xml") } } From 2db2fffab9917ffc0020d03a2929a25b55ee25c0 Mon Sep 17 00:00:00 2001 From: bono yusuke Date: Wed, 14 Aug 2019 17:12:16 +0900 Subject: [PATCH 11/16] Update SUUIBasedUpdateDriver.m --- Sparkle/SUUIBasedUpdateDriver.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index d79ae576..8d79e2f4 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -163,7 +163,9 @@ break; case SUSkipThisVersionChoice: - [[updater delegate] userDidSkipThisVersion:self.updater]; + if ([[updater delegate] respondsToSelector:@selector(userDidSkipThisVersion:)]) { + [[updater delegate] updater:self.updater userDidSkipThisVersion:self.updateItem]; + } [self didDismissAlertPermanently:YES forItem:item]; [self.host setObject:[self.updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey]; [self abortUpdate]; From f8572f79cbc3931ce2393c1d7e5cfdc8d537e361 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste <33569886+webjib@users.noreply.github.com> Date: Mon, 19 Aug 2019 15:18:14 +0200 Subject: [PATCH 12/16] Update Sparkle.strings Issue #1429 https://github.com/sparkle-project/Sparkle/issues/1429 --- Sparkle/fr.lproj/Sparkle.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sparkle/fr.lproj/Sparkle.strings b/Sparkle/fr.lproj/Sparkle.strings index a1068855..49ee03f3 100644 --- a/Sparkle/fr.lproj/Sparkle.strings +++ b/Sparkle/fr.lproj/Sparkle.strings @@ -8,7 +8,7 @@ "%@ %@ is currently the newest version available." = "%1$@ %2$@ est la version la plus récente disponible."; -"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ est la version la plus récente disponible.\n(You are currently running version %3$@.)"; +"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ est la version la plus récente disponible.\n(vous utilisez actuellement la version %3$@)"; /* Description text for SUUpdateAlert when the update is downloadable. */ "%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ est disponible ; vous utilisez la version %3$@. Voulez-vous le télécharger maintenant ?"; From 181f813b018ef0e2b870a02ff501174e339e5059 Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Tue, 20 Aug 2019 04:12:33 +0300 Subject: [PATCH 13/16] Fix incorrect and inconsistent selectors and delegate methods. --- Sparkle/SUUIBasedUpdateDriver.m | 2 +- Sparkle/SUUpdaterDelegate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index c03f8dd8..d2d0cbe1 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -179,7 +179,7 @@ break; case SUSkipThisVersionChoice: - if ([[updater delegate] respondsToSelector:@selector(userDidSkipThisVersion:)]) { + if ([[updater delegate] respondsToSelector:@selector(updater:userDidSkipThisVersion:)]) { [[updater delegate] updater:self.updater userDidSkipThisVersion:self.updateItem]; } [self didDismissAlertPermanently:YES forItem:item]; diff --git a/Sparkle/SUUpdaterDelegate.h b/Sparkle/SUUpdaterDelegate.h index d211a9f1..ea8197b5 100644 --- a/Sparkle/SUUpdaterDelegate.h +++ b/Sparkle/SUUpdaterDelegate.h @@ -146,7 +146,7 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; \param updater The SUUpdater instance. */ -- (void)userDidSkipThisVersion:(SUUpdater *)updater; +- (void)updater:(SUUpdater *)updater userDidSkipThisVersion:(SUAppcastItem *)item; /*! Called immediately before downloading the specified update. From fedb22e224419e4d2b77af10c2af08cae1b7441b Mon Sep 17 00:00:00 2001 From: Tom Vos Date: Wed, 21 Aug 2019 10:20:37 +0200 Subject: [PATCH 14/16] Update ArchiveItem.swift The *ing methods didn't alter the value, they provided a new value which was not assigned to anything. --- generate_appcast/ArchiveItem.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 151ce5fe..d6850649 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -93,10 +93,9 @@ class ArchiveItem: CustomStringConvertible { var feedURL:URL? = nil; if let feedURLStr = infoPlist["SUFeedURL"] as? String { - feedURL = URL(string: feedURLStr); - if feedURL?.pathExtension == "php" { - feedURL?.deletingLastPathComponent() - feedURL?.appendingPathComponent("appcast.xml") + if let feedURL = URL(string: feedURLStr), feedURL.pathExtension == "php" { + feedURL = feedURL.deletingLastPathComponent() + feedURL = feedURL.appendingPathComponent("appcast.xml") } } From 2657a41d55504e58644ad4c494d64fcae3c61afc Mon Sep 17 00:00:00 2001 From: Tom Vos Date: Wed, 21 Aug 2019 11:16:06 +0200 Subject: [PATCH 15/16] Update ArchiveItem.swift feedURl was a let and therefore not assignable --- generate_appcast/ArchiveItem.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index d6850649..c2f63f77 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -93,9 +93,10 @@ class ArchiveItem: CustomStringConvertible { var feedURL:URL? = nil; if let feedURLStr = infoPlist["SUFeedURL"] as? String { - if let feedURL = URL(string: feedURLStr), feedURL.pathExtension == "php" { - feedURL = feedURL.deletingLastPathComponent() - feedURL = feedURL.appendingPathComponent("appcast.xml") + feedURL = URL(string: feedURLStr) + if feedURL?.pathExtension == "php" { + feedURL = feedURL!.deletingLastPathComponent() + feedURL = feedURL!.appendingPathComponent("appcast.xml") } } From 6dbbf086543b3cae032aad18b4458bab91a06d3b Mon Sep 17 00:00:00 2001 From: marchyang Date: Tue, 8 Oct 2019 19:43:20 +0800 Subject: [PATCH 16/16] fix public key dont match problem when use generate_appcast with -s arguments --- generate_appcast/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_appcast/main.swift b/generate_appcast/main.swift index 0592596d..2fc7a3ce 100644 --- a/generate_appcast/main.swift +++ b/generate_appcast/main.swift @@ -33,7 +33,7 @@ func loadPrivateKeys(_ privateDSAKey: SecKey?, _ privateEdString: String?) -> Pr // private + public key is provided as argument if let privateEdString = privateEdString { - if privateEdString.count == 128, let data = privateEdString.data(using: .utf8) { + if privateEdString.count == 128, let data = Data(base64Encoded: privateEdString) { keys = data } else { print("Warning: Private key not found in the argument. Please provide a valid key.");