Functions

The following functions are available globally.

  • Returns the current OOB behavior policy when the device is detected as jailbroken.

    Since

    4.0

    Declaration

    Objective-C

    EMOobJailbreakPolicy EMOobJailbreakPolicyGetPolicy(void)

    Swift

    func EMOobJailbreakPolicyGetPolicy() -> EMOobJailbreakPolicy

    Return Value

    The current policy.

  • Sets the OOB behavior policy when the device is detected as jailbroken.

    Since

    4.0

    Declaration

    Objective-C

    void EMOobJailbreakPolicySetPolicy(EMOobJailbreakPolicy anOobJailbreakPolicy)

    Swift

    func EMOobJailbreakPolicySetPolicy(_ anOobJailbreakPolicy: EMOobJailbreakPolicy)

    Parameters

    anOobJailbreakPolicy

    The new policy.

  • Set hooking detection listener to receive callbacks when protected methods in SDK are detected as hooked. If this function is not called, SDK will not protect any methods.

    Warning

    Important: that it is required to call this before [EMCore configureWithConfigurations].

    Since

    4.7

    Declaration

    Objective-C

    void EMHookingDetectionSetListener(EMHookingDetectionListener listener)

    Swift

    func EMHookingDetectionSetListener(_ listener: EMHookingDetectionListener!)

    Parameters

    listener

    HookingDetection callback @throw raise:NSInvalidArgumentException if listener is nil.

  • Remove hooking detection listener.

    It is recommended to call this API when the implementation is no longer in use. eg. When the ViewController is killed application must remove the listener to avoid leaks. And to add back the listener when the ViewController is created.

    Warning

    By using this option, it potentially opens one attack point.

    Since

    4.7

    Declaration

    Objective-C

    void EMHookingDetectionClearListener(void)

    Swift

    func EMHookingDetectionClearListener()
  • Set device integrity detection listener to receive callbacks when the device environment is detected. This listener will be called before critical operations, when the device environment is determined to be unsafe.

    Warning

    Important: that it is required to call this before [EMCore configureWithConfigurations].

    Since

    6.7.0

    Declaration

    Objective-C

    void EMDeviceIntegrityDetectionSetListener(
        EMDeviceIntegrityDetectionListener listener)

    Swift

    func EMDeviceIntegrityDetectionSetListener(_ listener: EMDeviceIntegrityDetectionListener!)

    Parameters

    listener

    DeviceIntegrityDetection callback @throw raise:NSInvalidArgumentException if listener is nil.

  • Remove device integrity detection listener.

    It is recommended to call this API when the implementation is no longer in use. eg. When the ViewController is killed application must remove the listener to avoid leaks. And to add back the listener when the ViewController is created.

    Warning

    By using this option, it potentially opens one attack point.

    Since

    6.7.0

    Declaration

    Objective-C

    void EMDeviceIntegrityDetectionClearListener(void)

    Swift

    func EMDeviceIntegrityDetectionClearListener()
  • Returns the current token behavior policy when the device is detected as jailbroken.

    Since

    4.0

    Declaration

    Objective-C

    EMTokenJailbreakPolicy EMTokenJailbreakPolicyGetPolicy(void)

    Swift

    func EMTokenJailbreakPolicyGetPolicy() -> EMTokenJailbreakPolicy

    Return Value

    The current policy.

  • Sets the token behavior policy when the device is detected as jailbroken.

    Since

    4.0

    Declaration

    Objective-C

    void EMTokenJailbreakPolicySetPolicy(
        EMTokenJailbreakPolicy aTokenJailbreakPolicy)

    Swift

    func EMTokenJailbreakPolicySetPolicy(_ aTokenJailbreakPolicy: EMTokenJailbreakPolicy)

    Parameters

    aTokenJailbreakPolicy

    The new policy.

  • Undocumented

    Declaration

    Objective-C

    __attribute__((visibility("default")))
    int EMDetectorJailbreakStatus(int *result)

    Swift

    func EMDynamicHandler(_ result: UnsafeMutablePointer<Int32>!) -> Int32
  • Undocumented

    Declaration

    Objective-C

    __attribute__((visibility("default")))
    int EMDetectorObjCMethodHookingStatus(int *result, Class clazz, size_t selSize, SEL *sels)

    Swift

    func EMDynamicRotateKey(_ result: UnsafeMutablePointer<Int32>!, _ clazz: AnyClass!, _ selSize: Int, _ sels: UnsafeMutablePointer<Selector?>!) -> Int32
  • Undocumented

    Declaration

    Objective-C

    __attribute__((visibility("default")))
    int EMDetectorObjCMethodListHookingStatus(int *result, Class clazz, size_t selSize, SEL sel, ...)
  • Undocumented

    Declaration

    Objective-C

    __attribute__((visibility("default")))
    int EMDetectorCFunctionsHookingStatus(int *result, void **funcs, size_t funcSize)

    Swift

    func EMDynamicDeleteKey(_ result: UnsafeMutablePointer<Int32>!, _ funcs: UnsafeMutablePointer<UnsafeMutableRawPointer?>!, _ funcSize: Int) -> Int32
  • Undocumented

    Declaration

    Objective-C

    __attribute__((visibility("default")))
    int EMDetectorDebuggerStatus(int *result)

    Swift

    func EMDynamicUpdateKey(_ result: UnsafeMutablePointer<Int32>!) -> Int32
  • Undocumented

    Declaration

    Objective-C

    __attribute__((visibility("default")))
    int EMDetectorDeviceIntegrityStatus(int *result)

    Swift

    func EMDynamicCreateKey(_ result: UnsafeMutablePointer<Int32>!) -> Int32