Skip to main content

Android

info

Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .

Prior to instrumentation, you need to configure either of the following app properties:

After instrumenting the Application with mock authentication property the application may not support manual authentication (can't authenticate with a real fingerprint).

In order to use setMockAuthenticationReply command on your application, your application needs to be Instrumented, you can achieve this by:

It is recommended to use this command before the application. i.e., the command sets the desired reply for future authentication requests.

Examples 

The following examples are demonstrated in the BiometricAuthentication sample application. Note that some of the dialogs can change, depending on the device vendor and Android version.

Initial Application View

Success Result

Executing the following to display a "Purchase successful" message.

client.setAuthenticationReply("AUTHENTICATION_SUCCEEDED", 0);

client.click("NATIVE", "xpath=//*[@text='PURCHASE']", 0, 1);

Failure Result

Executing the following to display the authentication request with a failure message.

client.setAuthenticationReply("AUTHENTICATION_FAILED", 0);

client.click("NATIVE", "xpath=//*[@text='PURCHASE']", 0, 1);

It will result in 

Cleare the Mocked Reply

To set a different reply or to reset the mocked authentication reply state, close the dialog if open and then execute:

client.setAuthenticationReply("CLEAR_MOCK", 0); 

client.click("NATIVE", "xpath=//*[@text='PURCHASE']", 0, 1);

This results in displaying the original dialog, which is waiting for real user authentication.

More information

The application used in the examples demonstrates the use of the new Biometric API, which replaces FingerprintManager, which is deprecated since API level 28.

In Android, mocking authentication is supported for applications which use the native implementation.

Mock authentication is not supported for third party libraries.