Skip to content

Commit 9aa653f

Browse files
KKS161994iamareebjamal
authored andcommitted
chore: Add Stetho Debug Bridge (#2371)
1 parent 3f50e82 commit 9aa653f

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

app/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,12 @@ dependencies {
181181
//Smart LOck authentication
182182
implementation "com.google.android.gms:play-services-auth:${rootConfiguration.playServiceAuthVersion}"
183183
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${rootConfiguration.kotlinVersion}"
184+
185+
//Stetho
186+
debugImplementation "com.facebook.stetho:stetho:${rootConfiguration.stethoVersion}"
187+
188+
//Stetho network helper
189+
debugImplementation "com.facebook.stetho:stetho-okhttp3:${rootConfiguration.stethoVersion}"
190+
191+
releaseImplementation "com.github.iamareebjamal:stetho-noop:1.1"
184192
}

app/config.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ ext {
2525
mockitoCoreVersion = '1.10.19'
2626
playServiceAuthVersion='16.0.1'
2727
shimmerVersion = "0.5.0"
28+
stethoVersion = "1.5.1"
2829
}

app/src/main/java/org/fossasia/susi/ai/MainApplication.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44
import android.app.Application
55
import android.support.v7.app.AppCompatDelegate
66
import android.util.Log
7+
import com.facebook.stetho.Stetho
78

89
import com.squareup.leakcanary.LeakCanary
910

@@ -50,6 +51,8 @@ class MainApplication : Application() {
5051
// Release mode
5152
Timber.plant(ReleaseLogTree())
5253
}
54+
55+
Stetho.initializeWithDefaults(this)
5356
}
5457

5558
private class ReleaseLogTree : Timber.Tree() {

app/src/main/java/org/fossasia/susi/ai/rest/ClientBuilder.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.fossasia.susi.ai.rest
22

3+
import com.facebook.stetho.okhttp3.StethoInterceptor
34
import okhttp3.OkHttpClient
45
import okhttp3.logging.HttpLoggingInterceptor
56
import org.fossasia.susi.ai.dataclasses.ReportSkillQuery
@@ -32,7 +33,8 @@ object ClientBuilder {
3233
// Must maintain the order of interceptors here, logging needs to be last.
3334
httpClient.addInterceptor(TokenInterceptor())
3435
httpClient.addInterceptor(logging)
35-
36+
// Stetho for network monitoring
37+
httpClient.addNetworkInterceptor(StethoInterceptor())
3638
Retrofit.Builder()
3739
.baseUrl(PrefManager.susiRunningBaseUrl)
3840
.addConverterFactory(GsonConverterFactory.create())

0 commit comments

Comments
 (0)