public final class SecurityDetectionService extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SecurityDetectionService.DetectorResult
Result status of the Runtime Application Security-Protection
|
Constructor and Description |
---|
SecurityDetectionService() |
Modifier and Type | Method and Description |
---|---|
static void |
clearHookingDetectionListener()
Remove HookingDetectionListener.
|
static void |
clearVirtualEnvironmentDetectionListener()
Unregistering the Virtual Environment detection listener
|
static SecurityDetectionService.DetectorResult |
getDebuggerStatus()
Checks if the debugger is attached to the application process.
|
static SecurityDetectionService.DetectorResult |
getEmulatorStatus()
Checks if the application is running on an emulator.
|
static SecurityDetectionService.DetectorResult |
getHookingFrameworkStatus()
Checks if there is any hooking framework installed on the device.
|
static SecurityDetectionService.DetectorResult |
getHookingStatus(SecureList<Object> target)
Checks if all the functions in the registered class(es) are safe.
|
static Set<String> |
getPotentialOverlayAttackAppInfo()
Detects if there are apps installed(non-system app) which will potentially do overlay attack, and return the app info.
|
static void |
setDebuggerDetection(Boolean enableDebuggerDetection)
Set debugger detection to prevent any debugger attach to the application process.
|
static void |
setHookingDetectionListener(HookingDetectionListener listener)
Set HookingDetectionListener to receive callbacks when protected methods in SDK are detected
as hooked.
|
static void |
setVirtualEnvironmentDetectionListener(VirtualEnvironmentDetectionListener listener)
Registering a listener to handle the result from Virtual Environment detection.
|
public static void setHookingDetectionListener(HookingDetectionListener listener)
listener
- the listener to receive hooking detection callbacks.public static void clearHookingDetectionListener()
It is recommended to call this API when the implementation is no longer in use. eg.
public class Activity implements HookingDetectionListener {
When activity is killed you must remove the listener to avoid leaks.
And to add back the listener when the activity is created.
public static void setDebuggerDetection(Boolean enableDebuggerDetection)
enableDebuggerDetection
- the value to set, true
or false
. If not set, the default value is false
prior to 4.8. Since 4.8, it has been turned ON by default.public static Set<String> getPotentialOverlayAttackAppInfo()
public static void setVirtualEnvironmentDetectionListener(VirtualEnvironmentDetectionListener listener)
IdpCore.configure(IdpConfiguration...)
otherwise, the default behaviour will be applied.
listener
- The listenerpublic static void clearVirtualEnvironmentDetectionListener()
public static SecurityDetectionService.DetectorResult getHookingStatus(SecureList<Object> target) throws IdpSecurityDetectorException
target
- List of the Class
objects that contain the functions need to be protected.SecurityDetectionService.DetectorResult.NEGATIVE
if the functions are safe, otherwise SecurityDetectionService.DetectorResult.POSITIVE
is returned.IdpSecurityDetectorException
- An exception occurs while processing the input data. For example, not getting the information of the protected function.
Possible error:
public static SecurityDetectionService.DetectorResult getHookingFrameworkStatus() throws IdpSecurityDetectorException
SecurityDetectionService.DetectorResult.NEGATIVE
if the system is clean, otherwise SecurityDetectionService.DetectorResult.POSITIVE
is returned.IdpSecurityDetectorException
- Exception happens while processing.
Possible error:
public static SecurityDetectionService.DetectorResult getDebuggerStatus() throws IdpSecurityDetectorException
SecurityDetectionService.DetectorResult.NEGATIVE
if debugger is not detected, otherwise SecurityDetectionService.DetectorResult.POSITIVE
is returned.IdpSecurityDetectorException
- An exception occurs while processing the detection.
Possible error:
setDebuggerDetection(Boolean)
public static SecurityDetectionService.DetectorResult getEmulatorStatus() throws IdpSecurityDetectorException
SecurityDetectionService.DetectorResult.NEGATIVE
if the emulator is not detected, otherwise SecurityDetectionService.DetectorResult.POSITIVE
if the emulator is detected.IdpSecurityDetectorException
- If any error occurs