Can I prevent a user from taking screenshots in a Mac application?

后端 未结 5 1329
忘了有多久
忘了有多久 2020-12-15 01:17

I have an image application and I want to release it where unregistered users can view the files but cant save until they\'ve registered.

I\'m looking for a way to p

5条回答
  •  不思量自难忘°
    2020-12-15 02:07

    One option that is very user hostile is to change the folder in which screen captures are stored to a /dev/null style directory by changing the com.apple.screencapture setting.

    A huge downside of this is that you might mess up the users settings and not being able to restore them if the exit from your application isn't clean.


    Another option is to keep track of what files that are created in the screen capture location, see if they match the pattern for name and then remove them.

    This method is still quite hostile though.


    I also investigated if it was possibility to kill the process that handle the screen capture, unfortunately the process that handles it, SystemUIServer just reboots after being killed.


    SystemUIServer seems to refuse taking screenshots if DVD Player currently is playing a DVD. I have no idea how the DVD playback detection works though, but it might be a lead to prevent screenshots.


    Links

    • Technical details about Screenshots in Mac OS X
    • com.apple.screencapture details
    • ScreenCapture.strings - List of error messages from ScreenCapture

    Disclaimer before people start ranting: I have a legit reason to solve this problem, but won't use the com.apple.screencapture -> /dev/null method due to it's downsides.

提交回复
热议问题