mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-24 02:33:44 +03:00
update DeviceInfo
This commit is contained in:
parent
9a3659a423
commit
ccf0c16584
@ -49,8 +49,10 @@ data class Info(
|
|||||||
val isNfc: Boolean,
|
val isNfc: Boolean,
|
||||||
@SerialName("usb_pid")
|
@SerialName("usb_pid")
|
||||||
val usbPid: Int?,
|
val usbPid: Int?,
|
||||||
|
@SerialName("pin_complexity")
|
||||||
|
val pinComplexity: Boolean,
|
||||||
@SerialName("supported_capabilities")
|
@SerialName("supported_capabilities")
|
||||||
val supportedCapabilities: Capabilities
|
val supportedCapabilities: Capabilities,
|
||||||
) {
|
) {
|
||||||
constructor(name: String, isNfc: Boolean, usbPid: Int?, deviceInfo: DeviceInfo) : this(
|
constructor(name: String, isNfc: Boolean, usbPid: Int?, deviceInfo: DeviceInfo) : this(
|
||||||
config = Config(deviceInfo.config),
|
config = Config(deviceInfo.config),
|
||||||
@ -63,6 +65,7 @@ data class Info(
|
|||||||
name = name,
|
name = name,
|
||||||
isNfc = isNfc,
|
isNfc = isNfc,
|
||||||
usbPid = usbPid,
|
usbPid = usbPid,
|
||||||
|
pinComplexity = deviceInfo.pinComplexity,
|
||||||
supportedCapabilities = Capabilities(
|
supportedCapabilities = Capabilities(
|
||||||
nfc = deviceInfo.capabilitiesFor(Transport.NFC),
|
nfc = deviceInfo.capabilitiesFor(Transport.NFC),
|
||||||
usb = deviceInfo.capabilitiesFor(Transport.USB),
|
usb = deviceInfo.capabilitiesFor(Transport.USB),
|
||||||
|
@ -18,5 +18,6 @@ val UnknownDevice = Info(
|
|||||||
name = "Unrecognized device",
|
name = "Unrecognized device",
|
||||||
isNfc = false,
|
isNfc = false,
|
||||||
usbPid = null,
|
usbPid = null,
|
||||||
|
pinComplexity = false,
|
||||||
supportedCapabilities = Capabilities()
|
supportedCapabilities = Capabilities()
|
||||||
)
|
)
|
@ -74,6 +74,7 @@ class SkyHelper(private val compatUtil: CompatUtil) {
|
|||||||
name = (device.usbDevice.productName ?: "Yubico Security Key"),
|
name = (device.usbDevice.productName ?: "Yubico Security Key"),
|
||||||
isNfc = false,
|
isNfc = false,
|
||||||
usbPid = pid.value,
|
usbPid = pid.value,
|
||||||
|
pinComplexity = false,
|
||||||
supportedCapabilities = Capabilities(usb = 0)
|
supportedCapabilities = Capabilities(usb = 0)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user