Skip to content

Instantly share code, notes, and snippets.

@jeremy4971
Last active January 6, 2024 10:30
Show Gist options
  • Save jeremy4971/1e246f74b0eca9b379f5b54f2dcd891f to your computer and use it in GitHub Desktop.
Save jeremy4971/1e246f74b0eca9b379f5b54f2dcd891f to your computer and use it in GitHub Desktop.
#!/bin/sh
###
#
# Created : 2022-11-12
# Last Modified : 2022-11-12
# Version : 1.0
# Tested with : macOS 13.0.1
#
###
###
#
# Common app IDs
#
# Microsoft Teams : com.microsoft.teams
# Slack : com.tinyspeck.slackmacgap
# Google Chrome : com.google.Chrome
# Chrome Remote Desktop : com.google.chrome.remote_desktop.remote-assistance-host-v2
# Mozilla Firefox : org.mozilla.firefox
# Zoom : us.zoom.xos
# TeamViewer : com.teamviewer.TeamViewer
# TeamViewer QuickSupport : com.teamviewer.TeamViewerQS
# AnyDesk : com.philandro.anydesk
# Parsec : tv.parsec.www
# Discord : com.hnc.Discord
# Skype for Business : com.microsoft.SkypeForBusiness
# Skype : com.skype.skype
#
###
# In order to read TCC.db, full disk access must be granted for Terminal.app if executed with it.
# What's the app?
appID="com.google.Chrome"
# Reading TCC.db
auth_value=$(/usr/bin/sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "SELECT auth_value FROM access WHERE client = '$appID' AND service='kTCCServiceScreenCapture';")
if [ "$auth_value" = "2" ]; then
echo "<result>Enabled</result>"; else
echo "<result>Disabled</result>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment