fix(macos): launch service with stable privacy identity

This commit is contained in:
dh
2026-09-11 20:59:56 +02:00
parent d77187e9ec
commit 0e2aa3830f
6 changed files with 160 additions and 0 deletions
@@ -15,6 +15,44 @@ namespace MeetingAssistant.Tests;
public sealed class MacOsMeetingAudioSourceTests
{
[Fact]
public void MacOsServiceLauncherDefinesStablePrivacyIdentity()
{
if (!OperatingSystem.IsMacOS())
{
return;
}
var projectDirectory = Path.GetFullPath(Path.Combine(
AppContext.BaseDirectory,
"..",
"..",
"..",
"..",
"MeetingAssistant"));
var launcherDirectory = Path.Combine(projectDirectory, "Native", "MacOsLauncher");
var infoPlistPath = Path.Combine(launcherDirectory, "Info.plist");
var launcherSourcePath = Path.Combine(launcherDirectory, "main.swift");
Assert.True(File.Exists(infoPlistPath), $"Expected launcher Info.plist at '{infoPlistPath}'.");
Assert.True(File.Exists(launcherSourcePath), $"Expected launcher source at '{launcherSourcePath}'.");
var infoPlist = File.ReadAllText(infoPlistPath);
Assert.Contains("cloud.schweigert.meeting-assistant", infoPlist, StringComparison.Ordinal);
Assert.Contains("NSMicrophoneUsageDescription", infoPlist, StringComparison.Ordinal);
Assert.Contains("NSCalendarsFullAccessUsageDescription", infoPlist, StringComparison.Ordinal);
var launcherSource = File.ReadAllText(launcherSourcePath);
Assert.Contains("set -a", launcherSource, StringComparison.Ordinal);
Assert.Contains("Contents/Resources/app", launcherSource, StringComparison.Ordinal);
var projectFile = File.ReadAllText(Path.Combine(projectDirectory, "MeetingAssistant.csproj"));
Assert.Contains(
"designated => identifier "cloud.schweigert.meeting-assistant"",
projectFile,
StringComparison.Ordinal);
}
[Fact]
public void NativeAudioCaptureIsPackagedAsSignedMacOsAppForPersistentPrivacyGrant()
{