谢谢解决方法 我没找到任何所以我做了自己的检查:
+ (BOol) isDeviceOkForSecureEnclave{ double OsversionNumber = floor(NSFoundationVersionNumber); UIUserInterfaceIdiom deviceType = [[UIDevice currentDevice] userInterfaceIdiom]; BOol isOSForSecureEnclave = OsversionNumber > NSFoundationVersionNumber_iOS_8_4 ? YES:NO; //iOS 9 and up are ready for SE BOol isDeviceModelForSecureEnclave = NO; switch (deviceType) { case UIUserInterfaceIdiomPhone: //iPhone isDeviceModelForSecureEnclave = [self isPhoneForSE]; break; case UIUserInterfaceIdiomPad: //iPad isDeviceModelForSecureEnclave = [self isPadForSE]; break; default: isDeviceModelForSecureEnclave = false; break; } return (isOSForSecureEnclave && isDeviceModelForSecureEnclave) ? YES:NO;}/** The arrays are models that we kNow not having SE in harDWare,so if the current device is on the List it means it dosent have SE */+ (BOol) isPhoneForSE{ Nsstring *thisPlatform = [self platform]; NSArray * oldModels = [NSArray arrayWithObjects: @"x86_64",@"iPhone1,1",2",@"iPhone2,@"iPhone3,3",@"iPhone4,@"iPhone5,4",nil]; BOol isInList = [oldModels containsObject: thisPlatform]; return !isInList;}+ (BOol) isPadForSE{ //iPad Mini 2 is the earlIEst with SE // "iPad4,4" Nsstring *thisPlatform = [self platform]; NSArray * oldModels = [NSArray arrayWithObjects: @"x86_64",@"@iPad",@"@iPad1,0",@"iPad2,5",6",7",@"iPad3,nil]; BOol isInList = [oldModels containsObject: thisPlatform]; return !isInList;}+ (Nsstring *)platform{ size_t size; sysctlbyname("hw.machine",NulL,&size,0); char *machine = malloc(size); sysctlbyname("hw.machine",machine,0); Nsstring *platform = [Nsstring stringWithUTF8String:machine]; free(machine); return platform;}@end
检查触摸ID
- (BOol)canAuthenticateBytouchID {if ([LAContext class]) { return [[[LAContext alloc] init] canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil];}return YES;}
您还可以找到Secure Enclave here you find的检测
总结以上是内存溢出为你收集整理的ios – 如何在设备中检查安全区域是否可用全部内容,希望文章能够帮你解决ios – 如何在设备中检查安全区域是否可用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)