Lint fixes.

This commit is contained in:
Onuray Sahin 2022-09-29 11:40:15 +03:00
parent c16b5d674c
commit 4c173a79ae
3 changed files with 16 additions and 13 deletions

View File

@ -20,27 +20,27 @@ import im.vector.app.features.settings.devices.v2.list.DeviceType
data class DeviceUserAgent( data class DeviceUserAgent(
/** /**
* One of MOBILE, WEB, DESKTOP or UNKNOWN * One of MOBILE, WEB, DESKTOP or UNKNOWN.
*/ */
val deviceType: DeviceType, val deviceType: DeviceType,
/** /**
* i.e. Google Pixel 6 * i.e. Google Pixel 6.
*/ */
val deviceModel: String? = null, val deviceModel: String? = null,
/** /**
* i.e. Android 11 * i.e. Android 11.
*/ */
val deviceOperatingSystem: String? = null, val deviceOperatingSystem: String? = null,
/** /**
* i.e. Element Nightly * i.e. Element Nightly.
*/ */
val clientName: String? = null, val clientName: String? = null,
/** /**
* i.e. 1.5.0 * i.e. 1.5.0.
*/ */
val clientVersion: String? = null, val clientVersion: String? = null,
/** /**
* i.e. Chrome * i.e. Chrome.
*/ */
val browser: String? = null, val browser: String? = null,
) )

View File

@ -133,15 +133,16 @@ class ParseDeviceUserAgentUseCase @Inject constructor() {
companion object { companion object {
// Element dbg/1.5.0-dev (Xiaomi; Mi 9T; Android 11; RKQ1.200826.002 test-keys; Flavour GooglePlay; MatrixAndroidSdk2 1.5.0) // Element dbg/1.5.0-dev (Xiaomi; Mi 9T; Android 11; RKQ1.200826.002 test-keys; Flavour GooglePlay; MatrixAndroidSdk2 1.5.0)
// Legacy : Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSdk2 1.0) // Legacy : Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSdk2 1.0)
private val ANDROID_KEYWORD = "; MatrixAndroidSdk2" private const val ANDROID_KEYWORD = "; MatrixAndroidSdk2"
// Element/1.8.21 (iPhone XS Max; iOS 15.2; Scale/3.00) // Element/1.8.21 (iPhone XS Max; iOS 15.2; Scale/3.00)
private val IOS_KEYWORD = "; iOS " private const val IOS_KEYWORD = "; iOS "
// Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36 // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301
private val DESKTOP_KEYWORD = " Electron/" // Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36
private const val DESKTOP_KEYWORD = " Electron/"
// 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 // 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 val WEB_KEYWORD = "Mozilla/" private const val WEB_KEYWORD = "Mozilla/"
} }
} }

View File

@ -51,11 +51,13 @@ private val AN_EXPECTED_RESULT_LIST_FOR_IOS = listOf(
DeviceUserAgent(DeviceType.MOBILE, "iPhone", "iOS 15.2", "Element", "1.8.21"), DeviceUserAgent(DeviceType.MOBILE, "iPhone", "iOS 15.2", "Element", "1.8.21"),
DeviceUserAgent(DeviceType.MOBILE, "iPhone XS Max", "iOS 15.2", "Element", "1.8.21"), DeviceUserAgent(DeviceType.MOBILE, "iPhone XS Max", "iOS 15.2", "Element", "1.8.21"),
DeviceUserAgent(DeviceType.MOBILE, "iPad Pro (11-inch)", "iOS 15.2", "Element", "1.8.21"), DeviceUserAgent(DeviceType.MOBILE, "iPad Pro (11-inch)", "iOS 15.2", "Element", "1.8.21"),
DeviceUserAgent(DeviceType.MOBILE, "iPad Pro (12.9-inch) (3rd generation)", "iOS 15.2", "Element", "1.8.21"), DeviceUserAgent(DeviceType.MOBILE, "iPad Pro (12.9-inch) (3rd generation)", "iOS 15.2",
"Element", "1.8.21"),
) )
private val A_USER_AGENT_LIST_FOR_DESKTOP = listOf( private val A_USER_AGENT_LIST_FOR_DESKTOP = listOf(
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102" +
" Electron/20.1.1 Safari/537.36",
"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", "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( private val AN_EXPECTED_RESULT_LIST_FOR_DESKTOP = listOf(