Is there any way to block access to certain application programmatically on iOS? Using private APIs or workarounds is not a problem in my case.
Thanks in advance!
This tutorial does basically what you want to do, assuming your second sentence means you're working with jailbroken iOS.
Basically you write a hook for the SBApplicationIcon
class that looks something like this (code not mine):
%hook SBApplicationIcon
-(void)launch
{
NSString *appName = [self displayName];
if ([appName isEqualToString:@"blah"]) {
// react accordingly
}
%orig; // Call this if you want to proceed with launching the app in question.
}
%end
You'll need to link against UIKit
, I believe.
EDIT: to clarify, the above code is using Logos. I'm sure it's also possible using the Objective-C runtime directly, but I'm not familiar with that.
There are certain apps that block access out there that force you to input a password. For example, you can take a look here https://apple.stackexchange.com/questions/31154/how-do-i-password-protect-access-to-specific-apps-in-ios to find some ideas. Hope this helped!