diff options
author | Harsh Shandilya <msfjarvis@gmail.com> | 2020-04-25 20:34:33 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 20:34:33 +0530 |
commit | 8cada17bcbcc5443062153542241dbe0d2a836ee (patch) | |
tree | e32810f2283f86da8ce85bb956a9339f07e5fb25 /app/src/main/java | |
parent | f89d5c282faf34234440a89d1765ac43baa54be9 (diff) |
Add toggle for debug logging (#745)
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/Application.kt | 4 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/Application.kt b/app/src/main/java/com/zeapo/pwdstore/Application.kt index 506fff9d..341a6fe3 100644 --- a/app/src/main/java/com/zeapo/pwdstore/Application.kt +++ b/app/src/main/java/com/zeapo/pwdstore/Application.kt @@ -21,11 +21,11 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere override fun onCreate() { super.onCreate() - if (BuildConfig.ENABLE_DEBUG_FEATURES) { + prefs = PreferenceManager.getDefaultSharedPreferences(this) + if (BuildConfig.ENABLE_DEBUG_FEATURES || prefs?.getBoolean("enable_debug_logging", false) == true) { plant(DebugTree()) WhatTheStack(this).init() } - prefs = PreferenceManager.getDefaultSharedPreferences(this) prefs?.registerOnSharedPreferenceChangeListener(this) setNightMode() } diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index 67a9bc2d..869ee05b 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -282,6 +282,8 @@ class UserPreference : AppCompatActivity() { getString(R.string.pref_clipboard_timeout_summary, sharedPreferences.getString("general_show_time", "45")) } + findPreference<CheckBoxPreference>("enable_debug_logging")?.isVisible = !BuildConfig.ENABLE_DEBUG_FEATURES + findPreference<CheckBoxPreference>("biometric_auth")?.apply { val isFingerprintSupported = BiometricManager.from(requireContext()).canAuthenticate() == BiometricManager.BIOMETRIC_SUCCESS if (!isFingerprintSupported) { |