Page tree
Skip to end of metadata
Go to start of metadata

Offline Biometric instrumentation is the process of adding SeeTest's fingerprint mocking capabilities to the app in the app build process, as opposed to adding those libraries in the import process.


Mock Source Code

The jar of source code can be acquired by contacting Experitest support.

Instrumenting Biometric libraries:

To instrumenting the biometric libs, we should make the following changes in the Android application source code - 

  • Add fingerprint-mock.jar to your app build.gradle 

    implementation files('YOUR_MOCK_JAR_LOCATION\fingerprint-mock.jar')
  • replace  "android.hardware.fingerprint.FingerprintManager" to "com.mock.FingerprintManager"
  • replace "android.hardware.fingerprint.FingerprintFactory" to "com.mock.FingerprintFactory"
  • If getting the FingerPrintManager service as - getSystemService(FingerprintManager.class) replace to FingerprintFactory.getInstance(<context>).
  • "android.security.keystore.KeyGenParameterSpec.Builder" should be replaced by "com.mock.KeyGenParameterSpec.Builder".
  • Register the fingerprint broadcast receiver in the application's AndroidManifest as -

    <receiver android:name="com.mock.FingerPrintReceiver">
    	<intent-filter>
    		<action android:name= "<YOUR_APPLICATION_ID>.fpip.ir"/>
        </intent-filter>
    </receiver>

We may encounter some unexpected errors in the application codebase, such as - 

  • java.lang.BootstrapMethodError: Exception from call site #2 bootstrap method - This may be because the application does not have JAVA_1_8 source compatibility. 


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }




  • No labels