Skip to content

Commit

Permalink
Fix Pre-release Check & Remove Redundant Sparkle Binaries (#113)
Browse files Browse the repository at this point in the history
* Restore checking for prerelease updates in Preferences
* Remove Redundant Updater Binaries from Sparkle
  • Loading branch information
newmarcel committed Dec 30, 2018
1 parent 1870b5b commit b33c956
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -11,7 +11,7 @@
- _Start at login_ uses a launcher helper app now ([#110](https://github.com/newmarcel/KeepingYouAwake/pull/110))
- the previous login item is not compatible anymore and **it is recommended to disable _Start at login_ before updating**!
- please check [this wiki page](https://github.com/newmarcel/KeepingYouAwake/wiki/1.5:-Start-at-Login-Problems) if you encounter problems
- updated Sparkle to the `ui-separation-and-xpc` version ([#109](https://github.com/newmarcel/KeepingYouAwake/pull/109))
- updated Sparkle to the `ui-separation-and-xpc` version ([#109](https://github.com/newmarcel/KeepingYouAwake/pull/109)) ([#113](https://github.com/newmarcel/KeepingYouAwake/pull/113))

### v1.4.3 ###

Expand Down
4 changes: 2 additions & 2 deletions Configuration.xcconfig
Expand Up @@ -10,5 +10,5 @@ MACOSX_DEPLOYMENT_TARGET = 10.10
PRODUCT_BUNDLE_IDENTIFIER = info.marcel-dierkes.KeepingYouAwake

KYA_COPYRIGHT_TEXT = Copyright © 2014 – 2018 Marcel Dierkes. All rights reserved.
KYA_BUNDLE_VERSION = 1.5.0beta1
KYA_BUILD_NUMBER = 1050002
KYA_BUNDLE_VERSION = 1.5.0beta2
KYA_BUILD_NUMBER = 1050003
8 changes: 6 additions & 2 deletions KeepingYouAwake/Preferences/Base.lproj/Preferences.storyboard
Expand Up @@ -529,7 +529,7 @@
<!--Updates-->
<scene sceneID="GLC-gz-Zi5">
<objects>
<viewController title="Updates" id="8V0-Sq-Cdu" customClass="KYAUpdatePreferencesViewController" sceneMemberID="viewController">
<viewController title="Updates" id="8V0-Sq-Cdu" userLabel="Updates" customClass="KYAUpdatePreferencesViewController" sceneMemberID="viewController">
<view key="view" id="FTE-58-nDl">
<rect key="frame" x="0.0" y="0.0" width="451" height="146"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -609,7 +609,11 @@
</view>
</viewController>
<customObject id="zmq-SH-iwA" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<customObject id="Zv3-Yg-TMp" customClass="SPUStandardUpdaterController"/>
<customObject id="Zv3-Yg-TMp" customClass="SPUStandardUpdaterController">
<connections>
<outlet property="updaterDelegate" destination="8V0-Sq-Cdu" id="i45-pG-Fxv"/>
</connections>
</customObject>
<userDefaultsController id="4Au-If-gob"/>
</objects>
<point key="canvasLocation" x="-228" y="1168"/>
Expand Down
Expand Up @@ -7,10 +7,11 @@
//

#import <Cocoa/Cocoa.h>
#import <Sparkle/Sparkle.h>

NS_ASSUME_NONNULL_BEGIN

@interface KYAUpdatePreferencesViewController : NSViewController
@interface KYAUpdatePreferencesViewController : NSViewController <SPUUpdaterDelegate>
@end

NS_ASSUME_NONNULL_END
Expand Up @@ -8,10 +8,25 @@

#import "KYAUpdatePreferencesViewController.h"
#import "KYADefines.h"
#import "NSUserDefaults+Keys.h"

@interface KYAUpdatePreferencesViewController ()
@implementation KYAUpdatePreferencesViewController

@end
#pragma mark - SPUUpdaterDelegate

- (NSString *)feedURLStringForUpdater:(SPUUpdater *)updater
{
NSString *feedURLString = NSBundle.mainBundle.infoDictionary[@"SUFeedURL"];
NSAssert(feedURLString != nil, @"A feed URL should be set in Info.plist");

if([NSUserDefaults.standardUserDefaults kya_arePreReleaseUpdatesEnabled])
{
NSString *lastComponent = feedURLString.lastPathComponent;
NSString *baseURLString = feedURLString.stringByDeletingLastPathComponent;
return [NSString stringWithFormat:@"%@/prerelease-%@", baseURLString, lastComponent];
}

return feedURLString;
}

@implementation KYAUpdatePreferencesViewController
@end
2 changes: 1 addition & 1 deletion Makefile
@@ -1,6 +1,6 @@
SCHEME = KeepingYouAwake
WORKSPACE = KeepingYouAwake.xcworkspace
VERSION = 1.5.0beta1
VERSION = 1.5.0beta2

OUTPUT_DIR = dist
VENDOR_DIR = Vendor
Expand Down
7 changes: 3 additions & 4 deletions Vendor/Makefile
Expand Up @@ -27,10 +27,9 @@ $(DIST_DIR): $(REPO_DIR)
build
cd $(DIST_DIR) && tar xfvj ../$(BUILD_DIR)/build/Build/Products/Release/Sparkle-*.tar.bz2

# Codesign Updater Binaries
$(CODESIGN_CMD) --deep "$(DIST_DIR)/Sparkle.framework/Versions/A/Resources/Autoupdate"
$(CODESIGN_CMD) --deep "$(DIST_DIR)/Sparkle.framework/Versions/A/Resources/Updater.app"
$(CODESIGN_CMD) "$(DIST_DIR)/Sparkle.framework/Versions/A"
# Remove Redundant Updater Binaries
$(RM) $(DIST_DIR)/Sparkle.framework/Versions/A/Resources/Autoupdate
$(RM) -r $(DIST_DIR)/Sparkle.framework/Versions/A/Resources/Updater.app

# Codesign XPC Services
patch $(DIST_DIR)/bin/codesign_xpc < codesign_xpc_hardened.patch
Expand Down
8 changes: 8 additions & 0 deletions docs/Versions/v1.5.0beta2.json
@@ -0,0 +1,8 @@
{
"date": "2018-12-30 16:00:00",
"file_url": "https://github.com/newmarcel/KeepingYouAwake/releases/download/1.5.0beta2/KeepingYouAwake-1.5.0beta2.zip",
"file_length": 2548397,
"file_version": "1050003",
"file_short_version": "1.5.0beta2",
"is_prerelease": true
}
14 changes: 14 additions & 0 deletions docs/Versions/v1.5.0beta2.md
@@ -0,0 +1,14 @@
# Version 1.5.0beta2: Sandboxed, Hardened & Notarized

<span style="font-weight: bold; color: red;">Please disable <em>Start at login</em> in <em>Preferences</em> before you update. You can also check <a target="_blank" href="https://github.com/newmarcel/KeepingYouAwake/wiki/1.5:-Start-at-Login-Problems">this wiki page</a> for troubleshooting help.</span>

- added an _Updates_ tab to preferences ([#107](https://github.com/newmarcel/KeepingYouAwake/pull/107))
- enabled the _Hardened Runtime_ security feature ([#111](https://github.com/newmarcel/KeepingYouAwake/pull/111))
- enabled the _App Sandbox_ security feature ([#112](https://github.com/newmarcel/KeepingYouAwake/pull/112))
- custom icons need to be placed in `~/Library/Containers/info.marcel-dierkes.KeepingYouAwake/Data/Documents` now and will be migrated during the app update
- _Start at login_ uses a launcher helper app now ([#110](https://github.com/newmarcel/KeepingYouAwake/pull/110))
- the previous login item is not compatible anymore and **it is recommended to disable _Start at login_ before updating**!
- please check [this wiki page](https://github.com/newmarcel/KeepingYouAwake/wiki/1.5:-Start-at-Login-Problems) if you encounter problems
- updated Sparkle to the `ui-separation-and-xpc` version ([#109](https://github.com/newmarcel/KeepingYouAwake/pull/109)) ([#113](https://github.com/newmarcel/KeepingYouAwake/pull/113))

**Beta 2 fixes a bug that prevents 1.5.0 Beta 1 from downloading updates. Please manually re-download Beta 2 from GitHub if you experience any issues.**

0 comments on commit b33c956

Please sign in to comment.