File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
app/src/main/java/com/ladsers/passtable/android Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ class TableActivity : AppCompatActivity() {
250250 biometricAuth.activateAuth(primaryPassword)
251251 else loginCompleted()
252252 }
253- 3 -> primaryPasswordDlg.show(PrimaryPasswordDlg .Mode .OPEN , incorrectPassword = true )
253+ - 2 , 3 -> primaryPasswordDlg.show(PrimaryPasswordDlg .Mode .OPEN , incorrectPassword = true )
254254 }
255255 }
256256
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class BackupManager(private val context: Context) {
2020 context.deleteFile(it)
2121 } ? : let {
2222 val backups = context.fileList().filter { it.startsWith(backupMarker) }
23- if (backups.size >= fileLimit) deleteFirst()
23+ if (backups.size >= fileLimit) deleteFirst(backups )
2424 }
2525
2626 val timestamp = System .currentTimeMillis() / 1000 // accuracy in seconds is enough
@@ -52,10 +52,9 @@ class BackupManager(private val context: Context) {
5252 private fun find (path : String ) = context.fileList()
5353 .find { s -> s.contains(path) } // contains() is needed not only to discard the timestamp, but also to search for part of the path.
5454
55- private fun deleteFirst () {
56- val list = context.fileList()
57- val timestamps = list.map { s -> s.split(' _' )[0 ].drop(backupMarker.length).toInt() }
58- val map = timestamps.zip(list).toMap().toSortedMap()
55+ private fun deleteFirst (backups : List <String >) {
56+ val timestamps = backups.map { s -> s.split(' _' )[0 ].drop(backupMarker.length).toInt() }
57+ val map = timestamps.zip(backups).toMap().toSortedMap()
5958
6059 context.deleteFile(map[map.firstKey()])
6160 }
Original file line number Diff line number Diff line change @@ -92,11 +92,9 @@ class BiometricAuth(
9292 }
9393
9494 fun checkAvailability (): Boolean {
95- val biometricManager = BiometricManager .from(context)
96- return biometricManager.canAuthenticate(
97- BiometricManager .Authenticators .BIOMETRIC_STRONG or
98- BiometricManager .Authenticators .DEVICE_CREDENTIAL
99- ) == BiometricManager .BIOMETRIC_SUCCESS
95+ val checkResult = BiometricManager .from(context)
96+ .canAuthenticate(BiometricManager .Authenticators .BIOMETRIC_STRONG )
97+ return checkResult == BiometricManager .BIOMETRIC_SUCCESS
10098 }
10199
102100 fun resetAuth () {
You can’t perform that action at this time.
0 commit comments