From 11f816868b5af332d57980535accdf4846e5ba90 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 10 Oct 2022 11:39:39 +0200 Subject: [PATCH 1/6] Extracting parsing of browser info into dedicated method --- .../devices/v2/ParseDeviceUserAgentUseCase.kt | 80 ++++++++++--------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt index 20b76fd814..4cc1bf5c9f 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt @@ -74,41 +74,7 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { } private fun parseDesktopUserAgent(userAgent: String): DeviceExtendedInfo { - val browserSegments = userAgent.split(" ") - val (browserName, browserVersion) = when { - isFirefox(browserSegments) -> { - Pair("Firefox", getBrowserVersion(browserSegments, "Firefox")) - } - isEdge(browserSegments) -> { - Pair("Edge", getBrowserVersion(browserSegments, "Edge")) - } - isMobile(browserSegments) -> { - when (val name = getMobileBrowserName(browserSegments)) { - null -> { - Pair(null, null) - } - "Safari" -> { - Pair(name, getBrowserVersion(browserSegments, "Version")) - } - else -> { - Pair(name, getBrowserVersion(browserSegments, name)) - } - } - } - isSafari(browserSegments) -> { - Pair("Safari", getBrowserVersion(browserSegments, "Version")) - } - else -> { - when (val name = getRegularBrowserName(browserSegments)) { - null -> { - Pair(null, null) - } - else -> { - Pair(name, getBrowserVersion(browserSegments, name)) - } - } - } - } + val browserInfo = parseBrowserInfoFromDesktopUserAgent(userAgent) val deviceOperatingSystemSegments = userAgent.substringAfter("(").substringBefore(")").split("; ") val deviceOperatingSystem = if (deviceOperatingSystemSegments.getOrNull(1)?.startsWith("Android").orFalse()) { @@ -120,11 +86,51 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { deviceType = DeviceType.DESKTOP, deviceModel = null, deviceOperatingSystem = deviceOperatingSystem, - clientName = browserName, - clientVersion = browserVersion, + clientName = browserInfo.name, + clientVersion = browserInfo.version, ) } + private data class BrowserInfo(val name: String? = null, val version: String? = null) + + private fun parseBrowserInfoFromDesktopUserAgent(userAgent: String): BrowserInfo { + val browserSegments = userAgent.split(" ") + return when { + isFirefox(browserSegments) -> { + BrowserInfo("Firefox", getBrowserVersion(browserSegments, "Firefox")) + } + isEdge(browserSegments) -> { + BrowserInfo("Edge", getBrowserVersion(browserSegments, "Edge")) + } + isMobile(browserSegments) -> { + when (val name = getMobileBrowserName(browserSegments)) { + null -> { + BrowserInfo() + } + "Safari" -> { + BrowserInfo(name, getBrowserVersion(browserSegments, "Version")) + } + else -> { + BrowserInfo(name, getBrowserVersion(browserSegments, name)) + } + } + } + isSafari(browserSegments) -> { + BrowserInfo("Safari", getBrowserVersion(browserSegments, "Version")) + } + else -> { + when (val name = getRegularBrowserName(browserSegments)) { + null -> { + BrowserInfo() + } + else -> { + BrowserInfo(name, getBrowserVersion(browserSegments, name)) + } + } + } + } + } + private fun parseWebUserAgent(userAgent: String): DeviceExtendedInfo { return parseDesktopUserAgent(userAgent).copy( deviceType = DeviceType.WEB From 4e70fcd339d94a2ce4bc0263a33aa020da68f57e Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 10 Oct 2022 11:41:35 +0200 Subject: [PATCH 2/6] Extracting parsing of operating system for Desktop/Web into dedicated method --- .../devices/v2/ParseDeviceUserAgentUseCase.kt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt index 4cc1bf5c9f..2876d7e855 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt @@ -75,17 +75,12 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { private fun parseDesktopUserAgent(userAgent: String): DeviceExtendedInfo { val browserInfo = parseBrowserInfoFromDesktopUserAgent(userAgent) + val operatingSystem = parseOperatingSystemFromDesktopUserAgent(userAgent) - val deviceOperatingSystemSegments = userAgent.substringAfter("(").substringBefore(")").split("; ") - val deviceOperatingSystem = if (deviceOperatingSystemSegments.getOrNull(1)?.startsWith("Android").orFalse()) { - deviceOperatingSystemSegments.getOrNull(1) - } else { - deviceOperatingSystemSegments.getOrNull(0) - } return DeviceExtendedInfo( deviceType = DeviceType.DESKTOP, deviceModel = null, - deviceOperatingSystem = deviceOperatingSystem, + deviceOperatingSystem = operatingSystem, clientName = browserInfo.name, clientVersion = browserInfo.version, ) @@ -131,6 +126,15 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { } } + private fun parseOperatingSystemFromDesktopUserAgent(userAgent: String): String? { + val deviceOperatingSystemSegments = userAgent.substringAfter("(").substringBefore(")").split("; ") + return if (deviceOperatingSystemSegments.getOrNull(1)?.startsWith("Android").orFalse()) { + deviceOperatingSystemSegments.getOrNull(1) + } else { + deviceOperatingSystemSegments.getOrNull(0) + } + } + private fun parseWebUserAgent(userAgent: String): DeviceExtendedInfo { return parseDesktopUserAgent(userAgent).copy( deviceType = DeviceType.WEB From b4cd72e009cc5b5c82f9020fab425d4d31320804 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 10 Oct 2022 14:31:52 +0200 Subject: [PATCH 3/6] Fixing parsing of operating system info for Desktop/Web user agent --- .../devices/v2/ParseDeviceUserAgentUseCase.kt | 54 +++++++++++++++++-- .../v2/ParseDeviceUserAgentUseCaseTest.kt | 20 +++---- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt index 2876d7e855..59d373fd5a 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt @@ -127,11 +127,47 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { } private fun parseOperatingSystemFromDesktopUserAgent(userAgent: String): String? { - val deviceOperatingSystemSegments = userAgent.substringAfter("(").substringBefore(")").split("; ") - return if (deviceOperatingSystemSegments.getOrNull(1)?.startsWith("Android").orFalse()) { - deviceOperatingSystemSegments.getOrNull(1) - } else { - deviceOperatingSystemSegments.getOrNull(0) + val deviceOperatingSystemSegments = userAgent + .substringAfter("(") + .substringBefore(")") + .split("; ") + val firstSegment = deviceOperatingSystemSegments.getOrNull(0).orEmpty() + val secondSegment = deviceOperatingSystemSegments.getOrNull(1).orEmpty() + + return when { + firstSegment.startsWith(OPERATING_SYSTEM_MAC_KEYWORD) -> { + // e.g. (Macintosh; Intel Mac OS X 10_15_7) => macOS 10.15.7 + val version = secondSegment + .substringAfterLast(" ") + .replace("_", ".") + if (version.isEmpty()) { + OPERATING_SYSTEM_MAC + } else { + "$OPERATING_SYSTEM_MAC $version" + } + } + firstSegment.startsWith(OPERATING_SYSTEM_WINDOWS_KEYWORD) -> { + // e.g. (Windows NT 10.0; Win64; x64) => Windows 10.0 + firstSegment.replace("NT ", "") + } + firstSegment.startsWith(DEVICE_IPAD_KEYWORD) || firstSegment.startsWith(DEVICE_IPHONE_KEYWORD) -> { + // e.g. (iPad; CPU OS 8_4_1 like Mac OS X) => macOS 8.4.1 + val version = secondSegment + .split(" ") + .find { it.contains("_") } + ?.replace("_", ".") + .orEmpty() + if (version.isEmpty()) { + OPERATING_SYSTEM_IOS + } else { + "$OPERATING_SYSTEM_IOS $version" + } + } + secondSegment.startsWith(OPERATING_SYSTEM_ANDROID_KEYWORD) -> { + // e.g. (Linux; Android 9; SM-G973U Build/PPR1.180610.011) => Android 9 + secondSegment + } + else -> null } } @@ -197,5 +233,13 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 private const val WEB_KEYWORD = "Mozilla/" + + private const val OPERATING_SYSTEM_MAC_KEYWORD = "Macintosh" + private const val OPERATING_SYSTEM_MAC = "macOS" + private const val OPERATING_SYSTEM_IOS = "iOS" + private const val OPERATING_SYSTEM_WINDOWS_KEYWORD = "Windows" + private const val OPERATING_SYSTEM_ANDROID_KEYWORD = "Android" + private const val DEVICE_IPAD_KEYWORD = "iPad" + private const val DEVICE_IPHONE_KEYWORD = "iPhone" } } diff --git a/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt b/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt index 19caee1db7..d6ac925603 100644 --- a/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt +++ b/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt @@ -62,8 +62,8 @@ private val A_USER_AGENT_LIST_FOR_DESKTOP = listOf( "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36", ) private val AN_EXPECTED_RESULT_LIST_FOR_DESKTOP = listOf( - DeviceExtendedInfo(DeviceType.DESKTOP, null, "Macintosh", "Electron", "20.1.1"), - DeviceExtendedInfo(DeviceType.DESKTOP, null, "Windows NT 10.0", "Electron", "20.1.1"), + DeviceExtendedInfo(DeviceType.DESKTOP, null, "macOS 10.15.7", "Electron", "20.1.1"), + DeviceExtendedInfo(DeviceType.DESKTOP, null, "Windows 10.0", "Electron", "20.1.1"), ) private val A_USER_AGENT_LIST_FOR_WEB = listOf( @@ -78,15 +78,15 @@ private val A_USER_AGENT_LIST_FOR_WEB = listOf( "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246", ) private val AN_EXPECTED_RESULT_LIST_FOR_WEB = listOf( - DeviceExtendedInfo(DeviceType.WEB, null, "Macintosh", "Chrome", "104.0.5112.102"), - DeviceExtendedInfo(DeviceType.WEB, null, "Windows NT 10.0", "Chrome", "104.0.5112.102"), - DeviceExtendedInfo(DeviceType.WEB, null, "Macintosh", "Firefox", "39.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "Macintosh", "Safari", "8.0.3"), + DeviceExtendedInfo(DeviceType.WEB, null, "macOS 10.15.7", "Chrome", "104.0.5112.102"), + DeviceExtendedInfo(DeviceType.WEB, null, "Windows 10.0", "Chrome", "104.0.5112.102"), + DeviceExtendedInfo(DeviceType.WEB, null, "macOS 10.10", "Firefox", "39.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "macOS 10.10.2", "Safari", "8.0.3"), DeviceExtendedInfo(DeviceType.WEB, null, "Android 9", "Chrome", "69.0.3497.100"), - DeviceExtendedInfo(DeviceType.WEB, null, "iPad", "Safari", "8.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "iPhone", "Safari", "8.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "Windows NT 6.0", "Firefox", "40.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "Windows NT 10.0", "Edge", "12.246"), + DeviceExtendedInfo(DeviceType.WEB, null, "iOS 8.4.1", "Safari", "8.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "iOS 8.4.1", "Safari", "8.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "Windows 6.0", "Firefox", "40.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "Windows 10.0", "Edge", "12.246"), ) private val AN_UNKNOWN_USER_AGENT_LIST = listOf( From 13d87471ab6c530633f5cac0818a0c6de796ee1d Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 10 Oct 2022 14:35:01 +0200 Subject: [PATCH 4/6] Using String const values for browser names --- .../devices/v2/ParseDeviceUserAgentUseCase.kt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt index 59d373fd5a..6e1d20ea2e 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt @@ -92,17 +92,17 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { val browserSegments = userAgent.split(" ") return when { isFirefox(browserSegments) -> { - BrowserInfo("Firefox", getBrowserVersion(browserSegments, "Firefox")) + BrowserInfo(BROWSER_FIREFOX, getBrowserVersion(browserSegments, BROWSER_FIREFOX)) } isEdge(browserSegments) -> { - BrowserInfo("Edge", getBrowserVersion(browserSegments, "Edge")) + BrowserInfo(BROWSER_EDGE, getBrowserVersion(browserSegments, BROWSER_EDGE)) } isMobile(browserSegments) -> { when (val name = getMobileBrowserName(browserSegments)) { null -> { BrowserInfo() } - "Safari" -> { + BROWSER_SAFARI -> { BrowserInfo(name, getBrowserVersion(browserSegments, "Version")) } else -> { @@ -111,7 +111,7 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { } } isSafari(browserSegments) -> { - BrowserInfo("Safari", getBrowserVersion(browserSegments, "Version")) + BrowserInfo(BROWSER_SAFARI, getBrowserVersion(browserSegments, "Version")) } else -> { when (val name = getRegularBrowserName(browserSegments)) { @@ -182,7 +182,7 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { } private fun isFirefox(browserSegments: List): Boolean { - return browserSegments.lastOrNull()?.startsWith("Firefox").orFalse() + return browserSegments.lastOrNull()?.startsWith(BROWSER_FIREFOX).orFalse() } private fun getBrowserVersion(browserSegments: List, browserName: String): String? { @@ -194,11 +194,11 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { } private fun isEdge(browserSegments: List): Boolean { - return browserSegments.lastOrNull()?.startsWith("Edge").orFalse() + return browserSegments.lastOrNull()?.startsWith(BROWSER_EDGE).orFalse() } private fun isSafari(browserSegments: List): Boolean { - return browserSegments.lastOrNull()?.startsWith("Safari").orFalse() && + return browserSegments.lastOrNull()?.startsWith(BROWSER_SAFARI).orFalse() && browserSegments.getOrNull(browserSegments.size - 2)?.startsWith("Version").orFalse() } @@ -209,7 +209,7 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { private fun getMobileBrowserName(browserSegments: List): String? { val possibleBrowserName = browserSegments.getOrNull(browserSegments.size - 3)?.split("/")?.firstOrNull() return if (possibleBrowserName == "Version") { - "Safari" + BROWSER_SAFARI } else { possibleBrowserName } @@ -241,5 +241,9 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { private const val OPERATING_SYSTEM_ANDROID_KEYWORD = "Android" private const val DEVICE_IPAD_KEYWORD = "iPad" private const val DEVICE_IPHONE_KEYWORD = "iPhone" + + private const val BROWSER_FIREFOX = "Firefox" + private const val BROWSER_SAFARI = "Safari" + private const val BROWSER_EDGE = "Edge" } } From 8cd8c65442b09529993d22a912fba6ca9bfab9a6 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 10 Oct 2022 14:42:02 +0200 Subject: [PATCH 5/6] Adding changelog entry --- changelog.d/7321.wip | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/7321.wip diff --git a/changelog.d/7321.wip b/changelog.d/7321.wip new file mode 100644 index 0000000000..2a539503b7 --- /dev/null +++ b/changelog.d/7321.wip @@ -0,0 +1 @@ +[Device management] Improve the parsing for OS of Desktop/Web sessions From daa5f8889952c7f9d03d83e7f7d348662aaa9029 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 10 Oct 2022 15:58:21 +0200 Subject: [PATCH 6/6] Remove parsing of the OS version in case of web/desktop sessions --- .../devices/v2/ParseDeviceUserAgentUseCase.kt | 40 ++++--------------- .../v2/ParseDeviceUserAgentUseCaseTest.kt | 22 +++++----- 2 files changed, 19 insertions(+), 43 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt index 6e1d20ea2e..a25c4d39cb 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCase.kt @@ -135,38 +135,14 @@ class ParseDeviceUserAgentUseCase @Inject constructor() { val secondSegment = deviceOperatingSystemSegments.getOrNull(1).orEmpty() return when { - firstSegment.startsWith(OPERATING_SYSTEM_MAC_KEYWORD) -> { - // e.g. (Macintosh; Intel Mac OS X 10_15_7) => macOS 10.15.7 - val version = secondSegment - .substringAfterLast(" ") - .replace("_", ".") - if (version.isEmpty()) { - OPERATING_SYSTEM_MAC - } else { - "$OPERATING_SYSTEM_MAC $version" - } - } - firstSegment.startsWith(OPERATING_SYSTEM_WINDOWS_KEYWORD) -> { - // e.g. (Windows NT 10.0; Win64; x64) => Windows 10.0 - firstSegment.replace("NT ", "") - } - firstSegment.startsWith(DEVICE_IPAD_KEYWORD) || firstSegment.startsWith(DEVICE_IPHONE_KEYWORD) -> { - // e.g. (iPad; CPU OS 8_4_1 like Mac OS X) => macOS 8.4.1 - val version = secondSegment - .split(" ") - .find { it.contains("_") } - ?.replace("_", ".") - .orEmpty() - if (version.isEmpty()) { - OPERATING_SYSTEM_IOS - } else { - "$OPERATING_SYSTEM_IOS $version" - } - } - secondSegment.startsWith(OPERATING_SYSTEM_ANDROID_KEYWORD) -> { - // e.g. (Linux; Android 9; SM-G973U Build/PPR1.180610.011) => Android 9 - secondSegment - } + // e.g. (Macintosh; Intel Mac OS X 10_15_7) => macOS + firstSegment.startsWith(OPERATING_SYSTEM_MAC_KEYWORD) -> OPERATING_SYSTEM_MAC + // e.g. (Windows NT 10.0; Win64; x64) => Windows + firstSegment.startsWith(OPERATING_SYSTEM_WINDOWS_KEYWORD) -> OPERATING_SYSTEM_WINDOWS_KEYWORD + // e.g. (iPad; CPU OS 8_4_1 like Mac OS X) => iOS + firstSegment.startsWith(DEVICE_IPAD_KEYWORD) || firstSegment.startsWith(DEVICE_IPHONE_KEYWORD) -> OPERATING_SYSTEM_IOS + // e.g. (Linux; Android 9; SM-G973U Build/PPR1.180610.011) => Android + secondSegment.startsWith(OPERATING_SYSTEM_ANDROID_KEYWORD) -> OPERATING_SYSTEM_ANDROID_KEYWORD else -> null } } diff --git a/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt b/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt index d6ac925603..20c4a8fa3d 100644 --- a/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt +++ b/vector/src/test/java/im/vector/app/features/settings/devices/v2/ParseDeviceUserAgentUseCaseTest.kt @@ -62,8 +62,8 @@ private val A_USER_AGENT_LIST_FOR_DESKTOP = listOf( "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36", ) private val AN_EXPECTED_RESULT_LIST_FOR_DESKTOP = listOf( - DeviceExtendedInfo(DeviceType.DESKTOP, null, "macOS 10.15.7", "Electron", "20.1.1"), - DeviceExtendedInfo(DeviceType.DESKTOP, null, "Windows 10.0", "Electron", "20.1.1"), + DeviceExtendedInfo(DeviceType.DESKTOP, null, "macOS", "Electron", "20.1.1"), + DeviceExtendedInfo(DeviceType.DESKTOP, null, "Windows", "Electron", "20.1.1"), ) private val A_USER_AGENT_LIST_FOR_WEB = listOf( @@ -78,15 +78,15 @@ private val A_USER_AGENT_LIST_FOR_WEB = listOf( "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246", ) private val AN_EXPECTED_RESULT_LIST_FOR_WEB = listOf( - DeviceExtendedInfo(DeviceType.WEB, null, "macOS 10.15.7", "Chrome", "104.0.5112.102"), - DeviceExtendedInfo(DeviceType.WEB, null, "Windows 10.0", "Chrome", "104.0.5112.102"), - DeviceExtendedInfo(DeviceType.WEB, null, "macOS 10.10", "Firefox", "39.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "macOS 10.10.2", "Safari", "8.0.3"), - DeviceExtendedInfo(DeviceType.WEB, null, "Android 9", "Chrome", "69.0.3497.100"), - DeviceExtendedInfo(DeviceType.WEB, null, "iOS 8.4.1", "Safari", "8.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "iOS 8.4.1", "Safari", "8.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "Windows 6.0", "Firefox", "40.0"), - DeviceExtendedInfo(DeviceType.WEB, null, "Windows 10.0", "Edge", "12.246"), + DeviceExtendedInfo(DeviceType.WEB, null, "macOS", "Chrome", "104.0.5112.102"), + DeviceExtendedInfo(DeviceType.WEB, null, "Windows", "Chrome", "104.0.5112.102"), + DeviceExtendedInfo(DeviceType.WEB, null, "macOS", "Firefox", "39.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "macOS", "Safari", "8.0.3"), + DeviceExtendedInfo(DeviceType.WEB, null, "Android", "Chrome", "69.0.3497.100"), + DeviceExtendedInfo(DeviceType.WEB, null, "iOS", "Safari", "8.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "iOS", "Safari", "8.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "Windows", "Firefox", "40.0"), + DeviceExtendedInfo(DeviceType.WEB, null, "Windows", "Edge", "12.246"), ) private val AN_UNKNOWN_USER_AGENT_LIST = listOf(