Created
November 20, 2017 12:30
-
-
Save parallaxe/09e769d25d88d45fc98356705a027c24 to your computer and use it in GitHub Desktop.
Print the current task-role of an iOS-app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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