From 3781487166b4cf09faf177a0e9cea6dfaaacb80a Mon Sep 17 00:00:00 2001 From: Bryce Pauken Date: Sat, 7 Dec 2019 19:38:26 -0800 Subject: [PATCH] Add insert support for Catalina --- tccutil.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tccutil.py b/tccutil.py index 8a8c149..eff3a09 100755 --- a/tccutil.py +++ b/tccutil.py @@ -11,7 +11,7 @@ util_name = os.path.basename(sys.argv[0]) # Utility Version -util_version = '1.2.4' +util_version = '1.2.5' # Current OS X version osx_version = version(mac_ver()[0]) @@ -104,8 +104,10 @@ def open_database(): break # check if table in DB has expected structure: if not (accessTableDigest == "8e93d38f7c" # prior to El Capitan - or (osx_version >= version('10.11') and accessTableDigest in - ["9b2ea61b30", "1072dc0e4b", "80a4bb6912"])): + or (osx_version >= version('10.11') # El Capitan through Mojave + and accessTableDigest in ["9b2ea61b30", "1072dc0e4b", "80a4bb6912"]) + or (osx_version >= version('10.15') # Catalina and later + and accessTableDigest == "ecc443615f")): print("TCC Database structure is unknown.") sys.exit(1) @@ -192,7 +194,11 @@ def insert_client(client): # as the default value to enable it is different. cli_util_or_bundle_id(client) verbose_output("Inserting \"%s\" into Database..." % (client)) - if osx_version >= version('10.11'): # El Capitan or higher. + if osx_version >= version('10.15'): # Catalina and later + c.execute("INSERT or REPLACE INTO \ +access VALUES('kTCCServiceAccessibility','%s',%s,1,1,NULL,NULL,NULL,'UNUSED',NULL,0,NULL)" + % (client, client_type)) + elif osx_version >= version('10.11'): # El Capitan through Mojave c.execute("INSERT or REPLACE INTO \ access VALUES('kTCCServiceAccessibility','%s',%s,1,1,NULL,NULL)" % (client, client_type))