Skip to main content

Android Secure Components v3.9.0

· 2 min read

Improves the public interface of the biometrics enrollment flow and minor fixes.

Added

  • Added startEnrollment(activity, certificates, completion) to improve the result reporting of enrollment flow via WeavrEnrollmentResult.

Changed

  • Improved SDK initialization performance—internal security token generation is now deferred until first use, reducing startup latency.

Fixed

  • Fixed 401 responses during enrollment not dismissing the flow correctly.

Deprecated

  • Deprecated startPSAEnrollment(activity, firebaseToken, authToken, certificates, listener) in favour of startEnrollment(activity, certificates, completion).

Migration guide

To adopt the new startEnrollment method you need to take the following actions:

Ensure you have called the following prerequisites in order:

  1. UXComponents.initialize(context, env, uiKey)—at app startup
  2. UXComponents.psa.initialize(context, psaENV, logger)—at app startup
  3. UXComponents.setUserToken(context, token, listener)—after user login
  4. UXComponents.psa.updateDeviceToken(fcmToken, listener)—after user login

Update your calling site to a snippet similar to the following:

UXComponents.psa.startEnrollment(
activity = this,
certificates = R.array.com_google_android_gms_fonts_certs,
completion = { result ->
when (result) {
is WeavrEnrollmentResult.Completed ->
println("The enrollment was completed successfully")
is WeavrEnrollmentResult.InitialisationError ->
println("There was an error while initialising the enrollment flow: ${result.error}")
is WeavrEnrollmentResult.CryptographyError ->
println("There was an error in the cryptography operations: ${result.error}")
is WeavrEnrollmentResult.FailedBiometricsChallenge ->
println("The user failed the biometrics challenge")
is WeavrEnrollmentResult.Unauthorized ->
println("The token present in the SDK is not valid")
is WeavrEnrollmentResult.UserDoesNotConsent ->
println("The user cancelled the flow")
is WeavrEnrollmentResult.FailedToLoadBrand ->
println("Failed to load the brand configuration")
is WeavrEnrollmentResult.NoPhoneNumberAvailable ->
println("No phone number available to perform the SMS OTP flow")
is WeavrEnrollmentResult.NoBiometricsAvailable ->
println("No biometrics available. Availability: ${result.availability}")
is WeavrEnrollmentResult.ChallengeFailed ->
println("The challenge failed due to ${result.cause}")
}
}
)