PreEmptive Protection - DashO v8.2 User Guide

Root Check and Response

PreEmptive Protection - DashO can instrument Android applications to detect if they are being run on a rooted device. The Root Checks and Responses are configured on the Root Check screen or by adding code annotations.

Root Check

To detect if an application is being run on a rooted device, place a RootCheck on one or more methods in your application. DashO adds code that performs several runtime checks that determine if it is being run on a rooted device. This Check can be configured as described in the Overview.

An application can contain multiple uses of RootCheck with various configurations. Using more than one Check or mixing the Responses will hamper attackers.

private static boolean rootedFlag;
private static Properties myProps;

@RootCheck(sendMessage=true, customDataSource="@myProps", action="@rootedFlag")
public void onCreate(Bundle check){

}

@RootCheck(response=ResponseType.Hang)
private int computeResult(){

}

Notes:
The Root Check for Android requires access to the application's context; it expects a getApplicationContext() method to exist on the class where it is being injected. If you inject the Root Check into a class which extends android.context.Context, like android.app.Activity, android.app.Application, or android.app.Service, it is fine. If not, you will need to add the getApplicationContext() method and make sure it returns a proper Context. If you plan to send messages and want offline message support, you will also need to exclude the added getApplicationContext() method from renaming.

Root Checks may also trigger when running on an emulator or unsecure custom rom.

Root Response

The RootResponse annotation interacts with the RootCheck. This Response can be configured as described in the Overview.

private static boolean rootedFlag;

private Properties customData(){...}

@RootCheck(sendMessage=true, action="@rootedFlag")
public void onCreate(Bundle state){

}

@RootResponse(source="@rootedFlag", sendMessage=true, customDataSource="customData()",
    response=ResponseType.Exit, probability=0.05f)
private int computeResult(){

}

@RootResponse(source="@rootedFlag", sendMessage=true, response=ResponseType.Error,
    probability=0.1f)
private FileInputStream readInput(){

}

PreEmptive Protection - DashO Version 8.2.0. Copyright © 2017 PreEmptive Solutions, LLC