serialized = new ArrayList<>(configs.size());
-
- boolean found = false;
- try {
- for (HomeServerConnectionConfig c : configs) {
- if (c.getCredentials().userId.equals(config.getCredentials().userId)) {
- serialized.add(config.toJson());
- found = true;
- } else {
- serialized.add(c.toJson());
- }
- }
- } catch (JSONException e) {
- throw new RuntimeException("Failed to serialize connection config");
- }
-
- if (!found) return;
-
- String ser = new JSONArray(serialized).toString();
-
- Timber.d("Storing " + serialized.size() + " credentials");
-
- editor.putString(PREFS_KEY_CONNECTION_CONFIGS, ser);
- editor.apply();
- }
- }
-
- /**
- * Clear the stored values
- */
- @SuppressLint("ApplySharedPref")
- public void clear() {
- SharedPreferences prefs = mContext.getSharedPreferences(PREFS_LOGIN, Context.MODE_PRIVATE);
- SharedPreferences.Editor editor = prefs.edit();
- editor.remove(PREFS_KEY_CONNECTION_CONFIGS);
- //Need to commit now because called before forcing an app restart
- editor.commit();
- }
-}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnown.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnown.kt
deleted file mode 100644
index a754a0da96..0000000000
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnown.kt
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2020 The Matrix.org Foundation C.I.C.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.matrix.android.sdk.internal.legacy.riot
-
-import com.squareup.moshi.Json
-import com.squareup.moshi.JsonClass
-
-/**
- * IMPORTANT: This class is imported from Riot-Android to be able to perform a migration. Do not use it for any other purpose
- *
- * https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery
- *
- * {
- * "m.homeserver": {
- * "base_url": "https://matrix.org"
- * },
- * "m.identity_server": {
- * "base_url": "https://vector.im"
- * }
- * "m.integrations": {
- * "managers": [
- * {
- * "api_url": "https://integrations.example.org",
- * "ui_url": "https://integrations.example.org/ui"
- * },
- * {
- * "api_url": "https://bots.example.org"
- * }
- * ]
- * }
- * "im.vector.riot.jitsi": {
- * "preferredDomain": "https://jitsi.riot.im/"
- * }
- * }
- *
- */
-@JsonClass(generateAdapter = true)
-class WellKnown {
-
- @JvmField
- @Json(name = "m.homeserver")
- var homeServer: WellKnownBaseConfig? = null
-
- @JvmField
- @Json(name = "m.identity_server")
- var identityServer: WellKnownBaseConfig? = null
-
- @JvmField
- @Json(name = "m.integrations")
- var integrations: Map? = null
-
- /**
- * Returns the list of integration managers proposed.
- */
- fun getIntegrationManagers(): List {
- val managers = ArrayList()
- integrations?.get("managers")?.let {
- (it as? ArrayList<*>)?.let { configs ->
- configs.forEach { config ->
- (config as? Map<*, *>)?.let { map ->
- val apiUrl = map["api_url"] as? String
- val uiUrl = map["ui_url"] as? String ?: apiUrl
- if (apiUrl != null &&
- apiUrl.startsWith("https://") &&
- uiUrl!!.startsWith("https://")) {
- managers.add(
- WellKnownManagerConfig(
- apiUrl = apiUrl,
- uiUrl = uiUrl
- )
- )
- }
- }
- }
- }
- }
- return managers
- }
-
- @JvmField
- @Json(name = "im.vector.riot.jitsi")
- var jitsiServer: WellKnownPreferredConfig? = null
-}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownBaseConfig.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownBaseConfig.kt
deleted file mode 100644
index 2a4ae295fd..0000000000
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownBaseConfig.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2020 The Matrix.org Foundation C.I.C.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.matrix.android.sdk.internal.legacy.riot
-
-import com.squareup.moshi.Json
-import com.squareup.moshi.JsonClass
-
-/**
- * IMPORTANT: This class is imported from Riot-Android to be able to perform a migration. Do not use it for any other purpose
- *
- * https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery
- *
- * {
- * "base_url": "https://vector.im"
- * }
- *
- */
-@JsonClass(generateAdapter = true)
-class WellKnownBaseConfig {
-
- @JvmField
- @Json(name = "base_url")
- var baseURL: String? = null
-}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownManagerConfig.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownManagerConfig.kt
deleted file mode 100644
index 6b1c67f7cb..0000000000
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownManagerConfig.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2020 The Matrix.org Foundation C.I.C.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.matrix.android.sdk.internal.legacy.riot
-
-/**
- * IMPORTANT: This class is imported from Riot-Android to be able to perform a migration. Do not use it for any other purpose
- */
-data class WellKnownManagerConfig(
- val apiUrl: String,
- val uiUrl: String
-)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownPreferredConfig.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownPreferredConfig.kt
deleted file mode 100644
index beb95a1d6f..0000000000
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/riot/WellKnownPreferredConfig.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2020 The Matrix.org Foundation C.I.C.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.matrix.android.sdk.internal.legacy.riot
-
-import com.squareup.moshi.Json
-import com.squareup.moshi.JsonClass
-
-/**
- * IMPORTANT: This class is imported from Riot-Android to be able to perform a migration. Do not use it for any other purpose
- *
- * https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery
- *
- * {
- * "preferredDomain": "https://jitsi.riot.im/"
- * }
- *
- */
-@JsonClass(generateAdapter = true)
-class WellKnownPreferredConfig {
-
- @JvmField
- @Json(name = "preferredDomain")
- var preferredDomain: String? = null
-}
diff --git a/vector-app/src/main/java/im/vector/app/VectorApplication.kt b/vector-app/src/main/java/im/vector/app/VectorApplication.kt
index 5bc6750acc..8d12292524 100644
--- a/vector-app/src/main/java/im/vector/app/VectorApplication.kt
+++ b/vector-app/src/main/java/im/vector/app/VectorApplication.kt
@@ -54,7 +54,6 @@ import im.vector.app.core.resources.BuildMeta
import im.vector.app.features.analytics.VectorAnalytics
import im.vector.app.features.call.webrtc.WebRtcCallManager
import im.vector.app.features.configuration.VectorConfiguration
-import im.vector.app.features.disclaimer.DisclaimerDialog
import im.vector.app.features.invite.InvitesAcceptor
import im.vector.app.features.lifecycle.VectorActivityLifecycleCallbacks
import im.vector.app.features.notifications.NotificationDrawerManager
@@ -71,7 +70,6 @@ import im.vector.application.R
import org.jitsi.meet.sdk.log.JitsiMeetDefaultLogHandler
import org.matrix.android.sdk.api.Matrix
import org.matrix.android.sdk.api.auth.AuthenticationService
-import org.matrix.android.sdk.api.legacy.LegacySessionImporter
import timber.log.Timber
import java.text.SimpleDateFormat
import java.util.Date
@@ -86,7 +84,6 @@ class VectorApplication :
WorkConfiguration.Provider {
lateinit var appContext: Context
- @Inject lateinit var legacySessionImporter: LegacySessionImporter
@Inject lateinit var authenticationService: AuthenticationService
@Inject lateinit var vectorConfiguration: VectorConfiguration
@Inject lateinit var emojiCompatFontProvider: EmojiCompatFontProvider
@@ -111,7 +108,6 @@ class VectorApplication :
@Inject lateinit var buildMeta: BuildMeta
@Inject lateinit var leakDetector: LeakDetector
@Inject lateinit var vectorLocale: VectorLocale
- @Inject lateinit var disclaimerDialog: DisclaimerDialog
// font thread handler
private var fontThreadHandler: Handler? = null
@@ -170,13 +166,6 @@ class VectorApplication :
notificationUtils.createNotificationChannels()
- // It can takes time, but do we care?
- val sessionImported = legacySessionImporter.process()
- if (!sessionImported) {
- // Do not display the name change popup
- disclaimerDialog.doNotShowDisclaimerDialog()
- }
-
ProcessLifecycleOwner.get().lifecycle.addObserver(object : DefaultLifecycleObserver {
override fun onResume(owner: LifecycleOwner) {
Timber.i("App entered foreground")
diff --git a/vector-app/src/main/java/im/vector/app/core/di/SingletonModule.kt b/vector-app/src/main/java/im/vector/app/core/di/SingletonModule.kt
index 385f0f584b..2a917593d8 100644
--- a/vector-app/src/main/java/im/vector/app/core/di/SingletonModule.kt
+++ b/vector-app/src/main/java/im/vector/app/core/di/SingletonModule.kt
@@ -73,7 +73,6 @@ import org.matrix.android.sdk.api.MatrixConfiguration
import org.matrix.android.sdk.api.SyncConfig
import org.matrix.android.sdk.api.auth.AuthenticationService
import org.matrix.android.sdk.api.auth.HomeServerHistoryService
-import org.matrix.android.sdk.api.legacy.LegacySessionImporter
import org.matrix.android.sdk.api.raw.RawService
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.sync.filter.SyncFilterParams
@@ -176,11 +175,6 @@ import javax.inject.Singleton
return activeSessionHolder.getActiveSession()
}
- @Provides
- fun providesLegacySessionImporter(matrix: Matrix): LegacySessionImporter {
- return matrix.legacySessionImporter()
- }
-
@Provides
fun providesAuthenticationService(matrix: Matrix): AuthenticationService {
return matrix.authenticationService()
diff --git a/vector/src/main/java/im/vector/app/features/disclaimer/DisclaimerDialog.kt b/vector/src/main/java/im/vector/app/features/disclaimer/DisclaimerDialog.kt
deleted file mode 100644
index 8214ab7120..0000000000
--- a/vector/src/main/java/im/vector/app/features/disclaimer/DisclaimerDialog.kt
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2019 New Vector Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package im.vector.app.features.disclaimer
-
-import android.app.Activity
-import android.content.SharedPreferences
-import androidx.core.content.edit
-import com.google.android.material.dialog.MaterialAlertDialogBuilder
-import im.vector.app.R
-import im.vector.app.core.di.DefaultPreferences
-import im.vector.app.core.utils.openUrlInChromeCustomTab
-import im.vector.app.features.settings.VectorSettingsUrls
-import javax.inject.Inject
-
-// Increase this value to show again the disclaimer dialog after an upgrade of the application
-private const val CURRENT_DISCLAIMER_VALUE = 2
-
-const val SHARED_PREF_KEY = "LAST_DISCLAIMER_VERSION_VALUE"
-
-class DisclaimerDialog @Inject constructor(
- @DefaultPreferences
- private val sharedPrefs: SharedPreferences,
-) {
- fun showDisclaimerDialog(activity: Activity) {
- if (sharedPrefs.getInt(SHARED_PREF_KEY, 0) < CURRENT_DISCLAIMER_VALUE) {
- sharedPrefs.edit {
- putInt(SHARED_PREF_KEY, CURRENT_DISCLAIMER_VALUE)
- }
-
- val dialogLayout = activity.layoutInflater.inflate(R.layout.dialog_disclaimer_content, null)
-
- MaterialAlertDialogBuilder(activity)
- .setView(dialogLayout)
- .setCancelable(false)
- .setNegativeButton(R.string.disclaimer_negative_button, null)
- .setPositiveButton(R.string.disclaimer_positive_button) { _, _ ->
- openUrlInChromeCustomTab(activity, null, VectorSettingsUrls.DISCLAIMER_URL)
- }
- .show()
- }
- }
-
- fun doNotShowDisclaimerDialog() {
- sharedPrefs.edit {
- putInt(SHARED_PREF_KEY, CURRENT_DISCLAIMER_VALUE)
- }
- }
-}
diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt
index 4b42903d32..872f3f6dd5 100644
--- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt
+++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt
@@ -56,7 +56,6 @@ import im.vector.app.features.analytics.accountdata.AnalyticsAccountDataViewMode
import im.vector.app.features.analytics.plan.MobileScreen
import im.vector.app.features.analytics.plan.ViewRoom
import im.vector.app.features.crypto.recover.SetupMode
-import im.vector.app.features.disclaimer.DisclaimerDialog
import im.vector.app.features.home.room.list.actions.RoomListSharedAction
import im.vector.app.features.home.room.list.actions.RoomListSharedActionViewModel
import im.vector.app.features.home.room.list.home.layout.HomeLayoutSettingBottomDialogFragment
@@ -140,7 +139,6 @@ class HomeActivity :
@Inject lateinit var spaceStateHandler: SpaceStateHandler
@Inject lateinit var unifiedPushHelper: UnifiedPushHelper
@Inject lateinit var nightlyProxy: NightlyProxy
- @Inject lateinit var disclaimerDialog: DisclaimerDialog
@Inject lateinit var notificationPermissionManager: NotificationPermissionManager
private var isNewAppLayoutEnabled: Boolean = false // delete once old app layout is removed
@@ -588,8 +586,6 @@ class HomeActivity :
.setPositiveButton(R.string.yes) { _, _ -> bugReporter.openBugReportScreen(this) }
.setNegativeButton(R.string.no) { _, _ -> bugReporter.deleteCrashFile() }
.show()
- } else {
- disclaimerDialog.showDisclaimerDialog(this)
}
// Force remote backup state update to update the banner if needed
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
index 56c25da0fd..f915395a42 100755
--- a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
@@ -28,7 +28,6 @@ import im.vector.app.core.di.DefaultPreferences
import im.vector.app.core.resources.BuildMeta
import im.vector.app.core.resources.StringProvider
import im.vector.app.features.VectorFeatures
-import im.vector.app.features.disclaimer.SHARED_PREF_KEY
import im.vector.app.features.home.ShortcutsHandler
import im.vector.app.features.homeserver.ServerUrlsRepository
import im.vector.app.features.themes.ThemeUtils
@@ -334,9 +333,6 @@ class VectorPreferences @Inject constructor(
// theme
keysToKeep.add(ThemeUtils.APPLICATION_THEME_KEY)
- // Disclaimer dialog
- keysToKeep.add(SHARED_PREF_KEY)
-
// get all the existing keys
val keys = defaultPrefs.all.keys
diff --git a/vector/src/main/res/drawable/ic_riot_icon.xml b/vector/src/main/res/drawable/ic_riot_icon.xml
deleted file mode 100644
index 51db35b239..0000000000
--- a/vector/src/main/res/drawable/ic_riot_icon.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
diff --git a/vector/src/main/res/layout/dialog_disclaimer_content.xml b/vector/src/main/res/layout/dialog_disclaimer_content.xml
deleted file mode 100644
index 38f376e7eb..0000000000
--- a/vector/src/main/res/layout/dialog_disclaimer_content.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file