Add toggle for debug logging (#745)
This commit is contained in:
parent
f89d5c282f
commit
8cada17bcb
5 changed files with 14 additions and 2 deletions
|
@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- Settings option to enable debug logging
|
||||
|
||||
### Changed
|
||||
- SSH Keygen UI was improved
|
||||
- Default key length for SSH Keygen is now 4096 bits
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -367,4 +367,6 @@
|
|||
<string name="autofill_onboarding_dialog_title">New, revamped Autofill!</string>
|
||||
<string name="autofill_onboarding_dialog_message">In this release, Autofill support has been massively improved with advanced features like anti-phishing protection and enhanced reliability. If you have been holding out on using it because of the shortcomings on the previous version, you\'ll likely love the new iteration. Give it a shot!</string>
|
||||
<string name="snackbar_action_grant">Grant</string>
|
||||
<string name="pref_debug_logging_summary">Enable debug logging (requires app restart)</string>
|
||||
<string name="pref_debug_logging_title">Debug logging</string>
|
||||
</resources>
|
||||
|
|
|
@ -172,6 +172,11 @@
|
|||
app:key="clear_clipboard_20x"
|
||||
app:summary="@string/pref_clear_clipboard_hint"
|
||||
app:title="@string/pref_clear_clipboard_title" />
|
||||
<CheckBoxPreference
|
||||
app:defaultValue="false"
|
||||
app:key="enable_debug_logging"
|
||||
app:summary="@string/pref_debug_logging_summary"
|
||||
app:title="@string/pref_debug_logging_title" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory>
|
||||
|
|
Loading…
Reference in a new issue