You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print_error_log "${TCC_SERVICE_NAME} is invalid name as TCC Service."
137
+
exit 1
138
+
fi
139
+
done
131
140
132
141
print_info_log "Start TCC-Permitter..."
133
142
@@ -139,21 +148,24 @@ if [[ ! -e "${TCC_DB_PATH}" ]];then
139
148
exit 1
140
149
fi
141
150
142
-
TCC_NOT_ALLOWED_ACCESS_PRESENT=$(run_as_user sqlite3 "${TCC_DB_PATH}""SELECT service FROM access WHERE allowed = '0' AND client = '${BUNDLE_ID_OR_BINARY_PATH}' AND service = 'kTCCService${TCC_SERVICE_NAME}'")
if [[ !"${TCC_NOT_ALLOWED_ACCESS_PRESENT}" ]];then
145
-
TCC_ALLOWED_ACCESS_PRESENT=$(run_as_user sqlite3 "${TCC_DB_PATH}""SELECT service FROM access WHERE allowed = '1' AND client = '${BUNDLE_ID_OR_BINARY_PATH}' AND service = 'kTCCService${TCC_SERVICE_NAME}'")
154
+
TCC_NOT_ALLOWED_ACCESS_PRESENT=$(run_as_user sqlite3 "${TCC_DB_PATH}""SELECT service FROM access WHERE allowed = '0' AND client = '${BUNDLE_ID_OR_BINARY_PATH}' AND service = 'kTCCService${TCC_SERVICE_NAME}'")
146
155
147
-
if [[ "${TCC_ALLOWED_ACCESS_PRESENT}" ]];then
148
-
print_info_log "${TCC_SERVICE_NAME} of ${BUNDLE_ID_OR_BINARY_PATH} is already allowed."
149
-
else
150
-
print_info_log "There does not seem to be a single prompt for TCC access rights yet."
151
-
fi
152
-
exit 0
153
-
fi
156
+
if [[ !"${TCC_NOT_ALLOWED_ACCESS_PRESENT}" ]];then
157
+
TCC_ALLOWED_ACCESS_PRESENT=$(run_as_user sqlite3 "${TCC_DB_PATH}""SELECT service FROM access WHERE allowed = '1' AND client = '${BUNDLE_ID_OR_BINARY_PATH}' AND service = 'kTCCService${TCC_SERVICE_NAME}'")
154
158
155
-
run_as_user sqlite3 "${TCC_DB_PATH}""UPDATE access SET allowed = '1', last_modified = '$(date +%s)' WHERE allowed = '0' AND client = '${BUNDLE_ID_OR_BINARY_PATH}' AND service = 'kTCCService${TCC_SERVICE_NAME}'"
159
+
if [[ "${TCC_ALLOWED_ACCESS_PRESENT}" ]];then
160
+
print_info_log "${TCC_SERVICE_NAME} of ${BUNDLE_ID_OR_BINARY_PATH} is already allowed."
161
+
else
162
+
print_info_log "There does not seem to be a single prompt for TCC access rights yet."
163
+
fi
164
+
else
165
+
run_as_user sqlite3 "${TCC_DB_PATH}""UPDATE access SET allowed = '1', last_modified = '$(date +%s)' WHERE allowed = '0' AND client = '${BUNDLE_ID_OR_BINARY_PATH}' AND service = 'kTCCService${TCC_SERVICE_NAME}'"
156
166
157
-
print_info_log "Successfully allowed for ${TCC_SERVICE_NAME} TCC service of ${BUNDLE_ID_OR_BINARY_PATH}."
167
+
print_info_log "Successfully allowed for ${TCC_SERVICE_NAME} TCC service of ${BUNDLE_ID_OR_BINARY_PATH}."
0 commit comments