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 missing TCC permissions #796

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions FBControlCore/Commands/FBSettingsCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,13 @@ extern FBTargetSettingsService const FBTargetSettingsServiceLocation;
extern FBTargetSettingsService const FBTargetSettingsServiceMicrophone;
extern FBTargetSettingsService const FBTargetSettingsServiceUrl;
extern FBTargetSettingsService const FBTargetSettingsServiceNotification;
extern FBTargetSettingsService const FBTargetSettingsServiceCalendar;
extern FBTargetSettingsService const FBTargetSettingsServiceFaceID;
extern FBTargetSettingsService const FBTargetSettingsServiceMedia;
extern FBTargetSettingsService const FBTargetSettingsServiceReminders;
extern FBTargetSettingsService const FBTargetSettingsServiceMotion;
extern FBTargetSettingsService const FBTargetSettingsServiceSiri;
extern FBTargetSettingsService const FBTargetSettingsServiceSpeech;
extern FBTargetSettingsService const FBTargetSettingsServiceUserTracking;

NS_ASSUME_NONNULL_END
8 changes: 8 additions & 0 deletions FBControlCore/Commands/FBSettingsCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@
FBTargetSettingsService const FBTargetSettingsServiceMicrophone = @"microphone";
FBTargetSettingsService const FBTargetSettingsServiceUrl = @"url";
FBTargetSettingsService const FBTargetSettingsServiceNotification = @"notification";
FBTargetSettingsService const FBTargetSettingsServiceCalendar = @"calendar";
FBTargetSettingsService const FBTargetSettingsServiceFaceID = @"biometrics";
FBTargetSettingsService const FBTargetSettingsServiceMedia = @"media";
FBTargetSettingsService const FBTargetSettingsServiceReminders = @"reminders";
FBTargetSettingsService const FBTargetSettingsServiceMotion = @"motion";
FBTargetSettingsService const FBTargetSettingsServiceSiri = @"siri";
FBTargetSettingsService const FBTargetSettingsServiceSpeech = @"speech";
FBTargetSettingsService const FBTargetSettingsServiceUserTracking = @"userTracking";
8 changes: 8 additions & 0 deletions FBSimulatorControl/Commands/FBSimulatorSettingsCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,14 @@ - (instancetype)initWithSimulator:(FBSimulator *)simulator
FBTargetSettingsServicePhotos: @"kTCCServicePhotos",
FBTargetSettingsServiceCamera: @"kTCCServiceCamera",
FBTargetSettingsServiceMicrophone: @"kTCCServiceMicrophone",
FBTargetSettingsServiceCalendar: @"kTCCServiceCalendar",
FBTargetSettingsServiceFaceID: @"kTCCServiceFaceID",
FBTargetSettingsServiceMedia: @"kTCCServiceMediaLibrary",
FBTargetSettingsServiceReminders: @"kTCCServiceReminders",
FBTargetSettingsServiceMotion: @"kTCCServiceMotion",
FBTargetSettingsServiceSiri: @"kTCCServiceSiri",
FBTargetSettingsServiceSpeech: @"kTCCServiceSpeechRecognition",
FBTargetSettingsServiceUserTracking: @"kTCCServiceUserTracking",
};
});
return mapping;
Expand Down
8 changes: 8 additions & 0 deletions idb/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class Permission(Enum):
LOCATION = 4
NOTIFICATION = 5
MICROPHONE = 6
CALENDAR = 7
FACEID = 8
MEDIA = 9
REMINDERS = 10
MOTION = 11
SIRI = 12
SPEECH = 13
USER_TRACKING = 14


class TargetType(str, Enum):
Expand Down
16 changes: 16 additions & 0 deletions idb/grpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@
Permission.LOCATION: ApproveRequest.LOCATION,
Permission.NOTIFICATION: ApproveRequest.NOTIFICATION,
Permission.MICROPHONE: ApproveRequest.MICROPHONE,
Permission.CALENDAR: ApproveRequest.CALENDAR,
Permission.FACEID: ApproveRequest.FACEID,
Permission.MEDIA: ApproveRequest.MEDIA,
Permission.REMINDERS: ApproveRequest.REMINDERS,
Permission.MOTION: ApproveRequest.MOTION,
Permission.SIRI: ApproveRequest.SIRI,
Permission.SPEECH: ApproveRequest.SPEECH,
Permission.USER_TRACKING: ApproveRequest.USER_TRACKING,
}

REVOKE_MAP: Dict[Permission, "RevokeRequest.Permission"] = {
Expand All @@ -186,6 +194,14 @@
Permission.LOCATION: RevokeRequest.LOCATION,
Permission.NOTIFICATION: RevokeRequest.NOTIFICATION,
Permission.MICROPHONE: RevokeRequest.MICROPHONE,
Permission.CALENDAR: RevokeRequest.CALENDAR,
Permission.FACEID: RevokeRequest.FACEID,
Permission.MEDIA: RevokeRequest.MEDIA,
Permission.REMINDERS: RevokeRequest.REMINDERS,
Permission.MOTION: RevokeRequest.MOTION,
Permission.SIRI: RevokeRequest.SIRI,
Permission.SPEECH: RevokeRequest.SPEECH,
Permission.USER_TRACKING: RevokeRequest.USER_TRACKING,
}

VIDEO_FORMAT_MAP: Dict[VideoFormat, "VideoStreamRequest.Format"] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ struct ApproveMethodHandler {
.url: .url,
.location: .location,
.notification: notificationApprovalService,
.calendar: .calendar,
.faceid: .faceID,
.media: .media,
.reminders: .reminders,
.motion: .motion,
.siri: .siri,
.speech: .speech,
.userTracking: .userTracking,
]

var services = try Set(
Expand Down
16 changes: 16 additions & 0 deletions proto/idb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ message ApproveRequest {
LOCATION = 4;
NOTIFICATION = 5;
MICROPHONE = 6;
CALENDAR = 7;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the same entries in the RevokeRequest below

FACEID = 8;
MEDIA = 9;
REMINDERS = 10;
MOTION = 11;
SIRI = 12;
SPEECH = 13;
USER_TRACKING = 14;
}
string bundle_id = 1;
repeated Permission permissions = 2;
Expand All @@ -273,6 +281,14 @@ message RevokeRequest {
LOCATION = 4;
NOTIFICATION = 5;
MICROPHONE = 6;
CALENDAR = 7;
FACEID = 8;
MEDIA = 9;
REMINDERS = 10;
MOTION = 11;
SIRI = 12;
SPEECH = 13;
USER_TRACKING = 14;
}
string bundle_id = 1;
repeated Permission permissions = 2;
Expand Down