Skip to content

Commit

Permalink
Add macOS permissions for USB-Serial and DeckLink devices
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <[email protected]>
  • Loading branch information
g-maxime committed Jul 17, 2024
1 parent 925e06b commit aa8fd00
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Project/Mac/Helpers.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
3 changes: 2 additions & 1 deletion Project/Mac/mkdmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ if [ "$KIND" = "GUI" ]; then
exit 1
fi
cp -R "../../Source/GUI/dvrescue/build/dvrescue/${APPNAME}.app" "${FILES}"
rm -fr "${FILES}/${APPNAME}.app/Contents/Frameworks/pkgconfig"

# first pass, sign everything
codesign --identifier "net.MediaArea.${APPNAME_lower}.mac-${KIND_lower}" --verbose --force --deep --options=runtime --preserve-metadata=entitlements,identifier --sign="Developer ID Application: ${SIGNATURE}" "${FILES}/${APPNAME}.app"
codesign --identifier "net.MediaArea.${APPNAME_lower}.mac-${KIND_lower}.libs" --verbose --force --options=runtime --sign="Developer ID Application: ${SIGNATURE}" "${FILES}/${APPNAME}.app/Contents/Libraries/"*
# add entitlements
codesign --identifier "net.MediaArea.${APPNAME_lower}.mac-${KIND_lower}" --verbose --force --options=runtime --sign="Developer ID Application: ${SIGNATURE}" --entitlements "../../Source/GUI/dvrescue/dvrescue/dvrescue.entitlements" "${FILES}/${APPNAME}.app/Contents/MacOS/dvrescue"
codesign --identifier "net.MediaArea.${APPNAME_lower}.mac-${KIND_lower}.helpers" --verbose --force --options=runtime --sign="Developer ID Application: ${SIGNATURE}" "${FILES}/${APPNAME}.app/Contents/Helpers/"*
codesign --identifier "net.MediaArea.${APPNAME_lower}.mac-${KIND_lower}.helpers" --verbose --force --options=runtime --sign="Developer ID Application: ${SIGNATURE}" --entitlements "Helpers.entitlements" "${FILES}/${APPNAME}.app/Contents/Helpers/"*
# second pass, resign
codesign --identifier "net.MediaArea.${APPNAME_lower}.mac-${KIND_lower}" --verbose --force --deep --options=runtime --preserve-metadata=entitlements,identifier --sign="Developer ID Application: ${SIGNATURE}" "${FILES}/${APPNAME}.app"
fi
Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/dvrescue/dvrescue/CapturePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ Rectangle {

decklinkConfigButton.visible: isDecklink
decklinkConfigButton.onClicked: {
var combinedControls = [{name : 'No control', id: ''}].concat(JSON.parse(controls))
var combinedControls = [{name : 'No control', id: ''},{name : 'Native', id: 'native'}].concat(JSON.parse(controls))
console.debug(JSON.stringify(combinedControls))

decklinkConfigPopup.controlsModel = combinedControls;
Expand Down
12 changes: 12 additions & 0 deletions Source/GUI/dvrescue/dvrescue/dvrescue.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,17 @@
<true/>
<key>com.apple.security.assets.movies.read-write</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<string>com.blackmagic-design.desktopvideo.DeckLinkHardwareXPCService</string>
<key>com.apple.security.temporary-exception.shared-preference.read-only</key>
<string>com.blackmagic-design.desktopvideo.prefspanel</string>
<key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
<array>
<string>/dev/tty.RS422 Deck Control</string>
</array>
</dict>
</plist>

0 comments on commit aa8fd00

Please sign in to comment.