TamperDetector

@MainActor
public class TamperDetector

The main class for detecting tampering on a device. It uses a set of detectors to analyze the device for signs of jailbreaking.

  • The default set of detectors used for tampering analysis.

    Declaration

    Swift

    @MainActor
    public static var defaultDetectors: [TamperDetectorProtocol] { get }
  • The list of detectors to be used for the analysis.

    Declaration

    Swift

    @MainActor
    public let detectors: [TamperDetectorProtocol]
  • Initializes the TamperDetector with a custom set of detectors. If no detectors are provided, the default set is used.

    Declaration

    Swift

    @MainActor
    public init(detectors: [TamperDetectorProtocol] = defaultDetectors)

    Parameters

    detectors

    An array of TamperDetectorProtocol to be used for the analysis.

  • Initializes the TamperDetector with the default detectors plus a custom set of detectors.

    Declaration

    Swift

    @MainActor
    public init(customDetectors: [TamperDetectorProtocol])

    Parameters

    customDetectors

    An array of custom TamperDetectorProtocol to be added to the default set.

  • Analyzes the device for tampering using the configured detectors.

    Declaration

    Swift

    @MainActor
    public func analyze(forceRunOnSimulator: Bool = false) -> Double

    Parameters

    forceRunOnSimulator

    A boolean to force the analysis to run on a simulator. Defaults to false.

    Return Value

    A score between 0.0 and 1.0, where 1.0 indicates a high probability of tampering.