Import App Shielding libraries in Android Studio

The App Shielding libraries can be imported from .aar files. You can import ShieldSDK.aar and shield_common_android.aar to access all callbacks.

Adding shield_activity_guard_android to your project will add Task hijacking protection.

If you have not integrated App Shielding but wish to be protected against task hijacking and you:

  • Do not need callbacks: Add shield_activity_guard_android and ShieldSDK-common.
  • Need callbacks: Add ShieldSDK, shield_common_android.aar, and shield_activity_guard_android.

If you have already integrated App Shielding: Add shield_activity_guard_android.

Adding shield_screen_mirroring_android to your project allows you to customize the screen layout for screen mirroring. You can integrate it independently from other libraries.

In all cases, you have to shield your application through the OneSpan Customer Portal or OneSpan Mobile Portal.

Import the Shield SDK library as an.aar file

You can import the App Shielding library by adding the provided bin/ShieldSDK.aar and shield_common_android.aar files to your Android Studio project.

Import ShieldSDK.aar

To import the ShieldSDK library from the .aar file, you need to add dependencies to ShieldSDK.aar and shield_common_android.aar to the build.gradle file of your application module.

 

MyApplication/app/build.gradle

dependencies {
...
implementation files("<path-to-package>/ShieldSDK.aar")
implementation files("<path-to-package>/shield_common_android.aar")
}

Import Activity Guard as an.aar file

You can import the ShieldSDK Activity Guard library by adding the provided shield_activity_guard_android.aar and shield_common_android.aar files to your Android Studio project.

Import shield_activity_guard_android.aar

To import the ShieldSDK Activity Guard library from the .aar file, you need to add dependencies to shield_activity_guard_android.aar and shield_common_android.aar in the build.gradle file to your application module.

 

ExampleApplication/app/build.gradle

dependencies {
...
implementation files("<path-to-package>/shield_activity_guard_android.aar")
implementation files("<path-to-package>/shield_common_android.aar")
}

Import Screen Mirroring as an .aar file

You can import the ShieldSDK screen mirroring library by adding the provided shield_screen_mirroring_android.aar file to your Android Studio project.

Import shield_screen_mirroring_android.aar

To import the ShieldSDK screen mirroring library from the .aar file, you need to add shield_screen_mirroring_android.aar to the build.gradle file of your application module:

 

ExampleApplication/app/build.gradle

dependencies {
...
implementation files("<path-to-package>/shield_screen_mirroring_android.aar")
}

Import the configuration library as .aar file

You can import the ShieldSDK configuration library by adding the provided shield_config_android.aar file to your Android Studio project.

Import shield_config_android.aar

To import the ShieldSDK config library from the .aar file, you need to add shield_config_android.aar to the build.gradle file of your application module.

 

ExampleApplication/app/build.gradle

dependencies {
...
implementation files("<path-to-package>/shield_config_android.aar")
}

Import App Shielding libraries using a Maven repository

You can import the ShieldSDK libraries by using the Maven repository provided in the product package. You can set up the repository locally, or on your own server. After setting up the repository, you can use it in your project as outlined below.

 

ExampleApplication/build.gradle

repositories {
...
//Local Maven repository
mavenLocal()
}

If you are using a remote Maven repository, include it in your project build configuration as follows.

 

ExampleApplication/build.gradle

repositories {
...
//Remote Maven repository
maven {
  url '<your_repository_url>'
}
}

ExampleApplication/app/build.gradle

  1. dependencies {
  2. ...
  3. implementation 'no.promon.shield:ShieldSDK-callbacks:6.5.3'
  4. implementation 'no.promon.shield:ShieldSDK-common:6.5.3'
  5. }

Avoid using the + character in version numbers when working with Maven libraries, as it can lead to unpredictable builds. Use a specific version instead.