2

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!

Rui
  • 5,900
  • 10
  • 38
  • 56

2 Answers2

2

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.

drewmm
  • 737
  • 6
  • 17
0

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!

Community
  • 1
  • 1
waylonion
  • 6,866
  • 8
  • 51
  • 92