mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Merge branch 'release/2.8.1'
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
KeePassDX(2.8.1)
|
||||
* Capture exceptions in coroutines
|
||||
|
||||
KeePassDX(2.8)
|
||||
* Fix TOTP period (> 60s)
|
||||
* Fix searching in recycle bin
|
||||
|
||||
@@ -11,8 +11,8 @@ android {
|
||||
applicationId "com.kunzisoft.keepass"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 29
|
||||
versionCode = 36
|
||||
versionName = "2.8"
|
||||
versionCode = 37
|
||||
versionName = "2.8.1"
|
||||
multiDexEnabled true
|
||||
|
||||
testApplicationId = "com.kunzisoft.keepass.tests"
|
||||
|
||||
@@ -227,7 +227,7 @@ open class PasswordActivity : SpecialModeActivity() {
|
||||
if (resultMessage != null && resultMessage.isNotEmpty()) {
|
||||
resultError = "$resultError $resultMessage"
|
||||
}
|
||||
Log.e(TAG, resultError, resultException)
|
||||
Log.e(TAG, resultError)
|
||||
Snackbar.make(activity_password_coordinator_layout,
|
||||
resultError,
|
||||
Snackbar.LENGTH_LONG).asError().show()
|
||||
|
||||
@@ -380,10 +380,8 @@ class Database {
|
||||
loaded = true
|
||||
|
||||
} catch (e: LoadDatabaseException) {
|
||||
Log.e("KPD", "Database::loadData", e)
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
Log.e("KPD", "Database::loadData", e)
|
||||
throw FileNotFoundDatabaseException()
|
||||
} finally {
|
||||
keyFileInputStream?.close()
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.GroupActivity
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
@@ -47,11 +48,16 @@ class DatabaseOpenNotificationService: LockNotificationService() {
|
||||
super.actionOnLock()
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
super.onStartCommand(intent, flags, startId)
|
||||
private fun checkIntent(intent: Intent?) {
|
||||
val notificationBuilder = buildNewNotification().apply {
|
||||
setSmallIcon(R.drawable.notification_ic_database_open)
|
||||
setContentTitle(getString(R.string.database_opened))
|
||||
setAutoCancel(false)
|
||||
}
|
||||
|
||||
when(intent?.action) {
|
||||
ACTION_CLOSE_DATABASE -> {
|
||||
startForeground(notificationId, notificationBuilder.build())
|
||||
stopNotificationAndSendLock()
|
||||
}
|
||||
else -> {
|
||||
@@ -68,11 +74,8 @@ class DatabaseOpenNotificationService: LockNotificationService() {
|
||||
|
||||
val database = Database.getInstance()
|
||||
if (database.loaded) {
|
||||
startForeground(notificationId, buildNewNotification().apply {
|
||||
setSmallIcon(R.drawable.notification_ic_database_open)
|
||||
setContentTitle(getString(R.string.database_opened))
|
||||
startForeground(notificationId, notificationBuilder.apply {
|
||||
setContentText(database.name + " (" + database.version + ")")
|
||||
setAutoCancel(false)
|
||||
setContentIntent(pendingDatabaseIntent)
|
||||
// Unfortunately swipe is disabled in lollipop+
|
||||
setDeleteIntent(pendingDeleteIntent)
|
||||
@@ -80,11 +83,21 @@ class DatabaseOpenNotificationService: LockNotificationService() {
|
||||
pendingDeleteIntent)
|
||||
}.build())
|
||||
} else {
|
||||
startForeground(notificationId, notificationBuilder.build())
|
||||
stopSelf()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent): IBinder? {
|
||||
checkIntent(intent)
|
||||
return super.onBind(intent)
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
super.onStartCommand(intent, flags, startId)
|
||||
checkIntent(intent)
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
|
||||
@@ -90,22 +90,13 @@ class DatabaseTaskNotificationService : NotificationService(), ProgressTaskUpdat
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent): IBinder? {
|
||||
return mActionTaskBinder
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
super.onStartCommand(intent, flags, startId)
|
||||
|
||||
if (intent == null) return START_REDELIVER_INTENT
|
||||
|
||||
val intentAction = intent.action
|
||||
|
||||
private fun buildNotification(intent: Intent?) {
|
||||
var saveAction = true
|
||||
if (intent.hasExtra(SAVE_DATABASE_KEY)) {
|
||||
if (intent != null && intent.hasExtra(SAVE_DATABASE_KEY)) {
|
||||
saveAction = intent.getBooleanExtra(SAVE_DATABASE_KEY, saveAction)
|
||||
}
|
||||
|
||||
val intentAction = intent?.action
|
||||
val titleId: Int = when (intentAction) {
|
||||
ACTION_DATABASE_CREATE_TASK -> R.string.creating_database
|
||||
ACTION_DATABASE_LOAD_TASK -> R.string.loading_database
|
||||
@@ -127,6 +118,31 @@ class DatabaseTaskNotificationService : NotificationService(), ProgressTaskUpdat
|
||||
else
|
||||
R.string.do_not_kill_app
|
||||
|
||||
// Assign elements for updates
|
||||
mTitleId = titleId
|
||||
mMessageId = messageId
|
||||
mWarningId = warningId
|
||||
// Create the notification
|
||||
startForeground(notificationId, buildNewNotification()
|
||||
.setSmallIcon(R.drawable.notification_ic_database_load)
|
||||
.setContentTitle(getString(intent?.getIntExtra(DATABASE_TASK_TITLE_KEY, titleId) ?: titleId))
|
||||
.setAutoCancel(false)
|
||||
.setContentIntent(null).build())
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent): IBinder? {
|
||||
buildNotification(intent)
|
||||
return mActionTaskBinder
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
super.onStartCommand(intent, flags, startId)
|
||||
|
||||
buildNotification(intent)
|
||||
|
||||
if (intent == null) return START_REDELIVER_INTENT
|
||||
|
||||
val intentAction = intent.action
|
||||
val actionRunnable: ActionRunnable? = when (intentAction) {
|
||||
ACTION_DATABASE_CREATE_TASK -> buildDatabaseCreateActionTask(intent)
|
||||
ACTION_DATABASE_LOAD_TASK -> buildDatabaseLoadActionTask(intent)
|
||||
@@ -157,26 +173,19 @@ class DatabaseTaskNotificationService : NotificationService(), ProgressTaskUpdat
|
||||
}
|
||||
|
||||
actionRunnable?.let { actionRunnableNotNull ->
|
||||
// Assign elements for updates
|
||||
mTitleId = titleId
|
||||
mMessageId = messageId
|
||||
mWarningId = warningId
|
||||
|
||||
// Create the notification
|
||||
newNotification(intent.getIntExtra(DATABASE_TASK_TITLE_KEY, titleId))
|
||||
|
||||
// Build and launch the action
|
||||
mainScope.launch {
|
||||
executeAction(this@DatabaseTaskNotificationService,
|
||||
{
|
||||
sendBroadcast(Intent(DATABASE_START_TASK_ACTION).apply {
|
||||
putExtra(DATABASE_TASK_TITLE_KEY, titleId)
|
||||
putExtra(DATABASE_TASK_MESSAGE_KEY, messageId)
|
||||
putExtra(DATABASE_TASK_WARNING_KEY, warningId)
|
||||
putExtra(DATABASE_TASK_TITLE_KEY, mTitleId)
|
||||
putExtra(DATABASE_TASK_MESSAGE_KEY, mMessageId)
|
||||
putExtra(DATABASE_TASK_WARNING_KEY, mWarningId)
|
||||
})
|
||||
|
||||
mActionTaskListeners.forEach { actionTaskListener ->
|
||||
actionTaskListener.onStartAction(titleId, messageId, warningId)
|
||||
actionTaskListener.onStartAction(mTitleId, mMessageId, mWarningId)
|
||||
}
|
||||
|
||||
},
|
||||
@@ -208,8 +217,6 @@ class DatabaseTaskNotificationService : NotificationService(), ProgressTaskUpdat
|
||||
onPostExecute: (result: ActionRunnable.Result) -> Unit) {
|
||||
mAllowFinishAction.set(false)
|
||||
|
||||
// Stop the opening notification
|
||||
DatabaseOpenNotificationService.stop(this)
|
||||
TimeoutHelper.temporarilyDisableTimeout()
|
||||
onPreExecute.invoke()
|
||||
withContext(Dispatchers.IO) {
|
||||
@@ -228,7 +235,9 @@ class DatabaseTaskNotificationService : NotificationService(), ProgressTaskUpdat
|
||||
result
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
try {
|
||||
onPostExecute.invoke(asyncResult.await())
|
||||
} finally {
|
||||
TimeoutHelper.releaseTemporarilyDisableTimeout()
|
||||
// Start the opening notification
|
||||
if (TimeoutHelper.checkTimeAndLockIfTimeout(this@DatabaseTaskNotificationService)) {
|
||||
@@ -238,15 +247,6 @@ class DatabaseTaskNotificationService : NotificationService(), ProgressTaskUpdat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun newNotification(title: Int) {
|
||||
|
||||
val builder = buildNewNotification()
|
||||
.setSmallIcon(R.drawable.notification_ic_database_load)
|
||||
.setContentTitle(getString(title))
|
||||
.setAutoCancel(false)
|
||||
.setContentIntent(null)
|
||||
startForeground(notificationId, builder.build())
|
||||
}
|
||||
|
||||
override fun updateMessage(resId: Int) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package com.kunzisoft.keepass.tasks
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import com.kunzisoft.keepass.database.exception.DatabaseException
|
||||
|
||||
/**
|
||||
@@ -48,18 +49,26 @@ abstract class ActionRunnable: Runnable {
|
||||
result.isSuccess = false
|
||||
result.exception = null
|
||||
result.message = message
|
||||
showLog()
|
||||
}
|
||||
|
||||
protected fun setError(exception: Exception) {
|
||||
result.isSuccess = false
|
||||
result.exception = null
|
||||
result.message = exception.message
|
||||
showLog()
|
||||
}
|
||||
|
||||
protected fun setError(exception: DatabaseException) {
|
||||
result.isSuccess = false
|
||||
result.exception = exception
|
||||
result.message = exception.message
|
||||
showLog()
|
||||
}
|
||||
|
||||
private fun showLog() {
|
||||
val message = if (result.message != null) ", message=${result.message}" else ""
|
||||
Log.e(TAG, "success=${result.isSuccess}$message", result.exception)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,4 +78,8 @@ abstract class ActionRunnable: Runnable {
|
||||
var message: String? = null,
|
||||
var exception: DatabaseException? = null,
|
||||
var data: Bundle? = null)
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ActionRunnable"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +343,11 @@
|
||||
<string name="keyboard_keys_category">Touches</string>
|
||||
<string name="keyboard_key_vibrate_title">Touches vibrantes</string>
|
||||
<string name="keyboard_key_sound_title">Appui clavier audible</string>
|
||||
<string name="keyboard_change">Changement de clavier</string>
|
||||
<string name="keyboard_previous_database_credentials_title">Écran des identifications de la base de données</string>
|
||||
<string name="keyboard_previous_database_credentials_summary">Revenir automatiquement au clavier précédent sur l\'écran des identifications de la base de données</string>
|
||||
<string name="keyboard_previous_fill_in_title">Action de touche automatique</string>
|
||||
<string name="keyboard_previous_fill_in_summary">Revenir automatiquement au clavier précédent après avoir exécuté "Action de touche automatique"</string>
|
||||
<string name="selection_mode">Mode sélection</string>
|
||||
<string name="do_not_kill_app">Veuillez ne pas tuer l’application…</string>
|
||||
<string name="lock_database_back_root_title">Appuyer sur « Retour » pour verrouiller</string>
|
||||
|
||||
@@ -381,11 +381,11 @@
|
||||
<string name="keyboard_auto_go_action_summary">\"Go\" key action after pressing a \"Field\" key</string>
|
||||
<string name="keyboard_key_vibrate_title">Vibratory keypresses</string>
|
||||
<string name="keyboard_key_sound_title">Audible keypresses</string>
|
||||
<string name="keyboard_change">Keyboard change</string>
|
||||
<string name="keyboard_previous_database_credentials_title">Previous keyboard during database credentials</string>
|
||||
<string name="keyboard_previous_database_credentials_summary">Automatically back to the previous keyboard if the database credentials screen is shown</string>
|
||||
<string name="keyboard_previous_fill_in_title">Previous keyboard after form filling</string>
|
||||
<string name="keyboard_previous_fill_in_summary">Automatically back to the previous keyboard if the form is filling and "Go" key action is auto activated</string>
|
||||
<string name="keyboard_change">Switch keyboard</string>
|
||||
<string name="keyboard_previous_database_credentials_title">Database credentials screen</string>
|
||||
<string name="keyboard_previous_database_credentials_summary">Automatically switch back to the previous keyboard on the database credentials screen</string>
|
||||
<string name="keyboard_previous_fill_in_title">Auto key action</string>
|
||||
<string name="keyboard_previous_fill_in_summary">Automatically switch back to the previous keyboard after executing "Auto key action"</string>
|
||||
<string name="autofill_auto_search_title">Auto search</string>
|
||||
<string name="autofill_auto_search_summary">Automatically suggest search results from the web domain or application ID</string>
|
||||
<string name="autofill_application_id_blocklist_title">Application blocklist</string>
|
||||
|
||||
@@ -12,7 +12,7 @@ Install _fastlane_ using
|
||||
```
|
||||
[sudo] gem install fastlane -NV
|
||||
```
|
||||
or alternatively using `brew cask install fastlane`
|
||||
or alternatively using `brew install fastlane`
|
||||
|
||||
# Available Actions
|
||||
## Android
|
||||
|
||||
@@ -1,7 +1,2 @@
|
||||
* Fix TOTP period (> 60s)
|
||||
* Fix searching in recycle bin
|
||||
* Settings to back to the previous keyboard during database credentials and after form filling
|
||||
* Improving action tasks
|
||||
* Improve recognition to reset app timeout
|
||||
* Fix minor issues
|
||||
* Capture exceptions in coroutines
|
||||
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
* Correction de la période pour le TOTP (> 60s)
|
||||
* Correction de la recherche dans la corbeille
|
||||
* Paramètres pour revenir automatiquement au clavier précédent durant l'identification de la base et après le remplissage de formulaire
|
||||
* Amélioration des tâches d'action
|
||||
* Amélioration de la reconnaissance pour le temps écoulé
|
||||
* Correction de problèmes mineurs
|
||||
* Capture des exceptions dans les coroutines
|
||||
|
||||
Reference in New Issue
Block a user