Skip to content

Commit 210a771

Browse files
committed
Don’t inherit entitlements from the app (#38)
1 parent a464087 commit 210a771

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

LaunchAtLogin.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
E32E9B771EB87EA3000FEEE9 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = E32E9B761EB87EA3000FEEE9 /* main.swift */; };
1313
E32E9B861EB8845E000FEEE9 /* LaunchAtLoginHelper.app in Resources */ = {isa = PBXBuildFile; fileRef = E32E9B741EB87EA3000FEEE9 /* LaunchAtLoginHelper.app */; };
1414
E32E9B931EB889AE000FEEE9 /* copy-helper.sh in Resources */ = {isa = PBXBuildFile; fileRef = E32E9B921EB889AE000FEEE9 /* copy-helper.sh */; };
15+
E3A6EB58249009C3004D7101 /* LaunchAtLogin.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */; };
1516
/* End PBXBuildFile section */
1617

1718
/* Begin PBXContainerItemProxy section */
@@ -33,6 +34,7 @@
3334
E32E9B761EB87EA3000FEEE9 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = main.swift; sourceTree = "<group>"; usesTabs = 1; };
3435
E32E9B7F1EB87EA3000FEEE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3536
E32E9B921EB889AE000FEEE9 /* copy-helper.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; lineEnding = 0; path = "copy-helper.sh"; sourceTree = "<group>"; usesTabs = 1; };
37+
E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = LaunchAtLogin.entitlements; path = LaunchAtLogin/LaunchAtLogin.entitlements; sourceTree = "<group>"; };
3638
E3B8C38A20C0003300272EC0 /* LaunchAtLoginHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LaunchAtLoginHelper.entitlements; sourceTree = "<group>"; };
3739
/* End PBXFileReference section */
3840

@@ -57,6 +59,7 @@
5759
E32E9B591EB87D7B000FEEE9 = {
5860
isa = PBXGroup;
5961
children = (
62+
E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */,
6063
E32E9B651EB87D7B000FEEE9 /* LaunchAtLogin */,
6164
E32E9B751EB87EA3000FEEE9 /* LaunchAtLoginHelper */,
6265
E32E9B641EB87D7B000FEEE9 /* Products */,
@@ -198,6 +201,7 @@
198201
files = (
199202
E32E9B861EB8845E000FEEE9 /* LaunchAtLoginHelper.app in Resources */,
200203
E32E9B931EB889AE000FEEE9 /* copy-helper.sh in Resources */,
204+
E3A6EB58249009C3004D7101 /* LaunchAtLogin.entitlements in Resources */,
201205
);
202206
runOnlyForDeploymentPostprocessing = 0;
203207
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
</dict>
8+
</plist>

LaunchAtLogin/copy-helper.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ cp -rf "$origin_helper_path" "$helper_dir/"
1111
defaults write "$helper_path/Contents/Info" CFBundleIdentifier -string "$PRODUCT_BUNDLE_IDENTIFIER-LaunchAtLoginHelper"
1212

1313
if [[ -n $CODE_SIGN_ENTITLEMENTS ]]; then
14-
codesign --force --entitlements="$CODE_SIGN_ENTITLEMENTS" --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
14+
codesign --force --entitlements="$(dirname "$origin_helper_path")/LaunchAtLogin.entitlements" --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
1515
else
1616
codesign --force --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
1717
fi
1818

1919
if [[ $CONFIGURATION == "Release" ]]; then
2020
rm -rf "$origin_helper_path"
2121
rm "$(dirname "$origin_helper_path")/copy-helper.sh"
22+
rm "$(dirname "$origin_helper_path")/LaunchAtLogin.entitlements"
2223
fi

0 commit comments

Comments
 (0)