From 4d7cd7319b45f6c952dfbff33ba247df4c4ad035 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Mon, 7 Sep 2020 12:19:34 +0300 Subject: [PATCH] Handle new mobile config url. --- tools/tests/test_configuration_link.sh | 2 +- vector/src/main/AndroidManifest.xml | 1 + .../java/im/vector/app/features/link/LinkHandlerActivity.kt | 4 ++-- .../src/main/java/im/vector/app/features/login/LoginConfig.kt | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/tests/test_configuration_link.sh b/tools/tests/test_configuration_link.sh index 33b1699e70..d0a5e38e6a 100755 --- a/tools/tests/test_configuration_link.sh +++ b/tools/tests/test_configuration_link.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -adb shell am start -a android.intent.action.VIEW -d "https://riot.im/config/config?hs_url=https%3A%2F%2Fmozilla-test.modular.im" +adb shell am start -a android.intent.action.VIEW -d "https://mobile.element.io?hs_url=https%3A%2F%2Fmozilla-test.modular.im" diff --git a/vector/src/main/AndroidManifest.xml b/vector/src/main/AndroidManifest.xml index 539a672e97..2f1df686a6 100644 --- a/vector/src/main/AndroidManifest.xml +++ b/vector/src/main/AndroidManifest.xml @@ -145,6 +145,7 @@ + diff --git a/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt b/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt index 25ebf85b1c..c8ef63c40c 100644 --- a/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt +++ b/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt @@ -59,7 +59,7 @@ class LinkHandlerActivity : VectorBaseActivity() { return } - if (uri.path == PATH_CONFIG) { + if (uri.getQueryParameter(CONFIG_PATH_HS_PARAMETER) != null) { handleConfigUrl(uri) } else if (SUPPORTED_HOSTS.contains(uri.host)) { handleSupportedHostUrl(uri) @@ -155,7 +155,7 @@ class LinkHandlerActivity : VectorBaseActivity() { } companion object { - private const val PATH_CONFIG = "/config/config" + private const val CONFIG_PATH_HS_PARAMETER = "hs_url" private val SUPPORTED_HOSTS = arrayOf("app.element.io", "riot.im") private val SUPPORTED_PATHS = arrayOf("/#/room", "/#/user", "/#/group") diff --git a/vector/src/main/java/im/vector/app/features/login/LoginConfig.kt b/vector/src/main/java/im/vector/app/features/login/LoginConfig.kt index 701335af6b..320d3e1871 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginConfig.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginConfig.kt @@ -22,7 +22,7 @@ import kotlinx.android.parcel.Parcelize /** * Parameters extracted from a configuration url - * Ex: https://riot.im/config/config?hs_url=https%3A%2F%2Fexample.modular.im&is_url=https%3A%2F%2Fcustom.identity.org + * Ex: https://mobile.element.io?hs_url=https%3A%2F%2Fexample.modular.im&is_url=https%3A%2F%2Fcustom.identity.org * * Note: On RiotX, identityServerUrl will never be used, so is declared private. Keep it for compatibility reason. */