• BlackBerry Spark AppSecure
  • Security library for Android applications
  • 0.7.915.0
DeviceSoftwareRules Class Reference

Configure specific software checks to be evaluated. More...

Description

Configure what security patch level and OS version is required for your application to be safe. Flag if your application is running on a specific manufacturers device whose software or version of Android is deemed to be untrustworthy.

OS and Security Patch Versions

It is recommend that users have a recent security patch level and OS version to be confident your application is being run in a safe environment.

Utilize the security checks within the library to help inform or perhaps enforce that a user upgrades their device software. Define your minimum requirements for security patch level and OS version and then enable these checks using 'DeviceSoftware.enableCheck'.

Device Manufacturer and Model

Additionally preclude specific device manufactures or device models from running your application that are deemed to be a security risk. This may be relevant in certain locales where devices from a certain manufacturer are deemed to be untrustworthy.

Classes

enum  DeviceSoftwareCheck
 Enumeration of software security checks which may be evaluated by the library. More...
 

Public Member Functions

 DeviceSoftwareRules ()
 Constructor with all checks disabled. More...
 
 DeviceSoftwareRules (SecurityFeatureStatus status)
 Set all checks to be enabled or disabled. More...
 
DeviceSoftwareRules enableCheck (DeviceSoftwareCheck check)
 Enable a specific check to be evaluated once the required rules are configured. More...
 
DeviceSoftwareRules disableCheck (DeviceSoftwareCheck check)
 Turn off a specific check from being evaluated. More...
 
SecurityFeatureStatus getCheck (DeviceSoftwareCheck check)
 Determine if a specific check is currently enabled. More...
 
List< String > getManufacturerDenyList ()
 Return the list of device manufacturers which are denied. More...
 
DeviceSoftwareRules setManufacturerDenyList (List< String > manufacturerDenyList)
 Configure a list of device manufacturers to deny. More...
 
List< String > getModelDenyList ()
 Return the list of device models which are denied. More...
 
DeviceSoftwareRules setModelDenyList (List< String > modelDenyList)
 Configure a list of device models to deny. More...
 
String getMinimumOSVersion ()
 Return the minimum OS version permitted. More...
 
DeviceSoftwareRules setMinimumOSVersion (String minimumOSVersion) throws IllegalArgumentException
 Configure the minimum OS version permitted. More...
 
Date getSecurityPatchMinimumDate ()
 Returns minimum required date of system security patch. More...
 
DeviceSoftwareRules setSecurityPatchMinimumDate (Date securityPatchMinimumDate)
 Configure the minimum required date of system security patch. More...
 
List< String > getUnsupportedOsVersions ()
 Return the list of OS versions which are denied. More...
 
DeviceSoftwareRules setUnsupportedOsVersions (List< String > unsupportedOsVersions)
 Configure a list of OS versions to deny. More...
 

Constructor & Destructor Documentation

◆ DeviceSoftwareRules() [1/2]

Constructor with all checks disabled. All deny lists are empty. Min version is 0.0.0.0. Minimum patch level date is 1970-01-01T00:00:00Z.

◆ DeviceSoftwareRules() [2/2]

Constructor which sets all Check statuses to status. All deny lists are empty. Minimum patch level date is 1970-01-01T00:00:00Z.

Parameters
status- security feature status for all checks (individual checks can be enabled/disabled by enableCheck/disableCheck APIs)

Member Function Documentation

◆ enableCheck()

DeviceSoftwareRules enableCheck ( DeviceSoftwareCheck  check)

Enable a specific check to be evaluated. Note the rules to evaluate must be configured.

◆ disableCheck()

DeviceSoftwareRules disableCheck ( DeviceSoftwareCheck  check)

Turn off a specific check so it is no longer evaluated.

◆ getCheck()

Determine if a specific check is currently enabled.

◆ getManufacturerDenyList()

List<String> getManufacturerDenyList ( )

Return the list of device manufacturers which are denied. If a user's device is manufactured by a company on this list, it will be flagged as a DeviceSoftware threat.

Returns
A string list of device manufacturers

◆ setManufacturerDenyList()

DeviceSoftwareRules setManufacturerDenyList ( List< String >  manufacturerDenyList)

Configure a list of device manufacturers which will be flagged as a risk.

Parameters
manufacturerDenyListA list of manufacturers on the deny list.
Returns
The DeviceSoftwareRules object

◆ getModelDenyList()

List<String> getModelDenyList ( )

Return the list of device models which are denied. If the model of a user's device matches one of the models on this list it will be flagged as a DeviceSoftware threat.

Returns
A string list of device models.

◆ setModelDenyList()

DeviceSoftwareRules setModelDenyList ( List< String >  modelDenyList)

Configure a list of device models which will be flagged as a risk.

Parameters
modelDenyListA list of device models on the deny list.
Returns
The DeviceSoftwareRules object

◆ getMinimumOSVersion()

String getMinimumOSVersion ( )
Returns
A string representing the minimum OS Version. i.e. Android versionName.

◆ setMinimumOSVersion()

DeviceSoftwareRules setMinimumOSVersion ( String  minimumOSVersion) throws IllegalArgumentException

Configure the minimum OS version permitted. Use string dot notation format, e.g. 10.1.0

Parameters
minimumOSVersionThe minimum permitted OS version.
Exceptions
IllegalArgumentException- thrown when minimumOSVersion isn't in the correct dot notation format.
Returns
The DeviceSoftwareRules object

◆ getSecurityPatchMinimumDate()

Date getSecurityPatchMinimumDate ( )

Returns the earliest date of the Android security patch which must be installed on the device. Security updates installed after this date are deemed to be acceptable.

Returns
date The date after which a security patch must have been installed.

◆ setSecurityPatchMinimumDate()

DeviceSoftwareRules setSecurityPatchMinimumDate ( Date  securityPatchMinimumDate)

Set the oldest permitted date for when the Android security patch which last updated on the device. Security updates installed before this date will be flagged as a risk.

The minimum patch level date is 1970-01-01T00:00:00Z.

Parameters
securityPatchMinimumDatethe oldest permitted date of the security patch.

◆ getUnsupportedOsVersions()

List<String> getUnsupportedOsVersions ( )

Return the list of OS versions which are denied. If the OS version of a user's device matches one of the versions on this list it will be flagged as a DeviceSoftware threat.

Returns
A string list of OS versions.

◆ setUnsupportedOsVersions()

DeviceSoftwareRules setUnsupportedOsVersions ( List< String >  unsupportedOsVersions)

Configure a list of OS versions which will be flagged as unsupported.

Parameters
unsupportedOsVersionsA list of unsupported OS versions on the deny list.
Returns
The DeviceSoftwareRules object