SecItemCopyMatching for Touch ID without passcode fallback

前端 未结 6 2115
抹茶落季
抹茶落季 2020-12-29 20:36

I am using SecItemCopyMatching to fetch a keychain item protected by Touch ID.

However, if Touch ID unlocking fails (or the user selects \"Enter Passcod

6条回答
  •  半阙折子戏
    2020-12-29 21:06

    You can try hiding the Enter Password button by doing the following:

    1) define global function

    static bool new_isFallbackButtonVisible(id self, SEL _cmd)
    {
        return NO;
    }
    

    2) in your application:didFinishLaunchingWithOptions: replace isFallbackButtonVisible method of LAContext class with your new implementation by calling

    class_replaceMethod(NSClassFromString(@"LAContext"), NSSelectorFromString(@"isFallbackButtonVisible"), (IMP)new_isFallbackButtonVisible, "v@:B");
    

提交回复
热议问题