From 531aa22c8880a19b29b8b08fe49fa92ca1eff44c Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sat, 24 Nov 2018 14:04:45 +0200 Subject: [PATCH] OkHttpProfiler --- app/build.gradle | 1 + app/src/main/assets/apache_libraries.html | 3 +++ app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index d36a6fee..d414755a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -89,6 +89,7 @@ dependencies { implementation "ru.noties:markwon:2.0.0" implementation 'net.gotev:uploadservice:3.4.2' implementation 'net.gotev:uploadservice-okhttp:3.4.2' + debugImplementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.4' //Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler } apply plugin: 'com.google.gms.google-services' diff --git a/app/src/main/assets/apache_libraries.html b/app/src/main/assets/apache_libraries.html index 360546d4..b0e33882 100644 --- a/app/src/main/assets/apache_libraries.html +++ b/app/src/main/assets/apache_libraries.html @@ -71,6 +71,9 @@
  • Grgit v3.0.0 (Copyright ©2018 Andrew Oberstar)
  • +
  • +
    OkHttpProfiler v1.0.4
    +
  • diff --git a/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java b/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java index 42e907b8..02984c53 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java +++ b/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java @@ -16,6 +16,7 @@ import com.franmontiel.persistentcookiejar.PersistentCookieJar; import com.franmontiel.persistentcookiejar.cache.SetCookieCache; import com.franmontiel.persistentcookiejar.persistence.SharedPrefsCookiePersistor; import com.google.firebase.analytics.FirebaseAnalytics; +import com.itkacher.okhttpprofiler.OkHttpProfilerInterceptor; import com.jakewharton.picasso.OkHttp3Downloader; import com.mikepenz.fontawesome_typeface_library.FontAwesome; import com.mikepenz.iconics.IconicsDrawable; @@ -125,6 +126,9 @@ public class BaseApplication extends Application { builder.connectionSpecs(Arrays.asList(legacyTls, ConnectionSpec.CLEARTEXT)); } + if (BuildConfig.DEBUG) + builder.addInterceptor(new OkHttpProfilerInterceptor()); + client = builder.build(); sessionManager = new SessionManager(client, cookieJar, sharedPrefsCookiePersistor, sharedPrefs, draftsPrefs);