Interface ICraspUtil


public interface ICraspUtil
ICraspUtil is the interface for invoking all RASP functionalities.

How to invoke the API

Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    detectBootUnlock(byte[] header, byte[] body)
    API to detect if the device bootloader is unlocked
    long
    detectDebug(byte[] header, byte[] body)
    API to detect if any java and native debuggers attached
    long
    detectEmulator(byte[] header, byte[] body)
    API to detect if the app is running in an emulator
    long
    detectEmulator(byte[] header, byte[] body, boolean enableEmulatorDetectionInDebug)
    API to detect if the app is running in an emulator
    long
    detectHook(com.gemalto.medl.LightArrayList hookList, byte[] header, byte[] body)
    API to detect if the functions to protect provided in the input is hooked or not
    long
    detectHookDexguard(byte[] header, byte[] body)
    API to detect if the application is hooked or not (Dexguard only)
    long
    detectLibsTamper(String[] libs, byte[] header, byte[] body)
    API to detect if the given libraries are tampered.
    long
    detectRoot(byte[] header, byte[] body)
    API to detect if the device is rooted
    void
    Method to disable debugger detection if there is conflict with App RASP protection
  • Method Details

    • detectRoot

      long detectRoot(@NonNull byte[] header, @NonNull byte[] body)
      API to detect if the device is rooted
      Parameters:
      header - Random bytes
      body - Random bytes
      Returns:
      status code if device is unsafe
    • detectBootUnlock

      long detectBootUnlock(@NonNull byte[] header, @NonNull byte[] body)
      API to detect if the device bootloader is unlocked
      Parameters:
      header - Random bytes
      body - Random bytes
      Returns:
      status code if device is unsafe
    • detectHook

      long detectHook(@NonNull com.gemalto.medl.LightArrayList hookList, @NonNull byte[] header, @NonNull byte[] body)
      API to detect if the functions to protect provided in the input is hooked or not
      Parameters:
      hookList - LightArrayList of java functions to be protected
      header - Random bytes
      body - Random bytes
      Returns:
      status code if device is unsafe
    • detectHookDexguard

      long detectHookDexguard(@NonNull byte[] header, @NonNull byte[] body)
      API to detect if the application is hooked or not (Dexguard only)
      Parameters:
      header - Random bytes
      body - Random bytes
      Returns:
      status code if device is unsafe
    • detectDebug

      long detectDebug(@NonNull byte[] header, @NonNull byte[] body)
      API to detect if any java and native debuggers attached
      Parameters:
      header - Random bytes
      body - Random bytes
      Returns:
      status code if device is unsafe
    • detectEmulator

      long detectEmulator(@NonNull byte[] header, @NonNull byte[] body)
      API to detect if the app is running in an emulator
      Parameters:
      header - Random bytes
      body - Random bytes
      Returns:
      status code if device is unsafe
    • detectEmulator

      long detectEmulator(@NonNull byte[] header, @NonNull byte[] body, boolean enableEmulatorDetectionInDebug)
      API to detect if the app is running in an emulator
      Parameters:
      header - random bytes
      body - random bytes
      enableEmulatorDetectionInDebug - if true emulator detection is enabled only in the debug variant.
      Returns:
      status code if device is unsafe
    • detectLibsTamper

      long detectLibsTamper(@NonNull String[] libs, @NonNull byte[] header, @NonNull byte[] body)

      API to detect if the given libraries are tampered.

      By default following libraries will be checked

      • libart.so
      • libc.so
      • libdl.so
      • libqcyza-<so_name>-<version>.so (CRASP shared lib)
      Parameters:
      libs - array of library names (e.g. "libabc.so", ...). Pass empty array to check only the default ones
      header - random bytes
      body - random bytes
      Returns:
      status code if device is unsafe
      Since:
      3.2.0
    • disableDebugDetection

      void disableDebugDetection()
      Method to disable debugger detection if there is conflict with App RASP protection