从“安全”->“隐私”->“联系人”列表中删除应用程序

从“安全”->“隐私”->“联系人”列表中删除应用程序

我有几个应用程序需要访问我的联系人。我实际上不使用联系人,并且我不希望应用程序有权访问这些信息。

我取消选中相应的框,但我想从列表中删除该应用程序:

在此处输入图片描述

我在定位服务下也有几个应用程序(包括一个不再安装的Wifi stumbler应用程序)。

我应该修改哪个 plist 来从列表中删除应用程序?

答案1

该信息存储在 中~/Library/Application Support/com.apple.TCC/TCC.db

$ sqlite3 Library/Application\ Support/com.apple.TCC/TCC.db .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE admin (key TEXT PRIMARY KEY NOT NULL, value INTEGER NOT NULL);
INSERT INTO "admin" VALUES('version',7);
CREATE TABLE access (service TEXT NOT NULL, client TEXT NOT NULL, client_type INTEGER NOT NULL, allowed INTEGER NOT NULL, prompt_count INTEGER NOT NULL, csreq BLOB, CONSTRAINT key PRIMARY KEY (service, client, client_type));
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.mail',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.TextEdit',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.ScriptEditor2',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceAddressBook','com.runningwithcrayons.Alfred-2',0,1,0,X'FADE0C00000000CC0000000100000006000000060000000F000000020000001F636F6D2E72756E6E696E6777697468637261796F6E732E416C667265642D3200000000070000000E000000000000000A2A864886F7636406010900000000000000000006000000060000000E000000010000000A2A864886F763640602060000000000000000000E000000000000000A2A864886F7636406010D0000000000000000000B000000000000000A7375626A6563742E4F550000000000010000000A585A5A584539534544340000');
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.Automator',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.Preview',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.iWork.Numbers',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.inputmethod.Kotoeri',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceAddressBook','com.smileonmymac.textexpander',0,1,0,X'FADE0C00000000CC0000000100000006000000060000000F000000020000001D636F6D2E736D696C656F6E6D796D61632E74657874657870616E646572000000000000070000000E000000000000000A2A864886F7636406010900000000000000000006000000060000000E000000010000000A2A864886F763640602060000000000000000000E000000000000000A2A864886F7636406010D0000000000000000000B000000000000000A7375626A6563742E4F550000000000010000000A37504B4A36473444584C0000');
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.iWork.Pages',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceUbiquity','com.apple.iMovieApp',0,1,1,NULL);
INSERT INTO "access" VALUES('kTCCServiceAddressBook','com.google.Chrome',0,1,0,X'FADE0C00000000700000000100000006000000070000000200000011636F6D2E676F6F676C652E4368726F6D650000000000000200000018636F6D2E676F6F676C652E4368726F6D652E63616E61727900000004000000000000001485CEE8254216185620DDC8851C7A9FC4DFE120EF');
CREATE TABLE access_times (service TEXT NOT NULL, client TEXT NOT NULL, client_type INTEGER NOT NULL, last_used_time INTEGER NOT NULL, CONSTRAINT key PRIMARY KEY (service, client, client_type));
CREATE TABLE access_overrides (service TEXT PRIMARY KEY NOT NULL);
$ sqlite3 Library/Application\ Support/com.apple.TCC/TCC.db 'select * from "access" where service=="kTCCServiceAddressBook"'
kTCCServiceAddressBook|com.google.Chrome|0|1|0|��

kTCCServiceAddressBook|com.runningwithcrayons.Alfred-2|0|1|0|��

kTCCServiceAddressBook|com.smileonmymac.textexpander|0|1|0|��

要清除“系统偏好设置”中显示的列表,请运行sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db 'delete from "access" where service=="kTCCServiceAddressBook"'。更改应立即应用。

答案2

我们有 Python 脚本,可以在定期维护周期内将应用程序添加到 TCC 数据库中或从中删除。更改会立即生效。

https://github.com/univ-of-utah-marriott-library-apple/tcc_database_manager

例如,安装后您只需使用以下代码即可:

tcc_database_manager add contacts safari /Longer/Path/To/MyApp.app com.apple.TextEdit

相关内容