From a6038cad6ef48484940e372ca551cbfb5b13347f Mon Sep 17 00:00:00 2001 From: Adam Velebil Date: Tue, 10 Sep 2024 14:49:17 +0200 Subject: [PATCH] emit nfc overlay messages after FIDO reset --- .../kotlin/com/yubico/authenticator/fido/FidoResetHelper.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/app/src/main/kotlin/com/yubico/authenticator/fido/FidoResetHelper.kt b/android/app/src/main/kotlin/com/yubico/authenticator/fido/FidoResetHelper.kt index 9ba6336fe..00c2c4a2b 100644 --- a/android/app/src/main/kotlin/com/yubico/authenticator/fido/FidoResetHelper.kt +++ b/android/app/src/main/kotlin/com/yubico/authenticator/fido/FidoResetHelper.kt @@ -25,6 +25,7 @@ import com.yubico.authenticator.NULL import com.yubico.authenticator.device.DeviceManager import com.yubico.authenticator.fido.data.Session import com.yubico.authenticator.fido.data.YubiKitFidoSession +import com.yubico.authenticator.yubikit.NfcState import com.yubico.yubikit.core.application.CommandState import com.yubico.yubikit.core.fido.CtapException import kotlinx.coroutines.CoroutineScope @@ -222,11 +223,13 @@ class FidoResetHelper( FidoManager.updateDeviceInfo.set(true) connectionHelper.useSessionNfc { fidoSession -> doReset(fidoSession) + appMethodChannel.nfcStateChanged(NfcState.SUCCESS) continuation.resume(Unit) }.value } catch (e: Throwable) { // on NFC, clean device info in this situation mainViewModel.setDeviceInfo(null) + appMethodChannel.nfcStateChanged(NfcState.FAILURE) logger.error("Failure during FIDO reset:", e) continuation.resumeWithException(e) }