From 8151755a09b25d82a49d21a0c6d2155bd01ca486 Mon Sep 17 00:00:00 2001 From: Plaintextnerds Date: Tue, 6 Aug 2024 01:12:26 +0100 Subject: [PATCH] Fix the Mac Catalyst Build --- OpenOTDR/OpenOTDR-MacIOS.csproj | 6 ++++++ OpenOTDR/OpenOTDR.csproj | 10 ++++++++-- OpenOTDR/Pages/ProjectOverviewPage.xaml.cs | 8 +++++--- .../Platforms/MacCatalyst/Entitlements.plist | 20 +++++++++---------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/OpenOTDR/OpenOTDR-MacIOS.csproj b/OpenOTDR/OpenOTDR-MacIOS.csproj index 879aeed..d6ec592 100644 --- a/OpenOTDR/OpenOTDR-MacIOS.csproj +++ b/OpenOTDR/OpenOTDR-MacIOS.csproj @@ -41,6 +41,12 @@ com.baldrai.openotdr + + all + false + True + + diff --git a/OpenOTDR/OpenOTDR.csproj b/OpenOTDR/OpenOTDR.csproj index 7c8c318..a681464 100644 --- a/OpenOTDR/OpenOTDR.csproj +++ b/OpenOTDR/OpenOTDR.csproj @@ -92,14 +92,20 @@ + + MSBuild:Compile + + + MSBuild:Compile + MSBuild:Compile - + MSBuild:Compile - + MSBuild:Compile MSBuild:Compile diff --git a/OpenOTDR/Pages/ProjectOverviewPage.xaml.cs b/OpenOTDR/Pages/ProjectOverviewPage.xaml.cs index 0d425dd..5ae7a3d 100644 --- a/OpenOTDR/Pages/ProjectOverviewPage.xaml.cs +++ b/OpenOTDR/Pages/ProjectOverviewPage.xaml.cs @@ -1,7 +1,7 @@ -using fio = Microsoft.VisualBasic.FileIO; +using Microsoft.EntityFrameworkCore; +using fio = Microsoft.VisualBasic.FileIO; using OpenOTDR.Models; using OpenOTDR.Services; -using Microsoft.EntityFrameworkCore; namespace OpenOTDR.Pages; @@ -57,7 +57,8 @@ private async void OnFileAdd(object sender, EventArgs eventArgs) { { DevicePlatform.Android, new[] { "application/octet-stream", "application/kml" } }, // MIME type { DevicePlatform.WinUI, new[] { ".sor", ".sod", "kml" } }, // file extension - { DevicePlatform.macOS, new[] { "sor", "sod", "kml" } } // UTType values + { DevicePlatform.MacCatalyst, new[] { "public.data" } }, + { DevicePlatform.macOS, new[] { "public.data" } } // UTType values }); PickOptions options = new() @@ -101,6 +102,7 @@ private async void OnFileAdd(object sender, EventArgs eventArgs) } catch (Exception ex) { + // The user canceled or something went wrong } } diff --git a/OpenOTDR/Platforms/MacCatalyst/Entitlements.plist b/OpenOTDR/Platforms/MacCatalyst/Entitlements.plist index de4adc9..38da9a9 100644 --- a/OpenOTDR/Platforms/MacCatalyst/Entitlements.plist +++ b/OpenOTDR/Platforms/MacCatalyst/Entitlements.plist @@ -1,14 +1,12 @@ - + - - - - com.apple.security.app-sandbox - - - com.apple.security.network.client - - + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.files.user-selected.read-write + + -