0

I'm trying to temporarily disable TouchID authentication so the phone won't unblock even if the finger matches. How can I do that? Is there a way to update the switch in Settings programatically, like I do with vibration, through com.apple.springboard.plist?

jscs
  • 63,694
  • 13
  • 151
  • 195
Douglas Soares
  • 71
  • 1
  • 1
  • 8

1 Answers1

1

Easiest method to check if device is jailbroken is to check canOpenURL (eg. cydia, mobileCydia URLs). You can also try to write to reserved paths (eg ~/private). There are also methods connected with fork() and running processes, you can read about it on reverse engineering blogs.

You should check it before running something like code below:

if context.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &error) {}

--- edit ---

To answer you question in comment (as far as I understood the question):

- (void)performTouchIdLogin {
    LAContext *context = [[LAContext alloc] init];
    LAPolicy policy = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
    NSError *error = nil;

    BOOL isJailbroken = ([[NSFileManager defaultManager] fileExistsAtPath: @"/bin/bash"]); // TODO: handle simulator
    BOOL canUseTouchID = ([context canEvaluatePolicy:policy error:&error]);

    if (!isJailbroken && canUseTouchID) {
        [context evaluatePolicy:policy localizedReason:@"Please log in using TouchID" reply:^(BOOL success, NSError *error) {
            // do something
        }];
    };
}
Nat
  • 12,032
  • 9
  • 56
  • 103
  • It does solve one problem, to identify biometric capable devices but does not help me to disable it :/ – Douglas Soares Nov 28 '14 at 12:13
  • @DouglasSoares I've added more source code. If I understood what do you mean by disabling it, the example should be helpful. In your `else` statement you need to perform some normal login method, like username & password. – Nat Nov 29 '14 at 08:14