Package com.thalesgroup.crasputil
Interface ICraspUtil
public interface ICraspUtil
ICraspUtil is the interface for invoking all RASP functionalities.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionlongdetectBootUnlock(byte[] header, byte[] body) API to detect if the device bootloader is unlockedlongdetectDebug(byte[] header, byte[] body) API to detect if any java and native debuggers attachedlongdetectEmulator(byte[] header, byte[] body) API to detect if the app is running in an emulatorlongdetectEmulator(byte[] header, byte[] body, boolean enableEmulatorDetectionInDebug) API to detect if the app is running in an emulatorlongdetectHook(com.gemalto.medl.LightArrayList hookList, byte[] header, byte[] body) API to detect if the functions to protect provided in the input is hooked or notlongdetectHookDexguard(byte[] header, byte[] body) API to detect if the application is hooked or not (Dexguard only)longdetectLibsTamper(String[] libs, byte[] header, byte[] body) API to detect if the given libraries are tampered.longdetectRoot(byte[] header, byte[] body) API to detect if the device is rootedvoidMethod to disable debugger detection if there is conflict with App RASP protection
-
Method Details
-
detectRoot
API to detect if the device is rooted- Parameters:
header- Random bytesbody- Random bytes- Returns:
- status code if device is unsafe
-
detectBootUnlock
API to detect if the device bootloader is unlocked- Parameters:
header- Random bytesbody- 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-LightArrayListof java functions to be protectedheader- Random bytesbody- Random bytes- Returns:
- status code if device is unsafe
-
detectHookDexguard
API to detect if the application is hooked or not (Dexguard only)- Parameters:
header- Random bytesbody- Random bytes- Returns:
- status code if device is unsafe
-
detectDebug
API to detect if any java and native debuggers attached- Parameters:
header- Random bytesbody- Random bytes- Returns:
- status code if device is unsafe
-
detectEmulator
API to detect if the app is running in an emulator- Parameters:
header- Random bytesbody- 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 bytesbody- random bytesenableEmulatorDetectionInDebug- if true emulator detection is enabled only in the debug variant.- Returns:
- status code if device is unsafe
-
detectLibsTamper
API to detect if the given libraries are tampered.
By default following libraries will be checked
libart.solibc.solibdl.solibqcyza-<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 onesheader- random bytesbody- 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
-