diff --git a/checks/macos.py b/checks/macos.py index 6b7da81..3c0d148 100644 --- a/checks/macos.py +++ b/checks/macos.py @@ -66,3 +66,28 @@ def checkRosettaTranslationStatus(lines): if (len(search('Rosetta translation used: true', lines)) > 0): return [LEVEL_WARNING, "Intel OBS on Apple Silicon Mac", "You are running the Intel version of OBS on an Apple Silicon Mac. You may get improved performance using the Apple Silicon version of OBS."] + + +def checkMacPermissions(lines): + macPerms = search('[macOS] Permission for', lines) + deniedPermissions = [] + + for line in macPerms: + if 'denied' in line: + found = re.search(r'Permission for (.+) denied', line) + if found: + permissionName = found.group(1).title() + permissionDescription = { + "Audio Device Access": "Microphone: OBS requires this permission if you want to capture your microphone.", + "Video Device Access": "Camera: This permission is needed in order to capture content from a webcam or capture card.", + "Accessibility": "Accessibility: For keyboard shortcuts (hotkeys) to work while other apps are focused this permission is needed.", + "Screen Capture": "Screen Recording: OBS requires this permission to be able to capture your screen." + }.get(permissionName) + + if permissionDescription: + deniedPermissions.append(permissionDescription) + + if deniedPermissions: + deniedPermissionsString = "
\n" + return [LEVEL_WARNING, "Permissions Not Granted (" + str(len(deniedPermissions)) + ")", + """The following permissions have not been granted:""" + deniedPermissionsString + "If you would like to grant permissions for the above, follow the instructions in the " + 'macOS Permissions Guide.'] diff --git a/loganalyzer.py b/loganalyzer.py index 6fb58dc..8179ff5 100755 --- a/loganalyzer.py +++ b/loganalyzer.py @@ -181,7 +181,8 @@ def doAnalysis(url=None, filename=None): checkVantage(logLines), checkPortableMode(logLines), checkSafeMode(logLines), - checkSnapPackage(logLines) + checkSnapPackage(logLines), + checkMacPermissions(logLines) ]) messages.extend(checkVideoSettings(logLines)) m = parseScenes(logLines)