DashO can inject Hook checks into Android applications and libraries to detect runtime hooking. Configure an immediate response, pass the result to application code, or store the result for one or more separate Hook responses.
Before you begin
- Inject the check into a class that provides getApplicationContext(): android.app.Activity, android.app.Application, android.app.Service, etc. will inherit getApplicationContext(), and require no additional changes.
Otherwise, you need to add a getApplicationContext() method and make sure it returns a proper Context.
Configure a Hook check
Configure the check on Checks > Hook in DashO, or add a HookCheck annotation:
private static boolean hookedFlag;
@HookCheck(action="@hookedFlag")
public void onCreate(Bundle check){
}
@HookCheck(response=ResponseType.Hang)
private int computeResult(){
}Configure a separate Hook response
private static boolean hookedFlag;
@HookCheck(action="@hookedFlag")
public void onCreate(Bundle state){
}
@HookResponse(source="@hookedFlag", response=ResponseType.Exit, probability=0.05f)
private int computeResult(){
}
@HookResponse(source="@hookedFlag", response=ResponseType.Error, probability=0.1f)
private FileInputStream readInput(){
}