Add toggle for debug logging (#745)

This commit is contained in:
Harsh Shandilya 2020-04-25 20:34:33 +05:30 committed by GitHub
parent f89d5c282f
commit 8cada17bcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 2 deletions

View file

@ -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

View file

@ -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()
}

View file

@ -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) {

View file

@ -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>

View file

@ -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>