From 8e596165ab389e7ac967143ffa68e5611cf281df Mon Sep 17 00:00:00 2001
From: Jonathan White <support@dmapps.us>
Date: Tue, 5 Feb 2019 12:05:46 -0500
Subject: [PATCH] Add MacOS entitlements to fix TouchID integration

* Fix #2676
---
 release-tool                        |  2 +-
 share/macosx/keepassxc.entitlements | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 share/macosx/keepassxc.entitlements

diff --git a/release-tool b/release-tool
index 9d9d4fa9f..82d4fbc39 100755
--- a/release-tool
+++ b/release-tool
@@ -1147,7 +1147,7 @@ appsign() {
                 fi
 
                 logInfo "Signing app using codesign..."
-                codesign --sign "${key}" --verbose --deep ./app/KeePassXC.app
+                codesign --sign "${key}" --verbose --deep --entitlements ${orig_dir}/share/macosx/keepassxc.entitlements ./app/KeePassXC.app
 
                 if [ 0 -ne $? ]; then
                     cd "${orig_dir}"
diff --git a/share/macosx/keepassxc.entitlements b/share/macosx/keepassxc.entitlements
new file mode 100644
index 000000000..a63705585
--- /dev/null
+++ b/share/macosx/keepassxc.entitlements
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-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>com.apple.application-identifier</key>
+		<string>org.keepassx.keepassxc</string>
+		<key>com.apple.developer.aps-environment</key>
+		<string>production</string>
+		<key>com.apple.security.network.client</key>
+		<true/>
+		<key>com.apple.security.app-sandbox</key>
+		<true/>
+		<key>com.apple.security.print</key>
+		<true/>
+		<key>com.apple.security.app-sandbox</key>
+		<false/>
+		<key>keychain-access-groups</key>
+		<array>
+			<string>org.keepassx.keepassxc</string>
+		</array>
+		<key>com.apple.security.files.user-selected.read-only</key>
+		<false/>
+	</dict>
+</plist>
\ No newline at end of file