Skip to content

Commit 06ecf9a

Browse files
committed
Fix MAS entitlements and group IDs to prevent crash and Transporter rejection
1 parent 418445e commit 06ecf9a

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

desktop/entitlements.mas.inherit.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
<true/>
77
<key>com.apple.security.inherit</key>
88
<true/>
9+
<key>com.apple.security.application-groups</key>
10+
<array>
11+
<string>group.4MSL3T2696.com.iandmiller.visualtimer</string>
12+
</array>
913
<key>com.apple.security.cs.allow-jit</key>
1014
<true/>
1115
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>

desktop/entitlements.mas.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>group.4MSL3T2696.com.iandmiller.visualtimer</string>
10+
</array>
711
<key>com.apple.security.network.client</key>
812
<true/>
913
<key>com.apple.security.files.user-selected.read-write</key>

scripts/fix-mas-icon.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ exports.default = async function(context) {
118118
const helperPath = path.join(helpersPath, helper);
119119
if (fs.statSync(helperPath).isFile() && !helper.endsWith('.plist')) {
120120
try {
121-
// Don't use --options runtime for MAS builds (that's for Developer ID only)
121+
// Don't use --options runtime for MAS builds
122122
execSync(`codesign --force --sign "${identity}" --entitlements "${entitlementsInherit}" "${helperPath}"`, {
123123
stdio: 'inherit'
124124
});
@@ -172,10 +172,20 @@ exports.default = async function(context) {
172172
console.log('✅ Re-signed Electron Framework (bundle only)');
173173
}
174174

175+
// Check for provisioning profile to determine main app signing strategy
176+
const hasProvisioningProfile = fs.existsSync(path.join(appBundlePath, 'Contents', 'embedded.provisionprofile'));
177+
175178
// Sign main app bundle last (no --options runtime for MAS builds)
176-
execSync(`codesign --force --sign "${identity}" --entitlements "${entitlements}" "${appBundlePath}"`, {
177-
stdio: 'inherit'
178-
});
179+
if (hasProvisioningProfile) {
180+
console.log('Provisioning profile found. Signing WITHOUT --entitlements flag to avoid team-identifier error...');
181+
execSync(`codesign --force --sign "${identity}" "${appBundlePath}"`, {
182+
stdio: 'inherit'
183+
});
184+
} else {
185+
execSync(`codesign --force --sign "${identity}" --entitlements "${entitlements}" "${appBundlePath}"`, {
186+
stdio: 'inherit'
187+
});
188+
}
179189
console.log('✅ App bundle re-signed successfully');
180190
} catch (error) {
181191
console.error('❌ Failed to re-sign app bundle:', error.message);

0 commit comments

Comments
 (0)