Skip to content

Commit

Permalink
Merge branch 'release/2.10.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Jamet committed Jun 14, 2021
2 parents d476574 + 9887b81 commit d6a43fd
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 60 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
KeePassDX(2.10.3)
* Improve Magikeyboard options description #1022 #1023 (Thx @djibux)
* Fix database opened without notification (database is now closed when screen is killed in background #1025)
* Fix biometric prompt #1018

KeePassDX(2.10.2)
* Fix search fields references #987
* Fix Auto-Types with same key #997
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.kunzisoft.keepass"
minSdkVersion 15
targetSdkVersion 30
versionCode = 80
versionName = "2.10.2"
versionCode = 81
versionName = "2.10.3"
multiDexEnabled true

testApplicationId = "com.kunzisoft.keepass.tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ open class PasswordActivity : SpecialModeActivity(), AdvancedUnlockFragment.Buil
override fun onPause() {
mProgressDatabaseTaskProvider?.unregisterProgressTask()

// To prevent biometric prompt to appearing outside of the app
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
advancedUnlockFragment?.disconnect(hideViews = false, closePrompt = true)
}

// Reinit locking activity UI variable
LockingActivity.LOCKING_ACTIVITY_UI_VISIBLE_DURING_LOCK = null
mAllowAutoOpenBiometricPrompt = true
Expand Down Expand Up @@ -708,7 +713,7 @@ open class PasswordActivity : SpecialModeActivity(), AdvancedUnlockFragment.Buil
when (resultCode) {
LockingActivity.RESULT_EXIT_LOCK -> {
clearCredentialsViews()
Database.getInstance().clearAndClose(UriUtil.getBinaryDir(this))
Database.getInstance().clearAndClose(this)
}
Activity.RESULT_CANCELED -> {
clearCredentialsViews()
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/kunzisoft/keepass/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package com.kunzisoft.keepass.app
import androidx.multidex.MultiDexApplication
import com.kunzisoft.keepass.activities.stylish.Stylish
import com.kunzisoft.keepass.database.element.Database
import com.kunzisoft.keepass.utils.UriUtil

class App : MultiDexApplication() {

Expand All @@ -34,7 +33,7 @@ class App : MultiDexApplication() {
}

override fun onTerminate() {
Database.getInstance().clearAndClose(UriUtil.getBinaryDir(this))
Database.getInstance().clearAndClose(this)
super.onTerminate()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import com.kunzisoft.keepass.app.database.FileDatabaseHistoryAction
import com.kunzisoft.keepass.database.element.Database
import com.kunzisoft.keepass.model.MainCredential
import com.kunzisoft.keepass.settings.PreferencesUtil
import com.kunzisoft.keepass.utils.UriUtil

class CreateDatabaseRunnable(context: Context,
private val mDatabase: Database,
Expand All @@ -44,7 +43,7 @@ class CreateDatabaseRunnable(context: Context,
createData(mDatabaseUri, databaseName, rootName)
}
} catch (e: Exception) {
mDatabase.clearAndClose(UriUtil.getBinaryDir(context))
mDatabase.clearAndClose(context)
setError(e)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import com.kunzisoft.keepass.app.database.CipherDatabaseAction
import com.kunzisoft.keepass.app.database.CipherDatabaseEntity
import com.kunzisoft.keepass.app.database.FileDatabaseHistoryAction
import com.kunzisoft.keepass.database.element.Database
import com.kunzisoft.keepass.database.element.binary.LoadedKey
import com.kunzisoft.keepass.database.element.binary.BinaryData
import com.kunzisoft.keepass.database.element.binary.LoadedKey
import com.kunzisoft.keepass.database.exception.LoadDatabaseException
import com.kunzisoft.keepass.model.MainCredential
import com.kunzisoft.keepass.settings.PreferencesUtil
Expand All @@ -47,7 +47,7 @@ class LoadDatabaseRunnable(private val context: Context,

override fun onStartRun() {
// Clear before we load
mDatabase.clearAndClose(UriUtil.getBinaryDir(context))
mDatabase.clearAndClose(context)
}

override fun onActionRun() {
Expand Down Expand Up @@ -85,7 +85,7 @@ class LoadDatabaseRunnable(private val context: Context,
// Register the current time to init the lock timer
PreferencesUtil.saveCurrentTime(context)
} else {
mDatabase.clearAndClose(UriUtil.getBinaryDir(context))
mDatabase.clearAndClose(context)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import android.content.*
import android.content.Context.BIND_ABOVE_CLIENT
import android.content.Context.BIND_NOT_FOREGROUND
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.IBinder
import android.util.Log
Expand Down Expand Up @@ -255,7 +256,6 @@ class ProgressDatabaseTaskProvider(private val activity: FragmentActivity) {

private fun start(bundle: Bundle? = null, actionTask: String) {
try {
activity.stopService(intentDatabaseTask)
if (bundle != null)
intentDatabaseTask.putExtras(bundle)
intentDatabaseTask.action = actionTask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package com.kunzisoft.keepass.database.action

import android.content.Context
import com.kunzisoft.keepass.database.element.Database
import com.kunzisoft.keepass.database.element.binary.LoadedKey
import com.kunzisoft.keepass.database.element.binary.BinaryData
import com.kunzisoft.keepass.database.element.binary.LoadedKey
import com.kunzisoft.keepass.database.exception.LoadDatabaseException
import com.kunzisoft.keepass.settings.PreferencesUtil
import com.kunzisoft.keepass.tasks.ActionRunnable
Expand Down Expand Up @@ -62,7 +62,7 @@ class ReloadDatabaseRunnable(private val context: Context,
PreferencesUtil.saveCurrentTime(context)
} else {
tempCipherKey = null
mDatabase.clearAndClose(UriUtil.getBinaryDir(context))
mDatabase.clearAndClose(context)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package com.kunzisoft.keepass.database.element

import android.content.ContentResolver
import android.content.Context
import android.content.res.Resources
import android.net.Uri
import android.util.Log
Expand Down Expand Up @@ -668,8 +669,8 @@ class Database {
}
}

fun clearAndClose(filesDirectory: File? = null) {
clear(filesDirectory)
fun clearAndClose(context: Context? = null) {
clear(context?.let { UriUtil.getBinaryDir(context) })
this.mDatabaseKDB = null
this.mDatabaseKDBX = null
this.fileUri = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
*/
package com.kunzisoft.keepass.services

import android.app.ActivityManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.*
Expand All @@ -44,10 +46,7 @@ import com.kunzisoft.keepass.model.SnapFileDatabaseInfo
import com.kunzisoft.keepass.tasks.ActionRunnable
import com.kunzisoft.keepass.tasks.ProgressTaskUpdater
import com.kunzisoft.keepass.timeout.TimeoutHelper
import com.kunzisoft.keepass.utils.DATABASE_START_TASK_ACTION
import com.kunzisoft.keepass.utils.DATABASE_STOP_TASK_ACTION
import com.kunzisoft.keepass.utils.LOCK_ACTION
import com.kunzisoft.keepass.utils.closeDatabase
import com.kunzisoft.keepass.utils.*
import com.kunzisoft.keepass.viewmodels.FileDatabaseInfo
import kotlinx.coroutines.*
import java.util.*
Expand Down Expand Up @@ -840,6 +839,12 @@ open class DatabaseTaskNotificationService : LockNotificationService(), Progress
}
}

override fun onDestroy() {
super.onDestroy()
if (mDatabase.loaded)
actionOnLock()
}

companion object {

private val TAG = DatabaseTaskNotificationService::class.java.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ fun Context.closeDatabase() {
cancelAll()
}
// Clear data
Database.getInstance().clearAndClose(UriUtil.getBinaryDir(this))
Database.getInstance().clearAndClose(this)
}
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
<string name="enable_read_only_title">Schreibgeschützt</string>
<string name="education_read_only_title">Schreibschutz der Datenbank aktivieren</string>
<string name="enable_read_only_summary">Datenbank standardmäßig schreibgeschützt öffnen</string>
<string name="education_read_only_summary">Den Öffnungsmodus für die Sitzung ändern.
<string name="education_read_only_summary">Den Modus bei Eröffnung der Sitzung ändern.
\n
\n„Schreibgeschützt“ verhindert unbeabsichtigte Änderungen an der Datenbank.
\nMit „Änderbar“ können Sie alle Elemente nach Belieben hinzufügen, löschen oder ändern.</string>
Expand Down
Loading

0 comments on commit d6a43fd

Please sign in to comment.