Remove chucker

pull/26/head
Koitharu 6 years ago
parent ff3ebbf1d9
commit fb60b26f08

@ -100,8 +100,6 @@ dependencies {
implementation 'com.tomclaw.cache:cache:1.0' implementation 'com.tomclaw.cache:cache:1.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5'
debugImplementation 'com.github.ChuckerTeam.Chucker:library:3.3.0'
releaseImplementation 'com.github.ChuckerTeam.Chucker:library-no-op:3.3.0'
testImplementation 'junit:junit:4.13.1' testImplementation 'junit:junit:4.13.1'
testImplementation 'org.json:json:20200518' testImplementation 'org.json:json:20200518'

@ -8,8 +8,6 @@ import coil.Coil
import coil.ComponentRegistry import coil.ComponentRegistry
import coil.ImageLoader import coil.ImageLoader
import coil.util.CoilUtils import coil.util.CoilUtils
import com.chuckerteam.chucker.api.ChuckerCollector
import com.chuckerteam.chucker.api.ChuckerInterceptor
import okhttp3.CookieJar import okhttp3.CookieJar
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import org.koin.android.ext.android.get import org.koin.android.ext.android.get
@ -39,10 +37,6 @@ import java.util.concurrent.TimeUnit
class KotatsuApp : Application() { class KotatsuApp : Application() {
private val chuckerCollector by lazy(LazyThreadSafetyMode.NONE) {
ChuckerCollector(applicationContext)
}
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
@ -65,9 +59,6 @@ class KotatsuApp : Application() {
initKoin() initKoin()
initCoil(get()) initCoil(get())
Thread.setDefaultUncaughtExceptionHandler(AppCrashHandler(applicationContext)) Thread.setDefaultUncaughtExceptionHandler(AppCrashHandler(applicationContext))
if (BuildConfig.DEBUG) {
initErrorHandler()
}
AppCompatDelegate.setDefaultNightMode(AppSettings(this).theme) AppCompatDelegate.setDefaultNightMode(AppSettings(this).theme)
val widgetUpdater = WidgetUpdater(applicationContext) val widgetUpdater = WidgetUpdater(applicationContext)
FavouritesRepository.subscribe(widgetUpdater) FavouritesRepository.subscribe(widgetUpdater)
@ -124,23 +115,12 @@ class KotatsuApp : Application() {
) )
} }
private fun initErrorHandler() {
val exceptionHandler = Thread.getDefaultUncaughtExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler { t, e ->
chuckerCollector.onError("CRASH", e)
exceptionHandler?.uncaughtException(t, e)
}
}
private fun okHttp(cookieJar: CookieJar) = OkHttpClient.Builder().apply { private fun okHttp(cookieJar: CookieJar) = OkHttpClient.Builder().apply {
connectTimeout(20, TimeUnit.SECONDS) connectTimeout(20, TimeUnit.SECONDS)
readTimeout(60, TimeUnit.SECONDS) readTimeout(60, TimeUnit.SECONDS)
writeTimeout(20, TimeUnit.SECONDS) writeTimeout(20, TimeUnit.SECONDS)
cookieJar(cookieJar) cookieJar(cookieJar)
addInterceptor(UserAgentInterceptor) addInterceptor(UserAgentInterceptor)
if (BuildConfig.DEBUG) {
addInterceptor(ChuckerInterceptor(applicationContext, collector = chuckerCollector))
}
} }
private fun mangaDb() = Room.databaseBuilder( private fun mangaDb() = Room.databaseBuilder(

Loading…
Cancel
Save