Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Sandbox Support #112

Merged
merged 5 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@

## Changelog ##

### v1.5.0pre ###
### v1.5.0 ###

- support for App Sandbox
- custom icons need to be placed in `~/Library/Containers/info.marcel-dierkes.KeepingYouAwake/Data/Documents` now and will be migrated with the update

### v1.4.4 ###

- added an Updates tab to preferences
- updated Sparkle to the `ui-separation-and-xpc` version ([#109](https://github.com/newmarcel/KeepingYouAwake/pull/109))
- added an _Updates_ tab to preferences
- enabled the _Hardened Runtime_ security feature
- enabled the _App Sandbox_ security feature
- 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
- enabled the Hardened Runtime security feature
- updated Sparkle to the `ui-separation-and-xpc` version ([#109](https://github.com/newmarcel/KeepingYouAwake/pull/109))

### v1.4.3 ###

Expand Down
4 changes: 2 additions & 2 deletions Configuration.xcconfig
Original file line number Diff line number Diff line change
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.4.4pre
KYA_BUILD_NUMBER = 1040407
KYA_BUNDLE_VERSION = 1.5.0
KYA_BUILD_NUMBER = 1050001
9 changes: 9 additions & 0 deletions KeepingYouAwake.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
DA085D1021D6BAB6003D9B1B /* container-migration.plist in Resources */ = {isa = PBXBuildFile; fileRef = DA085D0F21D6BAB6003D9B1B /* container-migration.plist */; };
DA0ADE6621CBFC5800D34B9D /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA0ADE6521CBFC5800D34B9D /* Sparkle.framework */; };
DA0ADE6821CBFC6000D34B9D /* Sparkle.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA0ADE6521CBFC5800D34B9D /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
DA0ADE6E21CBFCA700D34B9D /* org.sparkle-project.Downloader.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = DA0ADE6A21CBFC9700D34B9D /* org.sparkle-project.Downloader.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -103,6 +104,7 @@
8F6945C71DB7A87C0059C386 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8F6945C81DB7A87D0059C386 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
8F6945C91DB7A87D0059C386 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/MainMenu.strings; sourceTree = "<group>"; };
DA085D0F21D6BAB6003D9B1B /* container-migration.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "container-migration.plist"; sourceTree = "<group>"; };
DA0ADE6521CBFC5800D34B9D /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Vendor/Sparkle/Sparkle.framework; sourceTree = "<group>"; };
DA0ADE6A21CBFC9700D34B9D /* org.sparkle-project.Downloader.xpc */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.xpc-service"; name = "org.sparkle-project.Downloader.xpc"; path = "Vendor/Sparkle/XPCServices/org.sparkle-project.Downloader.xpc"; sourceTree = "<group>"; };
DA0ADE6B21CBFC9700D34B9D /* org.sparkle-project.InstallerConnection.xpc */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.xpc-service"; name = "org.sparkle-project.InstallerConnection.xpc"; path = "Vendor/Sparkle/XPCServices/org.sparkle-project.InstallerConnection.xpc"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -353,6 +355,7 @@
DA54C1331D69CA0000AF9E9D /* InfoPlist.strings */,
DA54C12C1D69C55400AF9E9D /* Localizable.strings */,
DA0CA9FE21D0111600879C8B /* KeepingYouAwake.entitlements */,
DA085D0F21D6BAB6003D9B1B /* container-migration.plist */,
DA637B3D19F14693004C8838 /* Info.plist */,
DA637B3E19F14693004C8838 /* main.m */,
DA7C2E161E2159D200B84F59 /* Configuration.xcconfig */,
Expand Down Expand Up @@ -479,6 +482,9 @@
com.apple.HardenedRuntime = {
enabled = 1;
};
com.apple.Sandbox = {
enabled = 1;
};
};
};
DA658E6A21CE907B0049F4C1 = {
Expand Down Expand Up @@ -526,6 +532,7 @@
DAB128731C2469F300831045 /* Credits.rtf in Resources */,
DA637B4719F14693004C8838 /* MainMenu.xib in Resources */,
DA54C10F1D69C20F00AF9E9D /* Preferences.storyboard in Resources */,
DA085D1021D6BAB6003D9B1B /* container-migration.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -803,6 +810,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = KeepingYouAwake/KeepingYouAwake.entitlements;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 5KESHV9W85;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -821,6 +829,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = KeepingYouAwake/KeepingYouAwake.entitlements;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
COMBINE_HIDPI_IMAGES = YES;
Expand Down
5 changes: 4 additions & 1 deletion KeepingYouAwake/KeepingYouAwake.entitlements
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>
7 changes: 3 additions & 4 deletions KeepingYouAwake/MenuBar Icon/KYAMenuBarIcon.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ - (void)setInactiveIcon:(NSImage *)inactiveIcon

#pragma mark - Private Helper Methods

+ (nonnull NSURL *)applicationSupportDirectoryURL
+ (nonnull NSURL *)documentsURL
{
KYA_AUTO fileManager = NSFileManager.defaultManager;
KYA_AUTO appSupportURL = [fileManager URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask].lastObject;
return [appSupportURL URLByAppendingPathComponent:@"KeepingYouAwake"];
return [fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask].lastObject;
}

+ (BOOL)hasCustomIcons
Expand Down Expand Up @@ -142,7 +141,7 @@ + (NSURL *)iconFileURLWithName:(NSString *)name isRetinaIcon:(BOOL)isRetinaIcon
{
KYA_AUTO suffix = isRetinaIcon ? @"@2x" : @"";
KYA_AUTO composedName = [NSString stringWithFormat:@"%@%@.png", name, suffix];
return [[self applicationSupportDirectoryURL] URLByAppendingPathComponent:composedName];
return [[self documentsURL] URLByAppendingPathComponent:composedName];
}

+ (NSImage *)customActiveIcon
Expand Down
14 changes: 14 additions & 0 deletions KeepingYouAwake/container-migration.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Move</key>
<array>
<array>
<string>${ApplicationSupport}/KeepingYouAwake</string>
<string>${Documents}</string>
</array>
<string>${Library}/Preferences/${BundleId}.plist</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SCHEME = KeepingYouAwake
WORKSPACE = KeepingYouAwake.xcworkspace
VERSION = 1.4.4pre
VERSION = 1.5.0

OUTPUT_DIR = dist
VENDOR_DIR = Vendor
Expand Down