Skip to content

An open-source cross-platform alternative to AirDrop

fix: "would like to access data from other apps" warning popup on macOS Sequoia (#1944)

Shlomobe531e2317b8
diff --git a/app/macos/Runner/DebugProfile.entitlements b/app/macos/Runner/DebugProfile.entitlements
index 3c83f71b..096b72c3 100644
--- a/app/macos/Runner/DebugProfile.entitlements
+++ b/app/macos/Runner/DebugProfile.entitlements
@@ -6,7 +6,7 @@
<true/>
<key>com.apple.security.application-groups</key>
<array>
- <string>org.localsend.shared_group</string>
+ <string>$(AppIdentifierPrefix)localsend.shared_group</string>
</array>
<key>com.apple.security.cs.allow-jit</key>
<true/>
diff --git a/app/macos/Runner/Info.plist b/app/macos/Runner/Info.plist
index 6165c691..66d0b556 100644
--- a/app/macos/Runner/Info.plist
+++ b/app/macos/Runner/Info.plist
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>AppIdentifierPrefix</key>
+ <string>$(AppIdentifierPrefix)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
diff --git a/app/macos/Runner/Release.entitlements b/app/macos/Runner/Release.entitlements
index 8b9bacbe..57f16075 100644
--- a/app/macos/Runner/Release.entitlements
+++ b/app/macos/Runner/Release.entitlements
@@ -6,7 +6,7 @@
<true/>
<key>com.apple.security.application-groups</key>
<array>
- <string>org.localsend.shared_group</string>
+ <string>$(AppIdentifierPrefix)localsend.shared_group</string>
</array>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
diff --git a/app/macos/Runner/Shared.swift b/app/macos/Runner/Shared.swift
index 895dc8cb..bcf483ce 100644
--- a/app/macos/Runner/Shared.swift
+++ b/app/macos/Runner/Shared.swift
@@ -1,7 +1,8 @@
import Foundation
import Defaults
-let sharedDefaults = UserDefaults(suiteName: "org.localsend.shared_group")!
+let teamIdentifierPrefix = Bundle.main.infoDictionary!["AppIdentifierPrefix"] as! String
+let sharedDefaults = UserDefaults(suiteName: "\(teamIdentifierPrefix)localsend.shared_group")!
typealias FileBookmarkData = Data
extension Defaults.Keys {
diff --git a/app/macos/ShareExtension/Info.plist b/app/macos/ShareExtension/Info.plist
index 4cd7e5ee..3c0aee04 100644
--- a/app/macos/ShareExtension/Info.plist
+++ b/app/macos/ShareExtension/Info.plist
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>AppIdentifierPrefix</key>
+ <string>$(AppIdentifierPrefix)</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
diff --git a/app/macos/ShareExtension/ShareExtension.entitlements b/app/macos/ShareExtension/ShareExtension.entitlements
index bc6a2cc7..7b5b5237 100644
--- a/app/macos/ShareExtension/ShareExtension.entitlements
+++ b/app/macos/ShareExtension/ShareExtension.entitlements
@@ -6,7 +6,7 @@
<true/>
<key>com.apple.security.application-groups</key>
<array>
- <string>org.localsend.shared_group</string>
+ <string>$(TeamIdentifierPrefix)localsend.shared_group</string>
</array>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>