I am creating an android application where I need to mock the BiometricPrompt's authenticate() method and replace it with a custom method which based on the response triggers the existing defined conditions/callbacks in the AuthenticationCallback() method.
What I have done so far is:
Write a basic app that uses BiometricPrompt from Android's version 29 and BiometricManager from Android's version 28.
Generated an APK.
used dexlib2 to generate dex files.
Identified the instructions that I need to replace. These instructions are an instance of DexBackedInstruction35c with an opcode VIRTUAL_INVOKE.
I have tried using DexBackedMethod to update this but doesnt provide me with the expected result.
Landroid/hardware/biometrics/BiometricPrompt;->authenticate(Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/hardware/biometrics/BiometricPrompt$AuthenticationCallback;)V
here
Lcom/example/biometricswizzlespoc/BiometricApi29;->authenticate(Landroidx/biometric/BiometricPrompt$PromptInfo;)V
here
How do I update/replace this instruction in modifyMethod ?
Hi,
I am creating an android application where I need to mock the BiometricPrompt's authenticate() method and replace it with a custom method which based on the response triggers the existing defined conditions/callbacks in the AuthenticationCallback() method.
What I have done so far is:
DexBackedInstruction35c
with an opcodeVIRTUAL_INVOKE
.I have tried using DexBackedMethod to update this but doesnt provide me with the expected result.
Trying to follow, https://gist.github.com/JesusFreke/6945806 example, My
methodNeedsModification
looks like this:Sample MethodInstructions to be updated:
How do I update/replace this instruction in modifyMethod ?