Skip to content

Commit 7eca6ac

Browse files
fix default entitlements for non steam apps
1 parent 9a081e8 commit 7eca6ac

6 files changed

Lines changed: 42 additions & 20 deletions

File tree

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
}
8585
}
8686
shell: pwsh
87-
- uses: buildalon/activate-unity-license@development
87+
- uses: buildalon/activate-unity-license@v1
8888
with:
8989
license: 'Personal'
9090
username: ${{ secrets.UNITY_USERNAME }}

dist/index.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58739,7 +58739,7 @@ async function ArchiveXcodeProject(projectRef) {
5873958739
const entitlementsHandle = await fs.promises.open(projectRef.entitlementsPath, fs.constants.O_RDONLY);
5874058740
try {
5874158741
const entitlementsContent = await fs.promises.readFile(entitlementsHandle, 'utf8');
58742-
core.debug(`----- Entitlements content: -----\n${entitlementsContent}\n-----------------------------------`);
58742+
core.info(`----- Entitlements content: -----\n${entitlementsContent}\n-----------------------------------`);
5874358743
}
5874458744
finally {
5874558745
await entitlementsHandle.close();
@@ -59215,11 +59215,22 @@ async function getDefaultEntitlementsMacOS(projectRef) {
5921559215
};
5921659216
break;
5921759217
default:
59218-
defaultEntitlements = {
59219-
'com.apple.security.cs.disable-library-validation': true,
59220-
'com.apple.security.cs.allow-dyld-environment-variables': true,
59221-
'com.apple.security.cs.disable-executable-page-protection': true,
59222-
};
59218+
if (projectRef.isSteamBuild) {
59219+
defaultEntitlements = {
59220+
'com.apple.security.cs.disable-library-validation': true,
59221+
'com.apple.security.cs.allow-dyld-environment-variables': true,
59222+
'com.apple.security.cs.disable-executable-page-protection': true,
59223+
};
59224+
}
59225+
else {
59226+
defaultEntitlements = {
59227+
'com.apple.security.cs.allow-jit': true,
59228+
'com.apple.security.cs.allow-unsigned-executable-memory': true,
59229+
'com.apple.security.cs.allow-dyld-environment-variables': true,
59230+
'com.apple.security.cs.disable-library-validation': true,
59231+
'com.apple.security.cs.disable-executable-page-protection': true,
59232+
};
59233+
}
5922359234
break;
5922459235
}
5922559236
await fs.promises.writeFile(entitlementsPath, plist.build(defaultEntitlements));

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"uuid": "^10.0.0"
2626
},
2727
"devDependencies": {
28-
"@types/node": "^22.15.21",
28+
"@types/node": "^22.15.33",
2929
"@types/plist": "^3.0.5",
3030
"@types/semver": "^7.7.0",
3131
"@types/uuid": "^10.0.0",

src/xcode.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ export async function ArchiveXcodeProject(projectRef: XcodeProject): Promise<Xco
402402
const entitlementsHandle = await fs.promises.open(projectRef.entitlementsPath, fs.constants.O_RDONLY);
403403
try {
404404
const entitlementsContent = await fs.promises.readFile(entitlementsHandle, 'utf8');
405-
core.debug(`----- Entitlements content: -----\n${entitlementsContent}\n-----------------------------------`);
405+
core.info(`----- Entitlements content: -----\n${entitlementsContent}\n-----------------------------------`);
406406
} finally {
407407
await entitlementsHandle.close();
408408
}
@@ -866,12 +866,23 @@ async function getDefaultEntitlementsMacOS(projectRef: XcodeProject): Promise<vo
866866
};
867867
break;
868868
default:
869-
// steam: https://partner.steamgames.com/doc/store/application/platforms#3
870-
defaultEntitlements = {
871-
'com.apple.security.cs.disable-library-validation': true,
872-
'com.apple.security.cs.allow-dyld-environment-variables': true,
873-
'com.apple.security.cs.disable-executable-page-protection': true,
874-
};
869+
if (projectRef.isSteamBuild) {
870+
// steam: https://partner.steamgames.com/doc/store/application/platforms#3
871+
defaultEntitlements = {
872+
'com.apple.security.cs.disable-library-validation': true,
873+
'com.apple.security.cs.allow-dyld-environment-variables': true,
874+
'com.apple.security.cs.disable-executable-page-protection': true,
875+
};
876+
} else {
877+
// use default hardened runtime entitlements
878+
defaultEntitlements = {
879+
'com.apple.security.cs.allow-jit': true,
880+
'com.apple.security.cs.allow-unsigned-executable-memory': true,
881+
'com.apple.security.cs.allow-dyld-environment-variables': true,
882+
'com.apple.security.cs.disable-library-validation': true,
883+
'com.apple.security.cs.disable-executable-page-protection': true,
884+
};
885+
}
875886
break;
876887
}
877888
await fs.promises.writeFile(entitlementsPath, plist.build(defaultEntitlements));

0 commit comments

Comments
 (0)