@@ -7,14 +7,14 @@ package app.passwordstore
7
7
import android.content.SharedPreferences
8
8
import android.os.Build
9
9
import android.os.StrictMode
10
- import androidx.appcompat.app.AppCompatDelegate
11
10
import androidx.appcompat.app.AppCompatDelegate.*
12
11
import app.passwordstore.injection.context.FilesDirPath
13
12
import app.passwordstore.injection.prefs.SettingsPreferences
14
13
import app.passwordstore.util.extensions.getString
15
14
import app.passwordstore.util.features.Feature
16
15
import app.passwordstore.util.features.Features
17
16
import app.passwordstore.util.git.sshj.setUpBouncyCastleForSshj
17
+ import app.passwordstore.util.leaks.SentryLeakUploader
18
18
import app.passwordstore.util.proxy.ProxyUtils
19
19
import app.passwordstore.util.settings.GitSettings
20
20
import app.passwordstore.util.settings.PreferenceKeys
@@ -25,6 +25,8 @@ import io.sentry.Sentry
25
25
import io.sentry.protocol.User
26
26
import java.util.concurrent.Executors
27
27
import javax.inject.Inject
28
+ import leakcanary.AppWatcher
29
+ import leakcanary.LeakCanary
28
30
import logcat.AndroidLogcatLogger
29
31
import logcat.LogPriority.DEBUG
30
32
import logcat.LogPriority.VERBOSE
@@ -44,11 +46,14 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere
44
46
override fun onCreate () {
45
47
super .onCreate()
46
48
instance = this
49
+ LeakCanary .config =
50
+ LeakCanary .config.copy(eventListeners = LeakCanary .config.eventListeners + SentryLeakUploader )
47
51
if (
48
52
BuildConfig .ENABLE_DEBUG_FEATURES ||
49
53
prefs.getBoolean(PreferenceKeys .ENABLE_DEBUG_LOGGING , false )
50
54
) {
51
55
LogcatLogger .install(AndroidLogcatLogger (DEBUG ))
56
+ AppWatcher .manualInstall(this )
52
57
setVmPolicy()
53
58
}
54
59
prefs.registerOnSharedPreferenceChangeListener(this )
@@ -117,7 +122,7 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere
117
122
}
118
123
119
124
private fun setNightMode () {
120
- AppCompatDelegate . setDefaultNightMode(
125
+ setDefaultNightMode(
121
126
when (prefs.getString(PreferenceKeys .APP_THEME ) ? : getString(R .string.app_theme_def)) {
122
127
" light" -> MODE_NIGHT_NO
123
128
" dark" -> MODE_NIGHT_YES
0 commit comments