tccutil::wheelchair_symbol:命令行工具,用于修改OS X的可访问性数据库(TCC.db)

  • s6_249908
  • 13.2KB
  • zip
  • 0
  • VIP专享
  • 0
  • 2022-06-13 23:39
    上传日期 TCC.db修改macOS的TCC.db 从命令行修改macOS的透明,同意和控制(TCC)框架 Apple在/usr/bin有一个名为tccutil的实用程序,但它仅支持一个命令,该命令用于reset整个数据库。 对于许多版本的macOS来说都是这样。 我想要一个命令行实用程序,该实用程序能够添加,删除,列出和执行其他操作。 SIP通知 该工具需要禁用SIP才能运行。 这样做的风险取决于您。 可以在这里找到有关此主题的讨论: : tccutil.py与其他解决方案有何不同? 无需任何其他软件即可安装 。 它具有易于使用的语法 还有其他解决方案,但是有些我不喜欢的事情: 还有其他需要安装的依赖项(它已经过去了五年,没有任何更新) 使用.plist添加项目,这方便。 这些也是我发现做类似事情的其他一些项目 我实际上是最近才发现的
  • tccutil-main
  • .github
  • workflows
  • python-app.yml
<p align="center"> <a href="" rel='nofollow' onclick='return false;'> <img src="" width="250" height="250" alt="tccutil"> </a> <br> <strong></strong><br> Modify macOS' <code>TCC.db</code> from the command line </p> ## 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: ## How is `` Different from other solutions? - `` 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) + []( uses a `.plist` to add items, which is inconvenient. - these are also some other projects I found that do similar things + [go-tccutil]( I actually only recently found this + [tccplus]( + [DocSystem/tccutil]( # 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 `` to `/usr/local/bin` or run from any directory with `python /path/to/`. ## 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: [-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 ```bash sudo --list ``` Add `/usr/bin/osascript` to the Accessibility Database (using UNIX-Style Option) ```bash sudo -i /usr/bin/osascript ```` Add *Script Editor* to the Accessibility Database (using Long Option) ```bash sudo --insert ``` Remove *Terminal* from the Accessibility Database ```bash sudo --remove ``` Enable *Terminal* (must already exist in the Database) ```bash sudo --enable ``` Disable `/usr/bin/osascript` (must already exist in the Database) ```bash sudo -d /usr/bin/osascript ``` ## Contributing Many people have contributed already, so feel free to make a PR and we'll get it merged in.