+

Search Tips   |   Advanced Search

Access Trusteer risk assessment

Access Trusteer risk assessment to add Trusteer protection on the client side.

For an application running on a rooted device, you might want to disable the "Transfer Funds" button entirely, in addition to the server-side security tests described in Configure the MobileFirst Server for Trusteer.

The following code samples are for JavaScript, Java, and Objective-C:

JavaScript

    WL.Trusteer.getRiskAssessment(onSuccess);

Where onSuccess is a function that receives a JSON object containing all the data processed by Trusteer. See Trusteer documentation for information on each risk item.

function onSuccess(result){
  //See the logs for full result
  WL.Logger.debug(JSON.stringify(result));
  //Check for a specific flag
  if(result["os.rooted"]["value"] != 0){
    alert("This device is rooted!");
}

Objective-C

#import "WLTrusteer.h"
NSDictionary* risks =[[WLTrusteer sharedInstance] riskAssessment];
This returns an NSDictionary of all the data that is processed by Truster. See Trusteer documentation for information on each risk item.
//See logs for full result
NSLog(@"%@",risks);
//Check for a specific flag
NSNumber* rooted = [[risks objectForKey:@"os.rooted"] objectForKey:@"value"];
if([rooted intValue]!= 0){
 NSLog(@"Device is jailbroken!");
}

Java

WLTrusteer trusteer = WLTrusteer.getInstance();
JSONObject risks = trusteer.getRiskAssessment();
This returns an JSONObject of all the data that is processed by Truster. See Trusteer documentation for information on each risk item.
JSONObject rooted = (JSONObject) risks.get("os.rooted");
if(rooted.getInt("value") > 0){
 //device is rooted
}


Parent topic: MobileFirst security overview