Improve behavior in macOS sandbox

This commit is contained in:
yash-signal
2026-03-03 17:24:12 -06:00
committed by GitHub
parent f1c285f58e
commit 0b5b7dc137
7 changed files with 22 additions and 5 deletions

View File

@@ -105,7 +105,8 @@ export function setup(
showDebugLogWindow: () => Promise<void>,
forceEnable = false
): void {
const isEnabled = !isProduction(app.getVersion()) || forceEnable;
const isEnabled =
(!isProduction(app.getVersion()) || forceEnable) && !process.mas;
if (isEnabled) {
logger.info(`crashReporter: ${forceEnable ? 'force ' : ''}enabled`);

View File

@@ -151,7 +151,7 @@ export const createTemplate = (
},
]
: []),
...(devTools && platform !== 'linux'
...(devTools && platform !== 'linux' && !process.mas
? [
{
label: i18n('icu:forceUpdate'),

View File

@@ -28,6 +28,12 @@ export function updateDefaultSession(
strictAssert(videoRequested, 'Not requesting video');
strictAssert(!audioRequested, 'Requesting audio');
// desktopCapturer.getSources() will crash in the MAS sandbox.
// This should never be reached because MAS requires
// macOS 15+ where we use @indutny/mac-screen-share directly
// and never call getDisplayMedia().
strictAssert(!process.mas, 'Unexpected getDisplayMedia() in MAS build');
// macOS: if screen sharing is actively denied, Sonoma will crash
// when we try to get the sources.
if (

View File

@@ -23,6 +23,8 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>U68MSDN6DR.org.whispersystems.signal-desktop</string>

View File

@@ -480,8 +480,7 @@
"extendInfo": {
"ElectronTeamID": "U68MSDN6DR",
"NSCameraUsageDescription": "Signal uses your camera for video calling.",
"NSMicrophoneUsageDescription": "Signal uses your microphone for voice and video calling.",
"ITSAppUsesNonExemptEncryption": true
"NSMicrophoneUsageDescription": "Signal uses your microphone for voice and video calling."
}
},
"win": {

View File

@@ -21,7 +21,7 @@ export async function afterPack({
packager,
electronPlatformName,
}: AfterPackContext): Promise<void> {
if (electronPlatformName !== 'darwin' && electronPlatformName !== 'mas') {
if (electronPlatformName !== 'darwin') {
return;
}

View File

@@ -108,6 +108,15 @@ export class DesktopCapturer {
step: Step.NativeMacOS,
stream: this.#getNativeMacOSStream(),
};
} else if (process.mas) {
// MAS without native ScreenCaptureKit support: desktopCapturer.getSources()
// is unavailable in the App Store sandbox. Gracefully report an error.
this.#state = { step: Step.Error };
options.onError(
new Error(
'Screen sharing requires macOS 15+ on the Mac App Store version'
)
);
} else {
this.#state = { step: Step.RequestingMedia, promise: this.#getStream() };
}