Import App Shielding libraries in Android Studio
  • 18 Oct 2024
  • 2 Minutes to read
  • Dark
    Light

Import App Shielding libraries in Android Studio

  • Dark
    Light

Article summary

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

dependencies {
...
implementation 'no.promon.shield:ShieldSDK-callbacks:7.0.0'
implementation 'no.promon.shield:ShieldSDK-common:7.0.0'
}

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


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Ozzy, our interactive help assistant