SecureiOS 0.1.11

SecureiOS 0.1.11

Tarun Kaushik 维护。



SecureiOS 0.1.11

  • By
  • Tarun Kaushik

SecureiOS

Version License Platform

SecureiOS 是一个一站式框架,以便以最少的努力要求在你的 iOS 应用程序中实现安全功能。

安装

SecureiOS 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中:

pod "SecureiOS"

Secure UserDefaults

SecureUserDefaults 提供了对数据进行加密存储的功能。它是一个包装器,允许您保存数据以及检索它。

用法

保存数据

SecureiOS.secureUserDefaults().saveData(forKey: "intData", value: intData)

获取数据

guard let value = SecureiOS.secureUserDefaults().getAnyData(forKey: "key") as? String else {return}

安全功能

越狱检测

使用越狱检测方法来识别设备是否越狱。您可以使用以下代码获取设备的越狱状态:

用法

SecureiOS.jailBreakCheck()

代理检查器

攻击者通常配置设备代理设置以进行中间人攻击。您可以使用此方法来识别设备是否已配置代理。

用法

 if SecureiOS.proxyCheck() {
    print("Proxy is enabled")
 }

锁定和生物识别检查

此方法用于判断设备是否已实现生物识别或密码。您可以使用此方法根据结果确定应用程序的行为。

使用方法

 let deviceLockAndBiometricStatus = SecureiOS.getDeviceLockAndBiometryStatus()
     
 if deviceLockAndBiometricStatus.isEnabled{
     let type = deviceLockAndBiometricStatus.type
     switch type {
     case .touchId:
        print(type.name)
     case .faceId:
        print(type.name)
     case .passcode:
        print(type.name)
     case .none:
        print(type.name)
     @unknown default:
        print("unknown")
     }
 }

支持的生物识别类型

此方法允许您的应用程序了解设备是否支持生物识别。您可以使用此方法根据结果确定应用程序的行为。

使用方法

switch SecureiOS.getSupportedBiometryType() {
case .faceId:
    print("Face Id")
case .touchId:
    print("Touch Id")
case .none:
    print("None")
@unknown default:
    print("unknown")
}

应用程序背景启动画面实现。

iOS在应用程序进入后台时总会截取当前视图的屏幕截图。这个截图可能会暴露屏幕上的一些敏感信息,从而造成隐私泄露。您可以使用SetupBackgroundSplashScreen方法来设置您所选择的应用程序背景图片。

使用方法

SecureiOS.setupBackgroundSplashScreen(&window, image)

模拟器检查器

应用可以在模拟器上运行,这使得黑客更容易对应用进行攻击。模拟器检查方法用于确定应用是否在模拟器上运行。您可以使用以下方法进行检查

用法

 if SecureiOS.emulatorCheck() {
    print("Running on simulator")
 }

作者

Tarun Kaushik

许可证

SecureiOS 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。