forked from github/wulkanowy-mirror
Bump chucker from 2.0.4 to 3.1.1 (#733)
This commit is contained in:
parent
95a833ea85
commit
0320079d02
@ -113,7 +113,8 @@ ext {
|
||||
work_manager = "2.3.4"
|
||||
room = "2.2.5"
|
||||
dagger = "2.27"
|
||||
chucker = "2.0.4"
|
||||
// don't update https://github.com/ChuckerTeam/chucker/issues/242
|
||||
chucker = "3.1.1"
|
||||
mockk = "1.9.2"
|
||||
}
|
||||
|
||||
@ -122,7 +123,7 @@ configurations.all {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "io.github.wulkanowy:sdk:85d47f6"
|
||||
implementation "io.github.wulkanowy:sdk:be7ed9c"
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation "androidx.core:core-ktx:1.2.0"
|
||||
@ -182,9 +183,9 @@ dependencies {
|
||||
playImplementation "com.google.firebase:firebase-core:17.2.3"
|
||||
playImplementation "com.crashlytics.sdk.android:crashlytics:2.10.1"
|
||||
|
||||
releaseImplementation "fr.o80.chucker:library-no-op:$chucker"
|
||||
releaseImplementation "com.github.ChuckerTeam.Chucker:library-no-op:$chucker"
|
||||
|
||||
debugImplementation "fr.o80.chucker:library:$chucker"
|
||||
debugImplementation "com.github.ChuckerTeam.Chucker:library:$chucker"
|
||||
debugImplementation "com.amitshekhar.android:debug-db:1.0.6"
|
||||
|
||||
testImplementation "junit:junit:4.13"
|
||||
|
4
app/src/debug/res/values/preferences_defaults.xml
Normal file
4
app/src/debug/res/values/preferences_defaults.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
||||
|
||||
<bool name="pref_default_notification_debug">true</bool>
|
||||
</resources>
|
@ -7,9 +7,9 @@ import android.content.res.Resources
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.github.pwittchen.reactivenetwork.library.rx2.internet.observing.InternetObservingSettings
|
||||
import com.github.pwittchen.reactivenetwork.library.rx2.internet.observing.strategy.WalledGardenInternetObservingStrategy
|
||||
import com.readystatesoftware.chuck.api.ChuckCollector
|
||||
import com.readystatesoftware.chuck.api.ChuckInterceptor
|
||||
import com.readystatesoftware.chuck.api.RetentionManager
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerInterceptor
|
||||
import com.chuckerteam.chucker.api.RetentionManager
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import io.github.wulkanowy.data.db.AppDatabase
|
||||
@ -32,23 +32,25 @@ internal class RepositoryModule {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
fun provideSdk(chuckCollector: ChuckCollector, context: Context): Sdk {
|
||||
fun provideSdk(chuckerCollector: ChuckerCollector, context: Context): Sdk {
|
||||
return Sdk().apply {
|
||||
androidVersion = android.os.Build.VERSION.RELEASE
|
||||
buildTag = android.os.Build.MODEL
|
||||
setSimpleHttpLogger { Timber.d(it) }
|
||||
|
||||
// for debug only
|
||||
addInterceptor(ChuckInterceptor(context, chuckCollector).maxContentLength(250000L), true)
|
||||
addInterceptor(ChuckerInterceptor(context, chuckerCollector), true)
|
||||
}
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
fun provideChuckCollector(context: Context, prefRepository: PreferencesRepository): ChuckCollector {
|
||||
return ChuckCollector(context)
|
||||
.showNotification(prefRepository.isDebugNotificationEnable)
|
||||
.retentionManager(RetentionManager(context, ChuckCollector.Period.ONE_HOUR))
|
||||
fun provideChuckerCollector(context: Context, prefRepository: PreferencesRepository): ChuckerCollector {
|
||||
return ChuckerCollector(
|
||||
context = context,
|
||||
showNotification = prefRepository.isDebugNotificationEnable,
|
||||
retentionPeriod = RetentionManager.Period.ONE_HOUR
|
||||
)
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.github.wulkanowy.ui.base
|
||||
|
||||
import android.content.res.Resources
|
||||
import com.readystatesoftware.chuck.api.ChuckCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.data.exceptions.NoCurrentStudentException
|
||||
import io.github.wulkanowy.sdk.exception.BadCredentialsException
|
||||
@ -15,7 +15,7 @@ import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
import javax.inject.Inject
|
||||
|
||||
open class ErrorHandler @Inject constructor(protected val resources: Resources, private val chuckCollector: ChuckCollector) {
|
||||
open class ErrorHandler @Inject constructor(protected val resources: Resources, private val chuckerCollector: ChuckerCollector) {
|
||||
|
||||
var showErrorMessage: (String, Throwable) -> Unit = { _, _ -> }
|
||||
|
||||
@ -24,7 +24,7 @@ open class ErrorHandler @Inject constructor(protected val resources: Resources,
|
||||
var onNoCurrentStudent: () -> Unit = {}
|
||||
|
||||
fun dispatch(error: Throwable) {
|
||||
chuckCollector.onError(error.javaClass.simpleName, error)
|
||||
chuckerCollector.onError(error.javaClass.simpleName, error)
|
||||
Timber.e(error, "An exception occurred while the Wulkanowy was running")
|
||||
proceed(error)
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package io.github.wulkanowy.ui.modules.login
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.database.sqlite.SQLiteConstraintException
|
||||
import com.readystatesoftware.chuck.api.ChuckCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.sdk.exception.BadCredentialsException
|
||||
import io.github.wulkanowy.sdk.mobile.exception.InvalidPinException
|
||||
@ -14,8 +14,8 @@ import javax.inject.Inject
|
||||
|
||||
class LoginErrorHandler @Inject constructor(
|
||||
resources: Resources,
|
||||
chuckCollector: ChuckCollector
|
||||
) : ErrorHandler(resources, chuckCollector) {
|
||||
chuckerCollector: ChuckerCollector
|
||||
) : ErrorHandler(resources, chuckerCollector) {
|
||||
|
||||
var onBadCredentials: () -> Unit = {}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.github.wulkanowy.ui.modules.login.recover
|
||||
|
||||
import android.content.res.Resources
|
||||
import com.readystatesoftware.chuck.api.ChuckCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.InvalidCaptchaException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.InvalidEmailException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.NoAccountFoundException
|
||||
@ -10,8 +10,8 @@ import javax.inject.Inject
|
||||
|
||||
class RecoverErrorHandler @Inject constructor(
|
||||
resources: Resources,
|
||||
chuckCollector: ChuckCollector
|
||||
) : ErrorHandler(resources, chuckCollector) {
|
||||
chuckerCollector: ChuckerCollector
|
||||
) : ErrorHandler(resources, chuckerCollector) {
|
||||
|
||||
var onInvalidUsername: (String) -> Unit = {}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.github.wulkanowy.ui.modules.settings
|
||||
|
||||
import com.readystatesoftware.chuck.api.ChuckCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import io.github.wulkanowy.data.repositories.preferences.PreferencesRepository
|
||||
import io.github.wulkanowy.data.repositories.student.StudentRepository
|
||||
import io.github.wulkanowy.services.sync.SyncManager
|
||||
@ -21,7 +21,7 @@ class SettingsPresenter @Inject constructor(
|
||||
private val preferencesRepository: PreferencesRepository,
|
||||
private val analytics: FirebaseAnalyticsHelper,
|
||||
private val syncManager: SyncManager,
|
||||
private val chuckCollector: ChuckCollector,
|
||||
private val chuckerCollector: ChuckerCollector,
|
||||
private val appInfo: AppInfo
|
||||
) : BasePresenter<SettingsView>(errorHandler, studentRepository, schedulers) {
|
||||
|
||||
@ -38,7 +38,7 @@ class SettingsPresenter @Inject constructor(
|
||||
when (key) {
|
||||
serviceEnableKey -> with(syncManager) { if (isServiceEnabled) startSyncWorker() else stopSyncWorker() }
|
||||
servicesIntervalKey, servicesOnlyWifiKey -> syncManager.startSyncWorker(true)
|
||||
isDebugNotificationEnableKey -> chuckCollector.showNotification(isDebugNotificationEnable)
|
||||
isDebugNotificationEnableKey -> chuckerCollector.showNotification = isDebugNotificationEnable
|
||||
appThemeKey -> view?.recreateView()
|
||||
appLanguageKey -> view?.run {
|
||||
updateLanguage(if (appLanguage == "system") appInfo.systemLanguage else appLanguage)
|
||||
|
@ -1,15 +1,15 @@
|
||||
package io.github.wulkanowy.ui.modules.timetable.completed
|
||||
|
||||
import android.content.res.Resources
|
||||
import com.readystatesoftware.chuck.api.ChuckCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import io.github.wulkanowy.sdk.exception.FeatureDisabledException
|
||||
import io.github.wulkanowy.ui.base.ErrorHandler
|
||||
import javax.inject.Inject
|
||||
|
||||
class CompletedLessonsErrorHandler @Inject constructor(
|
||||
resources: Resources,
|
||||
chuckCollector: ChuckCollector
|
||||
) : ErrorHandler(resources, chuckCollector) {
|
||||
chuckerCollector: ChuckerCollector
|
||||
) : ErrorHandler(resources, chuckerCollector) {
|
||||
|
||||
var onFeatureDisabled: () -> Unit = {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user