Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add insert support for Catalina #32

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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