Coder Social home page Coder Social logo

sz-zdy / tccutil Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacobsalmela/tccutil

0.0 1.0 0.0 74 KB

♿️ Command line tool to modify OS X's accessibility database (TCC.db)

Home Page: https://jacobsalmela.com/2014/07/14/tccutil-py-command-line-utility-modifying-accessibility-database-os-x/

License: GNU General Public License v2.0

Python 100.00%

tccutil's Introduction

tccutil
tccutil.py
Modify macOS' TCC.db from the command line

Modify macOS' Transparency, Consent, and Control (TCC) Framework from the Command Line

Apple has a utility in /usr/bin named tccutil, but it only supports one command, which is to reset the entire database. It has been like this for many versions of macOS. I wanted a command-line utility that would be able to add, remove, list, and take other actions.

SIP Notice

This tool needs SIP disabled in order to function. The risk of doing so is up to you.

Discussions on this topic can be found here: jacobsalmela#44

How is tccutil.py Different from other solutions?

  • tccutil.py can be installed without any additional software.

  • it has an easy to use syntax

  • there are other solutions out there, but there were some things I did not like about them:

    • Privacy Manager Services has other dependencies that need to be installed (it has also gone over five years without any updates)

    • tccmanager.py uses a .plist to add items, which is inconvenient.

  • these are also some other projects I found that do similar things

Installation

Homebrew

Install using Homebrew.

brew install tccutil

Depending how you have your $PATH variable setup, you can simply type tccutil (instead of the full path) and it will run this utility instead of Apple's.

Alternative Install

Clone this repo and manually copy tccutil.py to /usr/local/bin or run from any directory with python /path/to/tccutil.py.

Usage

This utility needs super-user priveleges for most operations. It is important that you either run this as root or use sudo, otherwise it won't work and you will end up with “permission denied” errors.

usage: tccutil.py [-h] [--service SERVICE] [--list] [--insert INSERT] [-v]
                  [-r REMOVE] [-e ENABLE] [-d DISABLE] [--version]
                  [ACTION]

Modify Accesibility Preferences

positional arguments:
  ACTION                This option is only used to perform a reset.

optional arguments:
  -h, --help            show this help message and exit
  --service SERVICE, -s SERVICE
                        Set TCC service
  --list, -l            List all entries in the accessibility database.
  --insert INSERT, -i INSERT
                        Adds the given bundle ID or path to the accessibility
                        database.
  -v, --verbose         Outputs additional info for some commands.
  -r REMOVE, --remove REMOVE
                        Removes a given Bundle ID or Path from the
                        Accessibility Database.
  -e ENABLE, --enable ENABLE
                        Enables Accessibility Access for the given Bundle ID
                        or Path.
  -d DISABLE, --disable DISABLE
                        Disables Accessibility Access for the given Bundle ID
                        or Path.
  --version             Show the version of this script

Examples

List existing Entries in the Accessibility Database

sudo tccutil.py --list

Add /usr/bin/osascript to the Accessibility Database (using UNIX-Style Option)

sudo tccutil.py -i /usr/bin/osascript

Add Script Editor to the Accessibility Database (using Long Option)

sudo tccutil.py --insert com.apple.ScriptEditor2

Remove Terminal from the Accessibility Database

sudo tccutil.py --remove com.apple.Terminal

Enable Terminal (must already exist in the Database)

sudo tccutil.py --enable com.apple.Terminal

Disable /usr/bin/osascript (must already exist in the Database)

sudo tccutil.py -d /usr/bin/osascript

Contributing

Many people have contributed already, so feel free to make a PR and we'll get it merged in.

tccutil's People

Contributors

antontsv avatar brycebostwick avatar chenrui333 avatar colonelpanic8 avatar danielbayley avatar izmal avatar jacobsalmela avatar koreno avatar mkfl3x avatar reitermarkus avatar socoolby avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.