Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit a04d6fa

Browse files
authored
fix: temporarily disable pre-launch biometric auth (#2803)
* fix: temporarily disable pre-launch biometric auth Completely broken right now and prevents users from opening the app. Updates #2802 * fix: disable UnusedResources lint
1 parent d00626d commit a04d6fa

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ class LaunchActivity : AppCompatActivity() {
2525
override fun onCreate(savedInstanceState: Bundle?) {
2626
super.onCreate(savedInstanceState)
2727
val prefs = sharedPrefs
28-
if (prefs.getBoolean(PreferenceKeys.BIOMETRIC_AUTH, false)) {
28+
if (prefs.getBoolean(PreferenceKeys.BIOMETRIC_AUTH_2, false)) {
2929
BiometricAuthenticator.authenticate(this) { result ->
3030
when (result) {
3131
is Result.Success -> {
3232
startTargetActivity(false)
3333
}
3434
is Result.HardwareUnavailableOrDisabled -> {
35-
prefs.edit { remove(PreferenceKeys.BIOMETRIC_AUTH) }
35+
prefs.edit { remove(PreferenceKeys.BIOMETRIC_AUTH_2) }
3636
startTargetActivity(false)
3737
}
3838
is Result.Failure,

app/src/main/java/app/passwordstore/ui/settings/GeneralSettings.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ class GeneralSettings(private val activity: FragmentActivity) : SettingsProvider
6565
defaultValue = false
6666
}
6767

68-
val canAuthenticate = BiometricAuthenticator.canAuthenticate(activity)
69-
switch(PreferenceKeys.BIOMETRIC_AUTH) {
68+
// val canAuthenticate = BiometricAuthenticator.canAuthenticate(activity)
69+
switch(PreferenceKeys.BIOMETRIC_AUTH_2) {
7070
titleRes = R.string.pref_biometric_auth_title
7171
defaultValue = false
72-
enabled = canAuthenticate
73-
summaryRes =
74-
if (canAuthenticate) R.string.pref_biometric_auth_summary
75-
else R.string.pref_biometric_auth_summary_error
72+
enabled = false
73+
// summaryRes =
74+
// if (canAuthenticate) R.string.pref_biometric_auth_summary
75+
// else R.string.pref_biometric_auth_summary_error
76+
summary = "Temporarily disabled due to a bug, see issue 2802"
7677
onClick {
7778
enabled = false
7879
val isChecked = checked
@@ -81,15 +82,15 @@ class GeneralSettings(private val activity: FragmentActivity) : SettingsProvider
8182
when (result) {
8283
is Result.Success -> {
8384
// Apply the changes
84-
putBoolean(PreferenceKeys.BIOMETRIC_AUTH, checked)
85+
putBoolean(PreferenceKeys.BIOMETRIC_AUTH_2, checked)
8586
enabled = true
8687
}
8788
is Result.Retry -> {}
8889
else -> {
8990
// If any error occurs, revert back to the previous
9091
// state. This
9192
// catch-all clause includes the cancellation case.
92-
putBoolean(PreferenceKeys.BIOMETRIC_AUTH, !checked)
93+
putBoolean(PreferenceKeys.BIOMETRIC_AUTH_2, !checked)
9394
checked = !isChecked
9495
enabled = true
9596
}

app/src/main/java/app/passwordstore/util/settings/PreferenceKeys.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ object PreferenceKeys {
1010
const val APP_THEME = "app_theme"
1111
const val AUTOFILL_ENABLE = "autofill_enable"
1212
const val BIOMETRIC_AUTH = "biometric_auth"
13+
const val BIOMETRIC_AUTH_2 = "biometric_auth_delete_soon_please"
1314
@Deprecated(
1415
message = "Use CLEAR_CLIPBOARD_HISTORY instead",
1516
replaceWith = ReplaceWith("PreferenceKeys.CLEAR_CLIPBOARD_HISTORY"),

build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ object LintConfig {
4040
disable += "FragmentFieldInjection"
4141
// Too pedantic
4242
disable += "ArgInFormattedQuantityStringRes"
43+
// Biometric strings are temporarily unused due to issue 2802
44+
disable += "UnusedResources"
4345
}
4446
baseline = project.file("lint-baseline.xml")
4547
}

0 commit comments

Comments
 (0)