Skip to content

Commit

Permalink
Add insert support for Catalina
Browse files Browse the repository at this point in the history
  • Loading branch information
brycebostwick committed Dec 8, 2019
1 parent 08d652c commit 3781487
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tccutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 3781487

Please sign in to comment.