Skip to content

Commit de973c4

Browse files
committed
build: make entitlement use configurable
Various configurations (paid/free/no ADP account) supported.
1 parent 0967be5 commit de973c4

10 files changed

+133
-30
lines changed

Build.xcconfig

+14
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,17 @@ CURRENT_PROJECT_VERSION = 33
2222

2323
// Codesigning settings defined optionally, see Documentation/iOSDevelopment.md
2424
#include? "CodeSigning.xcconfig"
25+
26+
// Entitlements based off of CodeSigning settings
27+
IOS_CODE_SIGN_ENTITLEMENTS_YES = Platform/iOS/iOS.entitlements
28+
IOS_CODE_SIGN_ENTITLEMENTS_NO =
29+
IOS_CODE_SIGN_ENTITLEMENTS = $(IOS_CODE_SIGN_ENTITLEMENTS_$(DEVELOPER_ACCOUNT_PAID:default=NO))
30+
MAC_CODE_SIGN_ENTITLEMENTS_YES = Platform/macOS/macOS.entitlements
31+
MAC_CODE_SIGN_ENTITLEMENTS_NO = Platform/macOS/macOS-unsigned.entitlements
32+
MAC_CODE_SIGN_ENTITLEMENTS = $(MAC_CODE_SIGN_ENTITLEMENTS_$(DEVELOPER_ACCOUNT_VM_ACCESS:default=NO))
33+
HELPER_CODE_SIGN_ENTITLEMENTS_YES = QEMUHelper/QEMUHelper.entitlements
34+
HELPER_CODE_SIGN_ENTITLEMENTS_NO = QEMUHelper/QEMUHelper-unsigned.entitlements
35+
HELPER_CODE_SIGN_ENTITLEMENTS = $(HELPER_CODE_SIGN_ENTITLEMENTS_$(DEVELOPER_ACCOUNT_VM_ACCESS:default=NO))
36+
LAUNCHER_CODE_SIGN_ENTITLEMENTS_YES = QEMULauncher/QEMULauncher.entitlements
37+
LAUNCHER_CODE_SIGN_ENTITLEMENTS_NO = QEMULauncher/QEMULauncher-unsigned.entitlements
38+
LAUNCHER_CODE_SIGN_ENTITLEMENTS = $(LAUNCHER_CODE_SIGN_ENTITLEMENTS_$(DEVELOPER_ACCOUNT_VM_ACCESS:default=NO))

CodeSigning.xcconfig.sample

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ DEVELOPMENT_TEAM = XYZ0123456
88
// - com.myuniquename.QEMULauncher
99
PRODUCT_BUNDLE_PREFIX = com.myuniquename
1010

11+
// Set to YES if you have a valid paid Apple Developer account
12+
DEVELOPER_ACCOUNT_PAID = NO
13+
14+
// Set to YES if you have access to VM entitlements in your account
15+
DEVELOPER_ACCOUNT_VM_ACCESS = NO
16+
1117
// Name of the iOS development signing certificate, you probably do not need
1218
// to change this.
1319
CODE_SIGN_IDENTITY_IOS = Apple Development

Documentation/MacDevelopment.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,9 @@ Similar to the above but builds a `UTM.pkg` for submission to the Mac App Store.
8080

8181
### Xcode Development
8282

83-
To build the Xcode project without a registered developer account, you will need to disable USB and bridged networking support.
83+
By default, Xcode will build UTM unsigned (lacking USB and bridged networking features).
8484

85-
1. Open `Platform/macOS/macOS.entitlements` and delete the entry for `com.apple.vm.device-access`.
86-
2. Open `QEMUHelper/QEMUHelper.entitlements` and delete the entry for `com.apple.vm.networking`.
87-
3. Open `QEMULauncher/QEMULauncher.entitlements` and delete the entry for `com.apple.vm.networking`.
88-
4. In the project settings, select the "macOS" target and go to the "Signing & Capabilities" tab and check the box for "Disable Library Validation".
89-
5. Repeat step 4 for the "QEMUHelper" target.
90-
6. Repeat step 4 for the "QEMULauncher" target.
91-
92-
You should now be able to run and debug UTM. If you have a registered developer account with access to Hypervisor entitlements, you should create a `CodeSigning.xcconfig` file with the proper values (see `CodeSigning.xcconfig.sample`). Otherwise, the build will default to ad-hoc signing.
85+
If you have a registered developer account with access to Hypervisor entitlements, you should create a `CodeSigning.xcconfig` file with the proper values (see `CodeSigning.xcconfig.sample`). Make sure to set `DEVELOPER_ACCOUNT_VM_ACCESS = YES`.
9386

9487
Note that due to a macOS bug, you may get a crash when launching a VM with the debugger attached. The workaround is to start UTM with the debugger detached and attach the debugger with Debug -> Attach to Process after launching a VM. Once you do that, you can start additional VMs without any issues with the debugger.
9588

Documentation/iOSDevelopment.md

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ If you have a paid Apple Developer account, you can find your Team ID at https:/
8484

8585
If you have a free Apple Developer account, you need to generate a new signing certificate. To do so, follow the steps in [iOS App Signer][3] to create a new Xcode project and generate a provisioning profile. After saving the project, open `project.pbxproj` inside your newly created `.xcproj` and look for `DEVELOPMENT_TEAM`. Copy this value to `CodeSigning.xcconfig` and your unique identifier to `PRODUCT_BUNDLE_PREFIX`.
8686

87+
Set `DEVELOPER_ACCOUNT_PAID = YES` if you used a paid Apple Developer account in order to automatically request the increased memory limit entitlement from Apple.
88+
8789
### Tethered Launch
8890

8991
For JIT to work on the latest version of iOS, it must be launched through the debugger. You can do it from Xcode (and detach the debugger after launching) or you can follow [these instructions](TetheredLaunch.md) for an easier way.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>$(TeamIdentifierPrefix)$(PRODUCT_BUNDLE_PREFIX:default=com.utmapp).UTM</string>
10+
</array>
11+
<key>com.apple.security.device.usb</key>
12+
<true/>
13+
<key>com.apple.security.cs.disable-library-validation</key>
14+
<true/>
15+
<key>com.apple.security.files.user-selected.read-write</key>
16+
<true/>
17+
<key>com.apple.security.network.client</key>
18+
<true/>
19+
</dict>
20+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>$(TeamIdentifierPrefix)$(PRODUCT_BUNDLE_PREFIX:default=com.utmapp).UTM</string>
10+
</array>
11+
<key>com.apple.security.device.audio-input</key>
12+
<true/>
13+
<key>com.apple.security.cs.allow-jit</key>
14+
<true/>
15+
<key>com.apple.security.cs.disable-library-validation</key>
16+
<true/>
17+
<key>com.apple.security.files.bookmarks.app-scope</key>
18+
<true/>
19+
<key>com.apple.security.hypervisor</key>
20+
<true/>
21+
<key>com.apple.security.network.client</key>
22+
<true/>
23+
<key>com.apple.security.network.server</key>
24+
<true/>
25+
</dict>
26+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<key>com.apple.security.cs.allow-jit</key>
8+
<true/>
9+
<key>com.apple.security.cs.disable-library-validation</key>
10+
<true/>
11+
<key>com.apple.security.inherit</key>
12+
<true/>
13+
<key>com.apple.security.hypervisor</key>
14+
<true/>
15+
</dict>
16+
</plist>

UTM.xcodeproj/project.pbxproj

+16-6
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,9 @@
20262026
CEEB66452284B942002737B2 /* VMKeyboardButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VMKeyboardButton.m; sourceTree = "<group>"; };
20272027
CEEC811A24E48EC600ACB0B3 /* SettingsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
20282028
CEECE13B25E47D9500A2AAB8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2029+
CEF6F5EA26DDD60500BC434D /* macOS-unsigned.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "macOS-unsigned.entitlements"; sourceTree = "<group>"; };
2030+
CEF6F5EB26DDD63100BC434D /* QEMUHelper-unsigned.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "QEMUHelper-unsigned.entitlements"; sourceTree = "<group>"; };
2031+
CEF6F5EC26DDD65700BC434D /* QEMULauncher-unsigned.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "QEMULauncher-unsigned.entitlements"; sourceTree = "<group>"; };
20292032
CEF83EB824F9ABEA00557D15 /* UTMQemuManager+BlockDevices.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UTMQemuManager+BlockDevices.h"; sourceTree = "<group>"; };
20302033
CEF83EB924F9ABEA00557D15 /* UTMQemuManager+BlockDevices.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UTMQemuManager+BlockDevices.m"; sourceTree = "<group>"; };
20312034
CEF83EBC24F9C3BF00557D15 /* UTMVirtualMachine+Drives.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UTMVirtualMachine+Drives.h"; sourceTree = "<group>"; };
@@ -2454,6 +2457,7 @@
24542457
CE2D954124AD4F980059923A /* Info.plist */,
24552458
FFB02A8E266CB09C006CD71A /* InfoPlist.strings */,
24562459
CE2D953F24AD4F980059923A /* macOS.entitlements */,
2460+
CEF6F5EA26DDD60500BC434D /* macOS-unsigned.entitlements */,
24572461
);
24582462
path = macOS;
24592463
sourceTree = "<group>";
@@ -2924,6 +2928,7 @@
29242928
isa = PBXGroup;
29252929
children = (
29262930
CE6B241025F1F4B30020D43E /* QEMULauncher.entitlements */,
2931+
CEF6F5EC26DDD65700BC434D /* QEMULauncher-unsigned.entitlements */,
29272932
CE6B240A25F1F3CE0020D43E /* main.c */,
29282933
CE6B240F25F1F43A0020D43E /* Info.plist */,
29292934
);
@@ -3044,6 +3049,7 @@
30443049
isa = PBXGroup;
30453050
children = (
30463051
CE03D0D024D9A62B00F76B84 /* QEMUHelper.entitlements */,
3052+
CEF6F5EB26DDD63100BC434D /* QEMUHelper-unsigned.entitlements */,
30473053
CE0DF17025A80B6300A51894 /* Bootstrap.h */,
30483054
CE0DF17125A80B6300A51894 /* Bootstrap.c */,
30493055
CEBDA1DC24D8BDDA0010B5EC /* QEMUHelperProtocol.h */,
@@ -4320,7 +4326,7 @@
43204326
8401FD6F269BE9C600265F0D /* Debug */ = {
43214327
isa = XCBuildConfiguration;
43224328
buildSettings = {
4323-
CODE_SIGN_ENTITLEMENTS = QEMULauncher/QEMULauncher.entitlements;
4329+
CODE_SIGN_ENTITLEMENTS = "$(LAUNCHER_CODE_SIGN_ENTITLEMENTS)";
43244330
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_MAC:default=-)";
43254331
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
43264332
CODE_SIGN_STYLE = Manual;
@@ -4344,7 +4350,7 @@
43444350
8401FD70269BE9C600265F0D /* Release */ = {
43454351
isa = XCBuildConfiguration;
43464352
buildSettings = {
4347-
CODE_SIGN_ENTITLEMENTS = QEMULauncher/QEMULauncher.entitlements;
4353+
CODE_SIGN_ENTITLEMENTS = "$(LAUNCHER_CODE_SIGN_ENTITLEMENTS)";
43484354
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_MAC:default=-)";
43494355
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
43504356
CODE_SIGN_STYLE = Manual;
@@ -4371,6 +4377,7 @@
43714377
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
43724378
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
43734379
CLANG_ENABLE_MODULES = YES;
4380+
CODE_SIGN_ENTITLEMENTS = "$(IOS_CODE_SIGN_ENTITLEMENTS)";
43744381
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_IOS:default=Apple Development)";
43754382
ENABLE_BITCODE = NO;
43764383
ENABLE_PREVIEWS = YES;
@@ -4395,6 +4402,7 @@
43954402
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
43964403
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
43974404
CLANG_ENABLE_MODULES = YES;
4405+
CODE_SIGN_ENTITLEMENTS = "$(IOS_CODE_SIGN_ENTITLEMENTS)";
43984406
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_IOS:default=Apple Development)";
43994407
ENABLE_BITCODE = NO;
44004408
ENABLE_PREVIEWS = YES;
@@ -4419,7 +4427,7 @@
44194427
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
44204428
CLANG_ENABLE_MODULES = YES;
44214429
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
4422-
CODE_SIGN_ENTITLEMENTS = Platform/macOS/macOS.entitlements;
4430+
CODE_SIGN_ENTITLEMENTS = "$(MAC_CODE_SIGN_ENTITLEMENTS)";
44234431
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_MAC:default=-)";
44244432
CODE_SIGN_STYLE = Manual;
44254433
COMBINE_HIDPI_IMAGES = YES;
@@ -4453,7 +4461,7 @@
44534461
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
44544462
CLANG_ENABLE_MODULES = YES;
44554463
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
4456-
CODE_SIGN_ENTITLEMENTS = Platform/macOS/macOS.entitlements;
4464+
CODE_SIGN_ENTITLEMENTS = "$(MAC_CODE_SIGN_ENTITLEMENTS)";
44574465
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_MAC:default=-)";
44584466
CODE_SIGN_STYLE = Manual;
44594467
COMBINE_HIDPI_IMAGES = YES;
@@ -4680,6 +4688,7 @@
46804688
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
46814689
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
46824690
CLANG_ENABLE_MODULES = YES;
4691+
CODE_SIGN_ENTITLEMENTS = "$(IOS_CODE_SIGN_ENTITLEMENTS)";
46834692
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_IOS:default=Apple Development)";
46844693
ENABLE_BITCODE = NO;
46854694
ENABLE_PREVIEWS = YES;
@@ -4711,6 +4720,7 @@
47114720
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
47124721
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
47134722
CLANG_ENABLE_MODULES = YES;
4723+
CODE_SIGN_ENTITLEMENTS = "$(IOS_CODE_SIGN_ENTITLEMENTS)";
47144724
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_IOS:default=Apple Development)";
47154725
ENABLE_BITCODE = NO;
47164726
ENABLE_PREVIEWS = YES;
@@ -4739,7 +4749,7 @@
47394749
isa = XCBuildConfiguration;
47404750
buildSettings = {
47414751
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
4742-
CODE_SIGN_ENTITLEMENTS = QEMUHelper/QEMUHelper.entitlements;
4752+
CODE_SIGN_ENTITLEMENTS = "$(HELPER_CODE_SIGN_ENTITLEMENTS)";
47434753
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_MAC:default=-)";
47444754
CODE_SIGN_STYLE = Manual;
47454755
COMBINE_HIDPI_IMAGES = YES;
@@ -4762,7 +4772,7 @@
47624772
isa = XCBuildConfiguration;
47634773
buildSettings = {
47644774
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
4765-
CODE_SIGN_ENTITLEMENTS = QEMUHelper/QEMUHelper.entitlements;
4775+
CODE_SIGN_ENTITLEMENTS = "$(HELPER_CODE_SIGN_ENTITLEMENTS)";
47664776
CODE_SIGN_IDENTITY = "$(CODE_SIGN_IDENTITY_MAC:default=-)";
47674777
CODE_SIGN_STYLE = Manual;
47684778
COMBINE_HIDPI_IMAGES = YES;

scripts/build_utm.sh

+24-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ usage () {
1717
exit 1
1818
}
1919

20+
PRODUCT_BUNDLE_PREFIX="com.utmapp"
2021
TEAM_IDENTIFIER=
2122
ARCH=arm64
2223
PLATFORM=ios
@@ -87,10 +88,28 @@ fi
8788
xcodebuild archive -archivePath "$OUTPUT" -scheme "$SCHEME" -sdk "$SDK" $ARCH_ARGS -configuration Release CODE_SIGNING_ALLOWED=NO $TEAM_IDENTIFIER_PREFIX
8889
BUILT_PATH=$(find $OUTPUT.xcarchive -name '*.app' -type d | head -1)
8990
find "$BUILT_PATH" -type d -path '*/Frameworks/*.framework' -exec codesign --force --sign - --timestamp=none \{\} \;
90-
if [ "$PLATFORM" != "macos" ]; then
91-
codesign --force --sign - --entitlements "$BASEDIR/../Platform/iOS/iOS.entitlements" --timestamp=none "$BUILT_PATH"
91+
if [ "$PLATFORM" == "macos" ]; then
92+
# always build with vm entitlements, package_mac.sh can strip it later
93+
# this way we can import into Xcode and re-sign from there
94+
UTM_ENTITLEMENTS="/tmp/utm.entitlements"
95+
LAUNCHER_ENTITLEMENTS="/tmp/launcher.entitlements"
96+
HELPER_ENTITLEMENTS="/tmp/helper.entitlements"
97+
cp "$BASEDIR/../Platform/macOS/macOS.entitlements" "$UTM_ENTITLEMENTS"
98+
cp "$BASEDIR/../QEMULauncher/QEMULauncher.entitlements" "$LAUNCHER_ENTITLEMENTS"
99+
cp "$BASEDIR/../QEMUHelper/QEMUHelper.entitlements" "$HELPER_ENTITLEMENTS"
100+
if [ ! -z "$TEAM_IDENTIFIER" ]; then
101+
TEAM_ID_PREFIX="${TEAM_IDENTIFIER}."
102+
fi
103+
104+
/usr/libexec/PlistBuddy -c "Set :com.apple.security.application-groups:0 ${TEAM_ID_PREFIX}${PRODUCT_BUNDLE_PREFIX}.UTM" "$UTM_ENTITLEMENTS"
105+
/usr/libexec/PlistBuddy -c "Set :com.apple.security.application-groups:0 ${TEAM_ID_PREFIX}${PRODUCT_BUNDLE_PREFIX}.UTM" "$HELPER_ENTITLEMENTS"
106+
codesign --force --sign - --entitlements "$LAUNCHER_ENTITLEMENTS" --timestamp=none --options runtime "$BUILT_PATH/Contents/XPCServices/QEMUHelper.xpc/Contents/MacOS/QEMULauncher.app/Contents/MacOS/QEMULauncher"
107+
codesign --force --sign - --entitlements "$HELPER_ENTITLEMENTS" --timestamp=none --options runtime "$BUILT_PATH/Contents/XPCServices/QEMUHelper.xpc/Contents/MacOS/QEMUHelper"
108+
codesign --force --sign - --entitlements "$UTM_ENTITLEMENTS" --timestamp=none --options runtime "$BUILT_PATH/Contents/MacOS/UTM"
109+
rm "$UTM_ENTITLEMENTS"
110+
rm "$LAUNCHER_ENTITLEMENTS"
111+
rm "$HELPER_ENTITLEMENTS"
92112
else
93-
codesign --force --sign - --entitlements "$BASEDIR/../QEMULauncher/QEMULauncher.entitlements" --timestamp=none --options runtime "$BUILT_PATH/Contents/XPCServices/QEMUHelper.xpc/Contents/MacOS/QEMULauncher.app/Contents/MacOS/QEMULauncher"
94-
codesign --force --sign - --entitlements "$BASEDIR/../QEMUHelper/QEMUHelper.entitlements" --timestamp=none --options runtime "$BUILT_PATH/Contents/XPCServices/QEMUHelper.xpc/Contents/MacOS/QEMUHelper"
95-
codesign --force --sign - --entitlements "$BASEDIR/../Platform/macOS/macOS.entitlements" --timestamp=none --options runtime "$BUILT_PATH/Contents/MacOS/UTM"
113+
# always build with iOS entitlements, package.sh can strip it later
114+
codesign --force --sign - --entitlements "$BASEDIR/../Platform/iOS/iOS.entitlements" --timestamp=none "$BUILT_PATH"
96115
fi

scripts/package_mac.sh

+7-10
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,14 @@ cat >"$OPTIONS" <<EOL
6767
</plist>
6868
EOL
6969

70-
cp "$BASEDIR/../Platform/macOS/macOS.entitlements" "$UTM_ENTITLEMENTS"
71-
cp "$BASEDIR/../QEMULauncher/QEMULauncher.entitlements" "$LAUNCHER_ENTITLEMENTS"
72-
cp "$BASEDIR/../QEMUHelper/QEMUHelper.entitlements" "$HELPER_ENTITLEMENTS"
73-
7470
if [ "$MODE" == "unsigned" ]; then
75-
/usr/libexec/PlistBuddy -c "Delete :com.apple.vm.device-access" "$UTM_ENTITLEMENTS"
76-
/usr/libexec/PlistBuddy -c "Delete :com.apple.vm.networking" "$HELPER_ENTITLEMENTS"
77-
/usr/libexec/PlistBuddy -c "Delete :com.apple.vm.networking" "$LAUNCHER_ENTITLEMENTS"
78-
/usr/libexec/PlistBuddy -c "Add :com.apple.security.cs.disable-library-validation bool true" "$UTM_ENTITLEMENTS"
79-
/usr/libexec/PlistBuddy -c "Add :com.apple.security.cs.disable-library-validation bool true" "$LAUNCHER_ENTITLEMENTS"
80-
/usr/libexec/PlistBuddy -c "Add :com.apple.security.cs.disable-library-validation bool true" "$HELPER_ENTITLEMENTS"
71+
cp "$BASEDIR/../Platform/macOS/macOS-unsigned.entitlements" "$UTM_ENTITLEMENTS"
72+
cp "$BASEDIR/../QEMULauncher/QEMULauncher-unsigned.entitlements" "$LAUNCHER_ENTITLEMENTS"
73+
cp "$BASEDIR/../QEMUHelper/QEMUHelper-unsigned.entitlements" "$HELPER_ENTITLEMENTS"
74+
else
75+
cp "$BASEDIR/../Platform/macOS/macOS.entitlements" "$UTM_ENTITLEMENTS"
76+
cp "$BASEDIR/../QEMULauncher/QEMULauncher.entitlements" "$LAUNCHER_ENTITLEMENTS"
77+
cp "$BASEDIR/../QEMUHelper/QEMUHelper.entitlements" "$HELPER_ENTITLEMENTS"
8178
fi
8279

8380
if [ ! -z "$TEAM_ID" ]; then

0 commit comments

Comments
 (0)