Mobile App Threat Intelligence in Native Android Apps

This Knowledge Base article lists the easy steps to build mobile app threat intelligence in native android apps. By using Threat-Events, add active defense for Android apps. No Code, Zero Dev, No SDK. Appdome Threat Intelligence, Threat-Events™, is part of the Appdome Mobile Security Suite. We hope you find it useful and enjoy using Appdome!

Prerequisites for Building Mobile App Threat Intelligence in Native Android Apps

Here’s what you need to build secured native Android apps with threat intelligence

Easy Steps to Build Mobile Threat Intelligence in Native Android Apps

Before enabling Threat-Events, follow these steps below for Android apps to handle the incoming security events in your application:

You are welcome to view the source code of our sample app –BrowserAndroidWithThreatEvents

Download the code – Native-Code-Android.txt

private final static String TAG = "Appdome ThreatEvent";
private final static String BLOCKED_KEYBOARD = "BlockedKeyboardEvent";
private final static String BLOCKED_CLIPBOARD = "BlockedClipboardEvent";
private final static String ROOTED_DEVICE = "RootedDevice";
private final static String UNKNOWN_SOURCES = "UnknownSourcesEnabled";
private final static String DEVELOPER_OPTIONS = "DeveloperOptionsEnabled";
private final static String SSL_VALIDATION_FAILED = "SslCertificateValidationFailed";
private final static String SSL_NON_SSL_CONNECTION = "SslNonSslConnection";
private final static String SSL_CERT_PINNING_FAILED = "SslCertificatePinningFailed";
private final static String ACCCES_OUTSIDE_WHITELIST = "UrlWhitelistFailed";
private final static String SSL_INCOMPATIBLE_CIPHER = "SslIncompatibleCipher";
private final static String SSL_INCOMPATIBLE_TLS = "SslIncompatibleVersion";
private final static String SSL_INVALID_CA_CHAIN = "SslInvalidCertificateChain";
private final static String SSL_INVALID_RSA_SIGNATURE = "SslInvalidMinRSASignature";
private final static String SSL_INVALID_ECC_SIGNATURE = "SslInvalidMinECCSignature";
private final static String SSL_INVALID_DIGEST = "SslInvalidMinDigest";
private final static String BLOCKED_MANUFACTURER = "BannedManufacturer";
private final static String TAMAPERED_APP = "AppIntegrityError";  //Only when ONEShield Threat Events are enabled

private BroadcastReceiver receiver;
private Context context;
public void init(Context context) {
this.context = context;
receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
onEvent(intent);
}
};
context.registerReceiver(receiver, new IntentFilter(BLOCKED_KEYBOARD));
context.registerReceiver(receiver, new IntentFilter(BLOCKED_CLIPBOARD));
context.registerReceiver(receiver, new IntentFilter(ROOTED_DEVICE));
context.registerReceiver(receiver, new IntentFilter(UNKNOWN_SOURCES));
context.registerReceiver(receiver, new IntentFilter(DEVELOPER_OPTIONS));
context.registerReceiver(receiver, new IntentFilter(SSL_VALIDATION_FAILED));
context.registerReceiver(receiver, new IntentFilter(SSL_NON_SSL_CONNECTION));
context.registerReceiver(receiver, new IntentFilter(SSL_CERT_PINNING_FAILED));
context.registerReceiver(receiver, new IntentFilter(ACCCES_OUTSIDE_WHITELIST));
context.registerReceiver(receiver, new IntentFilter(SSL_INCOMPATIBLE_CIPHER));
context.registerReceiver(receiver, new IntentFilter(SSL_INCOMPATIBLE_TLS));
context.registerReceiver(receiver, new IntentFilter(SSL_INVALID_CA_CHAIN));
context.registerReceiver(receiver, new IntentFilter(SSL_INVALID_RSA_SIGNATURE));
context.registerReceiver(receiver, new IntentFilter(SSL_INVALID_ECC_SIGNATURE));
context.registerReceiver(receiver, new IntentFilter(SSL_INVALID_DIGEST));
context.registerReceiver(receiver, new IntentFilter(BLOCKED_MANUFACTURER));
context.registerReceiver(receiver, new IntentFilter(TAMAPERED_APP));   //Only when ONEShield Threat Events are enabled
}
public void stop() {
context.unregisterReceiver(receiver);
}
private void onEvent(Intent intent) {
String action = intent.getAction();
String defaultMessage;
String internalError;
String deveventDetailedErrorMessage;
String host;
String reason;
String certificateSHA1;
String certificateCN;
String incompatibleCipherId;
String incompatibleSslVersion;
String timeStamp;
String deviceID;
String deviceModel;
String osVersion;
String kernelInfo;
String deviceManufacturer;
String fusedAppToken;
String carrierPlmn;
String deviceBrand;
String deviceBoard;
String buildHost;
String buildUser;
String sdkVersion;
switch (action) {
case BLOCKED_KEYBOARD:
if(!intent.hasExtra("keyboard") || !intent.hasExtra("blocked") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
String keyboardID = intent.getStringExtra("keyboard"); // java package of the keyboard
boolean keboardBlocked = intent.getStringExtra("blocked").contentEquals("True");
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case BLOCKED_CLIPBOARD:
if(!intent.hasExtra("action") || !intent.hasExtra("blocked") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
String clipboardAction = intent.getStringExtra("action"); //copy, paste, cut, selectAll or unknown
boolean cliboardBlocked = intent.getStringExtra("blocked").contentEquals("True");
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case ROOTED_DEVICE:
if(!intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
internalError = intent.getStringExtra("internalError"); 
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case UNKNOWN_SOURCES:
if(!intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case DEVELOPER_OPTIONS:
if(!intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_VALIDATION_FAILED:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("DeveventDetailedErrorMessage") || !intent.hasExtra("host") || !intent.hasExtra("certificateSHA1") || !intent.hasExtra("certificateCN") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
deveventDetailedErrorMessage = intent.getStringExtra("DeveventDetailedErrorMessage"); // a detailed error message
host = intent.getStringExtra("host"); // the host on which the error occurred
certificateSHA1 = intent.getStringExtra("certificateSHA1"); // the certificate sha1 fingerprint
certificateCN = intent.getStringExtra("certificateCN"); // the certificate CN (common name)
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_NON_SSL_CONNECTION:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("DeveventDetailedErrorMessage") || !intent.hasExtra("host") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
deveventDetailedErrorMessage = intent.getStringExtra("DeveventDetailedErrorMessage"); // a detailed error message
host = intent.getStringExtra("host"); // the host on which the error occurred
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_CERT_PINNING_FAILED:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("DeveventDetailedErrorMessage") || !intent.hasExtra("host") || !intent.hasExtra("certificateSHA1") || !intent.hasExtra("certificateCN") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
deveventDetailedErrorMessage = intent.getStringExtra("DeveventDetailedErrorMessage"); // a detailed error message
host = intent.getStringExtra("host"); // the host on which the error occurred
certificateSHA1 = intent.getStringExtra("certificateSHA1"); // the certificate sha1 fingerprint
certificateCN = intent.getStringExtra("certificateCN"); // the certificate CN (common name)
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case ACCCES_OUTSIDE_WHITELIST:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("timestamp") || !intent.hasExtra("host") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
timeStamp = intent.getStringExtra("timestamp");
host = intent.getStringExtra("host"); // the host on which the error occurred
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_INCOMPATIBLE_CIPHER:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("host") || !intent.hasExtra("incompatibleCipherId") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
host = intent.getStringExtra("host"); // the host on which the error occurred
incompatibleCipherId = intent.getStringExtra("incompatibleCipherId"); // the incompatible cipher id
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_INCOMPATIBLE_TLS:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("host") || !intent.hasExtra("incompatibleSslVersion") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
host = intent.getStringExtra("host"); // the host on which the error occurred
incompatibleSslVersion = intent.getStringExtra("incompatibleSslVersion"); // the incompatible SSL/TLS version
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_INVALID_CA_CHAIN:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("DeveventDetailedErrorMessage") || !intent.hasExtra("host") || !intent.hasExtra("certificateSHA1") || !intent.hasExtra("certificateCN") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
deveventDetailedErrorMessage = intent.getStringExtra("DeveventDetailedErrorMessage"); // a detailed error message
host = intent.getStringExtra("host"); // the host on which the error occurred
certificateSHA1 = intent.getStringExtra("certificateSHA1"); // the certificate sha1 fingerprint of the certificate causing the error
certificateCN = intent.getStringExtra("certificateCN"); // the certificate CN (common name)
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_INVALID_RSA_SIGNATURE:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("DeveventDetailedErrorMessage") || !intent.hasExtra("host") || !intent.hasExtra("certificateSHA1") || !intent.hasExtra("certificateCN") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
deveventDetailedErrorMessage = intent.getStringExtra("DeveventDetailedErrorMessage"); // a detailed error message
host = intent.getStringExtra("host"); // the host on which the error occurred
certificateSHA1 = intent.getStringExtra("certificateSHA1"); // the certificate sha1 fingerprint of the certificate causing the error
certificateCN = intent.getStringExtra("certificateCN"); // the certificate CN (common name)
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_INVALID_ECC_SIGNATURE:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("DeveventDetailedErrorMessage") || !intent.hasExtra("host") || !intent.hasExtra("certificateSHA1") || !intent.hasExtra("certificateCN") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
deveventDetailedErrorMessage = intent.getStringExtra("DeveventDetailedErrorMessage"); // a detailed error message
host = intent.getStringExtra("host"); // the host on which the error occurred
certificateSHA1 = intent.getStringExtra("certificateSHA1"); // the certificate sha1 fingerprint
certificateCN = intent.getStringExtra("certificateCN"); // the certificate CN (common name)
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case SSL_INVALID_DIGEST:
if(!intent.hasExtra("defaultMessage") || !intent.hasExtra("DeveventDetailedErrorMessage") || !intent.hasExtra("host") || !intent.hasExtra("certificateSHA1") || !intent.hasExtra("certificateCN") || !intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
deveventDetailedErrorMessage = intent.getStringExtra("DeveventDetailedErrorMessage"); // a detailed error message
host = intent.getStringExtra("host"); // the host on which the error occurred
certificateSHA1 = intent.getStringExtra("certificateSHA1"); // the certificate sha1 fingerprint
certificateCN = intent.getStringExtra("certificateCN"); // the certificate CN (common name)
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
case BLOCKED_MANUFACTURER:
if(!intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
timeStamp = intent.getStringExtra("timestamp");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;

//Only when ONEShield Threat Events are enabled
case TAMAPERED_APP:
if(!intent.hasExtra("timestamp") || !intent.hasExtra("deviceID") || !intent.hasExtra("reason") || !intent.hasExtra("deviceModel") || !intent.hasExtra("osVersion") || !intent.hasExtra("kernelInfo") || !intent.hasExtra("deviceManufacturer") || !intent.hasExtra("fusedAppToken") || !intent.hasExtra("carrierPlmn") || !intent.hasExtra("deviceBrand") || !intent.hasExtra("deviceBoard") || !intent.hasExtra("buildHost") || !intent.hasExtra("buildUser") || !intent.hasExtra("sdkVersion")){
Log.e(TAG, "illegal event recieved.");
return;
}
defaultMessage = intent.getStringExtra("defaultMessage"); // message specified during fusion
timeStamp = intent.getStringExtra("timestamp");
reason = intent.getStringExtra("reason");
deviceID = intent.getStringExtra("deviceID");
deviceModel = intent.getStringExtra("deviceModel");
osVersion = intent.getStringExtra("osVersion");
kernelInfo = intent.getStringExtra("kernelInfo");
deviceManufacturer = intent.getStringExtra("deviceManufacturer");
fusedAppToken = intent.getStringExtra("fusedAppToken");
carrierPlmn = intent.getStringExtra("carrierPlmn");
deviceBrand= intent.getStringExtra("deviceBrand");
deviceBoard = intent.getStringExtra("deviceBoard");
buildHost = intent.getStringExtra("buildHost");
buildUser = intent.getStringExtra("buildUser");
sdkVersion = intent.getStringExtra("sdkVersion");
break;
default:
Log.e(TAG, "unknown event recieved " + action);
}
}


How to Add Threat-Events™ to Any Mobile App(s) on Appdome

Follow the step-by-step instructions in this knowledge base to add Threat-Events™ to your native mobile App.

That is it – Enjoy Appdome with Threat-Events™ in your app!

To zoom out on this topic, visit the Mobile App Security page on our website.

Thank you!

Thanks for visiting Appdome! Our mission is to make mobile integration easy. We hope we’re living up to the mission with your project. If you don’t already have an account, you can sign up for free.

Liron Dror

Have a question?

Ask an expert

ScottMaking your security project a success!