diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e71b20a051..e1bddd561b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -219,7 +219,6 @@ dependencies { implementation(libs.androidx.activity.compose) implementation(libs.androidx.startup) implementation(libs.coil) - implementation(libs.matrix.sdk) implementation(libs.dagger) kapt(libs.dagger.compiler) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt index 55361be4b4..b57af30bf3 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt @@ -34,13 +34,13 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.withContext -import org.matrix.rustcomponents.sdk.AuthenticationService import org.matrix.rustcomponents.sdk.Client import org.matrix.rustcomponents.sdk.ClientBuilder import org.matrix.rustcomponents.sdk.Session import org.matrix.rustcomponents.sdk.use import java.io.File import javax.inject.Inject +import org.matrix.rustcomponents.sdk.AuthenticationService as RustAuthenticationService @ContributesBinding(AppScope::class) @SingleIn(AppScope::class) @@ -49,9 +49,9 @@ class RustMatrixAuthenticationService @Inject constructor( private val coroutineScope: CoroutineScope, private val coroutineDispatchers: CoroutineDispatchers, private val sessionStore: SessionStore, - private val authService: AuthenticationService, ) : MatrixAuthenticationService { + private val authService: RustAuthenticationService = RustAuthenticationService(baseDirectory.absolutePath, null, null) private var currentHomeserver = MutableStateFlow(null) override fun isLoggedIn(): Flow { diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/di/MatrixModule.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/di/MatrixModule.kt deleted file mode 100644 index c6919e78d5..0000000000 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/di/MatrixModule.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2023 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 io.element.android.libraries.matrix.impl.di - -import com.squareup.anvil.annotations.ContributesTo -import dagger.Module -import dagger.Provides -import io.element.android.libraries.di.AppScope -import io.element.android.libraries.di.SingleIn -import org.matrix.rustcomponents.sdk.AuthenticationService -import java.io.File - -@Module -@ContributesTo(AppScope::class) -object MatrixModule { - - @Provides - @SingleIn(AppScope::class) - fun providesRustAuthenticationService(baseDirectory: File): AuthenticationService { - return AuthenticationService(baseDirectory.absolutePath, null, null) - } -} diff --git a/samples/minimal/build.gradle.kts b/samples/minimal/build.gradle.kts index 6e2a1ff5aa..47f5675a07 100644 --- a/samples/minimal/build.gradle.kts +++ b/samples/minimal/build.gradle.kts @@ -57,6 +57,5 @@ dependencies { implementation(projects.features.roomlist.impl) implementation(projects.features.login.impl) implementation(libs.coroutines.core) - implementation(libs.matrix.sdk) coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.2") } diff --git a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt index 53d4999934..cbd0e9839e 100644 --- a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt +++ b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt @@ -33,7 +33,6 @@ import io.element.android.libraries.matrix.api.auth.MatrixAuthenticationService import io.element.android.libraries.matrix.impl.auth.RustMatrixAuthenticationService import io.element.android.libraries.sessionstorage.impl.memory.InMemorySessionStore import kotlinx.coroutines.runBlocking -import org.matrix.rustcomponents.sdk.AuthenticationService import java.io.File class MainActivity : ComponentActivity() { @@ -46,7 +45,6 @@ class MainActivity : ComponentActivity() { coroutineScope = Singleton.appScope, coroutineDispatchers = Singleton.coroutineDispatchers, sessionStore = InMemorySessionStore(), - authService = AuthenticationService(baseDirectory.absolutePath, null, null), ) }