Skip to content

Instantly share code, notes, and snippets.

@parallaxe
Created November 20, 2017 12:30
Show Gist options
  • Save parallaxe/09e769d25d88d45fc98356705a027c24 to your computer and use it in GitHub Desktop.
Save parallaxe/09e769d25d88d45fc98356705a027c24 to your computer and use it in GitHub Desktop.
Print the current task-role of an iOS-app
void printRole() {
task_category_policy_data_t category_policy;
mach_msg_type_number_t task_info_count = TASK_CATEGORY_POLICY_COUNT;
boolean_t get_default = FALSE;
kern_return_t result =
task_policy_get(mach_task_self(), TASK_CATEGORY_POLICY,
&category_policy,
&task_info_count, &get_default);
if(result != KERN_SUCCESS) {
NSLog(@"damn");
} else {
NSLog(@"role %s", role_to_short_string(category_policy.role));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment