karaggeorge / mac-screen-capture-permissions

Check and request permission to capture the screen
117 stars 35 forks source link

macOS Big Sur show error: "identity of the developer cannot be confirmed" #5

Closed li986390329 closed 3 years ago

li986390329 commented 3 years ago

Question: I use it in my application, everything works fine on Mac OS 10.x.x. but when I use Mac OS 11, the Launcah application will appear "identity of the developer cannot be confirmed". If I remove this dependency, Then this error will disappear. So please help me, I don't know what went wrong, thank you.

System: macOS Big Sur 11.0.1 node: 12

BertholetDamien commented 3 years ago

Hi!

I have the exact same problem. It's because this plugin use an external lib. Here the error you can see after investigation: _message: File /Applications/Berrycast.app/Contents/Resources/app.asar.unpacked/nodemodules/mac-screen-capture-permissions/screen-capture-permissions failed on rPathCmd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCore.dylib (rpath resolved to: (path not found), bundleURL: /Applications/Berrycast.app)

But I just found that api from electron 8.0+ that allow you to do the check of the permission directly with electron: https://www.electronjs.org/docs/api/system-preferences#systempreferencesgetmediaaccessstatusmediatype-windows-macos

I will remove that plugin and remove that Gatekeeper warning =)

Hope that's help!

li986390329 commented 3 years ago

@BertholetDamien Thanks, I have removed this plugin.

Lazare-42 commented 3 years ago

I have faced the same problem but still need this library. You can solve this issue by running the following command on the binary: install_name_tool -delete_rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx ./node_modules/mac-screen-capture-permissions/screen-capture-permissions

Lazare-42 commented 3 years ago

If you run

otool -l ./node_modules/mac-screen-capture-permissions/screen-capture-permissions

You'll notice that the culprit path

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx

is a fallback for

/usr/lib/swift

which all users should have from MacOS 10.13.4 (if I remember correctly).

So this modification shouldn't raise an issue.

alexgurr commented 3 years ago

Also having this issue ☝️

karaggeorge commented 3 years ago

Is there any way to fix this from the library side? Or is there no workaround other than the ones mentioned above?

csett86 commented 3 years ago

This is fixed from a library side since #6 and once a release it cut, the issue is also solved in a released version.

sirtimid commented 3 years ago

@karaggeorge any news on the release?

csett86 commented 3 years ago

Fixed with release v2.0.0 just 1 hour ago. Thank you @karaggeorge

BertholetDamien commented 3 years ago

Nice to hear that! Thanks for the good work gang.

karaggeorge commented 3 years ago

Thank you guys for all the awesome work! And sorry again for taking so long with this