diff --git a/NEWS b/NEWS index 710cb8755..d2ccb84fc 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +* Version 6.0.1 (released 2022-11-17) + ** Android: Fix issues of YubiKey NEO NFC connectivity on certain phones + * Version 6.0.0 (released 2022-11-15) ** Complete redesign of the UI using Flutter. ** Add support for Android. diff --git a/android/app/src/main/kotlin/com/yubico/authenticator/oath/OathManager.kt b/android/app/src/main/kotlin/com/yubico/authenticator/oath/OathManager.kt index c42604513..20efef9f4 100644 --- a/android/app/src/main/kotlin/com/yubico/authenticator/oath/OathManager.kt +++ b/android/app/src/main/kotlin/com/yubico/authenticator/oath/OathManager.kt @@ -32,11 +32,11 @@ import com.yubico.authenticator.yubikit.withConnection import com.yubico.yubikit.android.transport.usb.UsbYubiKeyDevice import com.yubico.yubikit.core.Transport import com.yubico.yubikit.core.YubiKeyDevice -import com.yubico.yubikit.core.YubiKeyType import com.yubico.yubikit.core.application.ApplicationNotAvailableException import com.yubico.yubikit.core.smartcard.ApduException import com.yubico.yubikit.core.smartcard.SW import com.yubico.yubikit.core.smartcard.SmartCardConnection +import com.yubico.yubikit.core.smartcard.SmartCardProtocol import com.yubico.yubikit.core.util.Result import com.yubico.yubikit.oath.* import com.yubico.yubikit.support.DeviceUtil @@ -61,6 +61,7 @@ class OathManager( companion object { const val TAG = "OathManager" const val NFC_DATA_CLEANUP_DELAY = 30L * 1000 // 30s + val OTP_AID = byteArrayOf(0xa0.toByte(), 0x00, 0x00, 0x05, 0x27, 0x20, 0x01, 0x01) } private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher() @@ -253,35 +254,22 @@ class OathManager( } } - // Update deviceInfo since the deviceId has changed if (oath.version.isLessThan(4, 0, 0) && connection.transport == Transport.NFC) { - // NEO over NFC, need a new connection to select another applet - device.requestConnection(SmartCardConnection::class.java) { - try { - val deviceInfo = DeviceUtil.readInfo(it.value, null) - appViewModel.setDeviceInfo( - deviceInfo.model( - DeviceUtil.getName(deviceInfo, YubiKeyType.NEO), - true, - null - ) - ) - } catch (e: Exception) { - Log.e(TAG, "Failed to read device info", e.toString()) - } - } - } else { - // Not a NEO over NFC, reuse existing connection - val pid = (device as? UsbYubiKeyDevice)?.pid - val deviceInfo = DeviceUtil.readInfo(connection, pid) - appViewModel.setDeviceInfo( - deviceInfo.model( - DeviceUtil.getName(deviceInfo, pid?.type), - device.transport == Transport.NFC, - pid?.value - ) - ) + // NEO over NFC, select OTP applet before reading info + SmartCardProtocol(connection).select(OTP_AID) } + + // Update deviceInfo since the deviceId has changed + val pid = (device as? UsbYubiKeyDevice)?.pid + val deviceInfo = DeviceUtil.readInfo(connection, pid) + appViewModel.setDeviceInfo( + deviceInfo.model( + DeviceUtil.getName(deviceInfo, pid?.type), + device.transport == Transport.NFC, + pid?.value + ) + ) + } } Log.d( diff --git a/helper/version_info.txt b/helper/version_info.txt index 7586001a5..bc14d4a03 100755 --- a/helper/version_info.txt +++ b/helper/version_info.txt @@ -6,8 +6,8 @@ VSVersionInfo( ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. - filevers=(6, 0, 1, 0), - prodvers=(6, 0, 1, 0), + filevers=(6, 0, 2, 0), + prodvers=(6, 0, 2, 0), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x3f, # Contains a bitmask that specifies the Boolean attributes of the file. @@ -31,12 +31,12 @@ VSVersionInfo( '040904b0', [StringStruct('CompanyName', 'Yubico'), StringStruct('FileDescription', 'Yubico Authenticator Helper'), - StringStruct('FileVersion', '6.0.1-dev.1'), + StringStruct('FileVersion', '6.0.2-dev.1'), StringStruct('LegalCopyright', 'Copyright (c) 2022 Yubico AB'), StringStruct('OriginalFilename', 'authenticator-helper.exe'), StringStruct('ProductName', 'Yubico Authenticator'), - StringStruct('ProductVersion', '6.0.1-dev.1')]) - ]), + StringStruct('ProductVersion', '6.0.2-dev.1')]) + ]), VarFileInfo([VarStruct('Translation', [1033, 1200])]) ] ) diff --git a/lib/version.dart b/lib/version.dart index 9384b1a58..0f3c665e7 100755 --- a/lib/version.dart +++ b/lib/version.dart @@ -1,5 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND // This file is generated by running ./set-version.py -const String version = '6.0.1-dev.1'; -const int build = 60003; +const String version = '6.0.2-dev.1'; +const int build = 60004; diff --git a/pubspec.yaml b/pubspec.yaml index de91f5e73..c250491a5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # This field is updated by running ./set-version.py # DO NOT MANUALLY EDIT THIS! -version: 6.0.1-dev.1+60003 +version: 6.0.2-dev.1+60004 environment: sdk: ">=2.17.0 <3.0.0" diff --git a/resources/win/release-win.ps1 b/resources/win/release-win.ps1 index 512017528..d3bf743f3 100644 --- a/resources/win/release-win.ps1 +++ b/resources/win/release-win.ps1 @@ -1,4 +1,4 @@ -$version="6.0.1-dev.1" +$version="6.0.2-dev.1" echo "Renaming the Actions folder and moving it" mv yubioath-desktop-* release