From 41db13d186a9a80f3afe94386e0df4063dc89acd Mon Sep 17 00:00:00 2001 From: cmorten Date: Fri, 28 Jan 2022 19:44:56 +0000 Subject: [PATCH] feat: try to update TCC user db even without sip --- package.json | 2 +- src/macOS/setup.ts | 7 ++++++- src/macOS/updateTccDb.ts | 10 ++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 66245b8..acd57e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@guidepup/setup", - "version": "0.2.1", + "version": "0.2.2", "description": "Setup your environment for screen-reader automation.", "main": "lib/index.js", "typings": "lib/index.d.ts", diff --git a/src/macOS/setup.ts b/src/macOS/setup.ts index 0da9456..8dee145 100644 --- a/src/macOS/setup.ts +++ b/src/macOS/setup.ts @@ -16,9 +16,14 @@ export async function setup(): Promise { enableAppleScriptControlSystemDefaults(); disableSplashScreenSystemDefaults(); + try { + updateUserTccDb(); + } catch (_) { + // ignore + } + if (!isSipEnabled()) { writeDatabaseFile(); - updateUserTccDb(); updateSystemTccDb(); return; diff --git a/src/macOS/updateTccDb.ts b/src/macOS/updateTccDb.ts index 5e02bdf..782b796 100644 --- a/src/macOS/updateTccDb.ts +++ b/src/macOS/updateTccDb.ts @@ -7,42 +7,52 @@ const entries: string[] = [ `'kTCCServicePostEvent','/usr/sbin/sshd',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, `'kTCCServicePostEvent','/bin/bash',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, `'kTCCServicePostEvent','com.apple.Terminal',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, + `'kTCCServicePostEvent','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, // Permit Control Of Device `'kTCCServiceAccessibility','/usr/sbin/sshd',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, `'kTCCServiceAccessibility','/bin/bash',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, `'kTCCServiceAccessibility','com.apple.Terminal',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, + `'kTCCServiceAccessibility','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, // Permit Control Of System Events `'kTCCServiceAppleEvents','/usr/sbin/sshd',1,2,3,1,NULL,NULL,0,'com.apple.systemevents',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','/bin/bash',1,2,3,1,NULL,NULL,0,'com.apple.systemevents',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','com.apple.Terminal',0,2,3,1,NULL,NULL,0,'com.apple.systemevents',NULL,NULL,${epoch}`, + `'kTCCServiceAppleEvents','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,0,'com.apple.systemevents',NULL,NULL,${epoch}`, // Permit Control Of VoiceOver `'kTCCServiceAppleEvents','/usr/sbin/sshd',1,2,3,1,NULL,NULL,0,'com.apple.VoiceOver',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','/bin/bash',1,2,3,1,NULL,NULL,0,'com.apple.VoiceOver',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','com.apple.Terminal',0,2,3,1,NULL,NULL,0,'com.apple.VoiceOver',NULL,NULL,${epoch}`, + `'kTCCServiceAppleEvents','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,0,'com.apple.VoiceOver',NULL,NULL,${epoch}`, // Permit Control Of VoiceOver Utility `'kTCCServiceAppleEvents','/usr/sbin/sshd',1,2,3,1,NULL,NULL,0,'com.apple.VoiceOverUtility',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','/bin/bash',1,2,3,1,NULL,NULL,0,'com.apple.VoiceOverUtility',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','com.apple.Terminal',0,2,3,1,NULL,NULL,0,'com.apple.VoiceOverUtility',NULL,NULL,${epoch}`, + `'kTCCServiceAppleEvents','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,0,'com.apple.VoiceOverUtility',NULL,NULL,${epoch}`, // Permit Control Of Finder `'kTCCServiceAppleEvents','/usr/sbin/sshd',1,2,3,1,NULL,NULL,0,'com.apple.finder',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','/bin/bash',1,2,3,1,NULL,NULL,0,'com.apple.finder',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','com.apple.Terminal',0,2,3,1,NULL,NULL,0,'com.apple.finder',NULL,NULL,${epoch}`, + `'kTCCServiceAppleEvents','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,0,'com.apple.finder',NULL,NULL,${epoch}`, // Permit Control Of Safari `'kTCCServiceAppleEvents','/usr/sbin/sshd',1,2,3,1,NULL,NULL,0,'com.apple.Safari',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','/bin/bash',1,2,3,1,NULL,NULL,0,'com.apple.Safari',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','com.apple.Terminal',0,2,3,1,NULL,NULL,0,'com.apple.Safari',NULL,NULL,${epoch}`, + `'kTCCServiceAppleEvents','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,0,'com.apple.Safari',NULL,NULL,${epoch}`, // Permit Control Of Playwright `'kTCCServiceAppleEvents','/usr/sbin/sshd',1,2,3,1,NULL,NULL,0,'org.webkit.Playwright',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','/bin/bash',1,2,3,1,NULL,NULL,0,'org.webkit.Playwright',NULL,NULL,${epoch}`, `'kTCCServiceAppleEvents','com.apple.Terminal',0,2,3,1,NULL,NULL,0,'org.webkit.Playwright',NULL,NULL,${epoch}`, + `'kTCCServiceAppleEvents','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,0,'org.webkit.Playwright',NULL,NULL,${epoch}`, // Permit Access To Microphone `'kTCCServiceMicrophone','/usr/sbin/sshd',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,NULL,${epoch}`, `'kTCCServiceMicrophone','/bin/bash',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,NULL,${epoch}`, `'kTCCServiceMicrophone','com.apple.Terminal',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,NULL,${epoch}`, + `'kTCCServiceMicrophone','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,NULL,${epoch}`, // Permit Capture Of System Display `'kTCCServiceScreenCapture','/usr/sbin/sshd',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, `'kTCCServiceScreenCapture','/bin/bash',1,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, `'kTCCServiceScreenCapture','com.apple.Terminal',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, + `'kTCCServiceScreenCapture','/usr/local/opt/runner/runprovisioner.sh',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, // Permit VoiceOver Access To Location `'kTCCServiceLiverpool','com.apple.VoiceOverUtility',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`, `'kTCCServiceLiverpool','com.apple.VoiceOver',0,2,3,1,NULL,NULL,NULL,'UNUSED',NULL,0,${epoch}`,