diff --git a/app/build.gradle b/app/build.gradle index c5850ece..b569a182 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -76,6 +76,7 @@ dependencies { implementation 'com.jakewharton.threetenabp:threetenabp:1.1.1' implementation 'com.jakewharton.timber:timber:4.7.1' + implementation 'com.facebook.stetho:stetho:1.5.0' // rx implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0' diff --git a/app/src/main/java/im/vector/riotredesign/Riot.kt b/app/src/main/java/im/vector/riotredesign/Riot.kt index 8f589d2f..8385443c 100644 --- a/app/src/main/java/im/vector/riotredesign/Riot.kt +++ b/app/src/main/java/im/vector/riotredesign/Riot.kt @@ -19,6 +19,7 @@ package im.vector.riotredesign import android.app.Application import android.content.Context import androidx.multidex.MultiDex +import com.facebook.stetho.Stetho import com.jakewharton.threetenabp.AndroidThreeTen import im.vector.matrix.android.BuildConfig import im.vector.riotredesign.core.di.AppModule @@ -33,6 +34,7 @@ class Riot : Application() { super.onCreate() if (BuildConfig.DEBUG) { Timber.plant(Timber.DebugTree()) + Stetho.initializeWithDefaults(this) } AndroidThreeTen.init(this) startKoin(listOf(AppModule(this).definition), logger = EmptyLogger()) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 612f0f7b..5d87130f 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -95,6 +95,7 @@ dependencies { // Logging implementation 'com.jakewharton.timber:timber:4.7.1' + implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0' debugImplementation 'com.airbnb.okreplay:okreplay:1.4.0' releaseImplementation 'com.airbnb.okreplay:noop:1.4.0' diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/NetworkModule.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/NetworkModule.kt index d9abf791..e19c15da 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/NetworkModule.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/NetworkModule.kt @@ -16,6 +16,7 @@ package im.vector.matrix.android.internal.di +import com.facebook.stetho.okhttp3.StethoInterceptor import im.vector.matrix.android.internal.network.AccessTokenInterceptor import im.vector.matrix.android.internal.network.NetworkConnectivityChecker import im.vector.matrix.android.internal.network.UnitConverterFactory @@ -47,11 +48,16 @@ class NetworkModule { OkReplayInterceptor() } + single { + StethoInterceptor() + } + single { OkHttpClient.Builder() .connectTimeout(30, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) .writeTimeout(30, TimeUnit.SECONDS) + .addNetworkInterceptor(get()) .addInterceptor(get()) .addInterceptor(get()) .addInterceptor(get())