Qt application is not requesting microphone access

Hi


I have a Qt application written in C++ with Qt 5.14.1 on macOS Catalina. When I start the application from Qt Creator the application requests microphone access when recording is started. However, the installed application does not request. I have tried to reset permissions with


'tcutil reset Microphone'


but still I get the same behavior. The application bundle is signed with codesign


codesign --deep --strict --timestamp --force --verify --verbose \

         --entitlements ./Entitlements.plist \
         --sign "Developer ID Application: Emoshape Inc." \
         --options runtime ./build/$APP_NAME.app


and the Entitlements.plist is


<?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.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
</dict>
</plist>
Also, Info.plist file has the following two entries

<key>NSCameraUsageDescription</key>

<string>The application wants to access the camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The application wants to access the microphone.</string>


Can you tell me what I am missing ?


thanks

Bogdan

Replies

Hi


I have noticed that when signing the application bundle with


codesign --strict --timestamp --force --verify --verbose \
  --entitlements ./Entitlements.plist \
  --sign "..." \
  --options runtime ./build/$APP_NAME.app \
  --deep


the microphone access is not requested anymore when starting the recording. However, removing --deep option seems to solve this problem, but the signed bundle does not pass the signing check


codesign --verify --verbose=4 --deep --strict ./build/$APP_NAME.app


and the application cannot be notarised. Is there a solution for this problem ? Or could this behavior be considered a bug ?

There are many posts about notarization problems. Qt is frequently involved. Either your bundle, your zip file, your entitlements, or your Info.plist is invalid.

This is not a notarization problem: it seems that somehow after signing the bundle with --deep option the application does not request anymore microphone access.

You shouldn't be using --deep to sign the bundle. If I understand what I've read, that makes it a notarization problem.

with --deep option the notarisation process is successful, but the application does not request anymore microphone access.

without --deep option the application cannot be notarised, but it requests microphone access (I have verified on 2 different systems that this is not a local problem)

So that means your bundle is invalid. When you do the signature correctly, the app doesn't work properly. Fix the bug instead of trying to hack your way through notarization. Your hacks will inevitably fail at some point. Then you'll have two problems.

Did you ever solve this? I'm running into the same issue when I notarize a Unity App for MacOS.

Solution is as following:

  1. Create an entitlment called ent.plist (or whatever name) that contains the following line:

<!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.device.audio-input</key>
<true/>

</dict>

</plist>
  1. Code sign your application using the --entitlement ent.plist

Done!