Skip to content

Commit

Permalink
Merge branch 'release/3.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Jamet committed Apr 14, 2022
2 parents ef836e8 + 23f3335 commit 6574bd1
Show file tree
Hide file tree
Showing 59 changed files with 199 additions and 210 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
KeePassDX(3.4.1)
* Fix search mode with Magikeyboard #1292
* Fix select another entry with Magikeyboard #1293
* Fix unexpected lock with Magikeyboard #1294
* Small UI changes

KeePassDX(3.4.0)
* Passphrase implementation #218
* Show visual password strength indicator with entropy #631 #869 #454 #1270
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Android KeePassDX

<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/icon.png"> KeePassDX is a **multi-format KeePass manager for Android devices**. The app allows creating keys and passwords in a secure way by integrating with the Android design standards.
<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/icon.png"> **Lightweight password manager for Android**, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.

<img src="https://raw.githubusercontent.com/Kunzisoft/KeePassDX/master/art/screen.jpg" width="220">

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.kunzisoft.keepass"
minSdkVersion 15
targetSdkVersion 31
versionCode = 108
versionName = "3.4.0"
versionCode = 110
versionName = "3.4.1"
multiDexEnabled true

testApplicationId = "com.kunzisoft.keepass.tests"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
<activity
android:name="com.kunzisoft.keepass.activities.EntrySelectionLauncherActivity"
android:theme="@style/Theme.Transparent"
android:excludeFromRecents="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import com.kunzisoft.keepass.database.element.node.Node
import com.kunzisoft.keepass.database.element.node.NodeId
import com.kunzisoft.keepass.database.element.template.Template
import com.kunzisoft.keepass.education.EntryEditActivityEducation
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
import com.kunzisoft.keepass.model.AttachmentState
import com.kunzisoft.keepass.model.EntryAttachmentState
import com.kunzisoft.keepass.model.RegisterInfo
Expand Down Expand Up @@ -434,9 +435,10 @@ class EntryEditActivity : DatabaseLockActivity(),

private fun entryValidatedForKeyboardSelection(database: Database, entry: Entry) {
// Populate Magikeyboard with entry
populateKeyboardAndMoveAppToBackground(this,
entry.getEntryInfo(database),
intent)
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
this,
entry.getEntryInfo(database)
)
onValidateSpecialMode()
// Don't keep activity history for entry edition
finishForEntryResult(entry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,16 @@
*/
package com.kunzisoft.keepass.activities

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.activities.helpers.EntrySelectionHelper
import com.kunzisoft.keepass.activities.legacy.DatabaseModeActivity
import com.kunzisoft.keepass.database.element.Database
import com.kunzisoft.keepass.database.search.SearchHelper
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
import com.kunzisoft.keepass.model.EntryInfo
import com.kunzisoft.keepass.model.SearchInfo
import com.kunzisoft.keepass.otp.OtpEntryFields
import com.kunzisoft.keepass.settings.PreferencesUtil
Expand Down Expand Up @@ -61,7 +57,7 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
keySelectionBundle.getParcelable<SearchInfo>(KEY_SEARCH_INFO)?.let { mSearchInfo ->
searchInfo = mSearchInfo
}
launch(database, searchInfo, true)
launch(database, searchInfo)
} else {
// To manage share
var sharedWebDomain: String? = null
Expand Down Expand Up @@ -103,8 +99,7 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
}

private fun launch(database: Database?,
searchInfo: SearchInfo,
forceSelection: Boolean = false) {
searchInfo: SearchInfo) {

// Setting to integrate Magikeyboard
val searchShareForMagikeyboard = PreferencesUtil.isKeyboardSearchShareEnable(this)
Expand All @@ -130,21 +125,22 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
.show()
}
} else if (searchShareForMagikeyboard) {
if (items.size == 1 && !forceSelection) {
// Automatically populate keyboard
val entryPopulate = items[0]
populateKeyboardAndMoveAppToBackground(
this,
entryPopulate,
intent)
Log.e("TEST", "One item activity")
} else {
// Select the one we want
GroupActivity.launchForKeyboardSelectionResult(this,
openedDatabase,
searchInfo,
true)
}
MagikeyboardService.performSelection(
items,
{ entryInfo ->
// Automatically populate keyboard
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
this,
entryInfo
)
},
{ autoSearch ->
GroupActivity.launchForKeyboardSelectionResult(this,
openedDatabase,
searchInfo,
autoSearch)
}
)
} else {
GroupActivity.launchForSearchResult(this,
openedDatabase,
Expand Down Expand Up @@ -172,7 +168,7 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
searchInfo,
false)
} else {
GroupActivity.launchForSaveResult(this,
GroupActivity.launchForSearchResult(this,
openedDatabase,
searchInfo,
false)
Expand Down Expand Up @@ -209,19 +205,9 @@ class EntrySelectionLauncherActivity : DatabaseModeActivity() {
}
// New task needed because don't launch from an Activity context
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK
Intent.FLAG_ACTIVITY_CLEAR_TASK or
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
context.startActivity(intent)
}
}
}

fun populateKeyboardAndMoveAppToBackground(activity: Activity,
entry: EntryInfo,
intent: Intent,
toast: Boolean = true) {
// Populate Magikeyboard with entry
MagikeyboardService.addEntryAndLaunchNotificationIfAllowed(activity, entry, toast)
// Consume the selection mode
EntrySelectionHelper.removeModesFromIntent(intent)
activity.moveTaskToBack(true)
}
95 changes: 42 additions & 53 deletions app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import com.kunzisoft.keepass.database.element.node.Type
import com.kunzisoft.keepass.database.search.SearchHelper
import com.kunzisoft.keepass.database.search.SearchParameters
import com.kunzisoft.keepass.education.GroupActivityEducation
import com.kunzisoft.keepass.magikeyboard.MagikeyboardService
import com.kunzisoft.keepass.model.GroupInfo
import com.kunzisoft.keepass.model.MainCredential
import com.kunzisoft.keepass.model.RegisterInfo
Expand Down Expand Up @@ -890,10 +891,9 @@ class GroupActivity : DatabaseLockActivity(),
private fun entrySelectedForKeyboardSelection(database: Database, entry: Entry) {
reloadCurrentGroup()
// Populate Magikeyboard with entry
populateKeyboardAndMoveAppToBackground(
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
this,
entry.getEntryInfo(database),
intent
entry.getEntryInfo(database)
)
onValidateSpecialMode()
}
Expand Down Expand Up @@ -1138,6 +1138,7 @@ class GroupActivity : DatabaseLockActivity(),
private fun addSearchQueryInSearchView(searchQuery: String) {
searchView?.setOnQueryTextListener(null)
searchView?.setQuery(searchQuery, false)
searchView?.clearFocus()
searchView?.setOnQueryTextListener(mOnSearchQueryTextListener)
}

Expand Down Expand Up @@ -1612,50 +1613,31 @@ class GroupActivity : DatabaseLockActivity(),
autofillActivityResultLauncher: ActivityResultLauncher<Intent>?) {
EntrySelectionHelper.doSpecialAction(activity.intent,
{
GroupActivity.launch(
// Default action
launch(
activity,
database,
true
)
},
{ searchInfo ->
SearchHelper.checkAutoSearchInfo(activity,
// Search action
if (database.loaded) {
launchForSearchResult(activity,
database,
searchInfo,
{ _, _ ->
// Response is build
GroupActivity.launchForSearchResult(activity,
database,
searchInfo,
true)
onLaunchActivitySpecialMode()
},
{
// Here no search info found
if (database.isReadOnly) {
GroupActivity.launchForSearchResult(activity,
database,
searchInfo,
false)
} else {
GroupActivity.launchForSaveResult(activity,
database,
searchInfo,
false)
}
onLaunchActivitySpecialMode()
},
{
// Simply close if database not opened, normally not happened
onCancelSpecialMode()
}
)
true)
onLaunchActivitySpecialMode()
} else {
// Simply close if database not opened
onCancelSpecialMode()
}
},
{ searchInfo ->
// Save info used with OTP
// Save info
if (database.loaded) {
if (!database.isReadOnly) {
GroupActivity.launchForSaveResult(
launchForSaveResult(
activity,
database,
searchInfo,
Expand All @@ -1674,28 +1656,33 @@ class GroupActivity : DatabaseLockActivity(),
}
},
{ searchInfo ->
// Keyboard selection
SearchHelper.checkAutoSearchInfo(activity,
database,
searchInfo,
{ _, items ->
// Response is build
if (items.size == 1) {
populateKeyboardAndMoveAppToBackground(activity,
items[0],
activity.intent)
onValidateSpecialMode()
} else {
// Select the one we want
GroupActivity.launchForKeyboardSelectionResult(activity,
database,
searchInfo,
true)
onLaunchActivitySpecialMode()
}
MagikeyboardService.performSelection(
items,
{ entryInfo ->
// Keyboard populated
MagikeyboardService.populateKeyboardAndMoveAppToBackground(
activity,
entryInfo
)
onValidateSpecialMode()
},
{ autoSearch ->
launchForKeyboardSelectionResult(activity,
database,
searchInfo,
autoSearch)
onLaunchActivitySpecialMode()
}
)
},
{
// Here no search info found, disable auto search
GroupActivity.launchForKeyboardSelectionResult(activity,
launchForKeyboardSelectionResult(activity,
database,
searchInfo,
false)
Expand All @@ -1708,6 +1695,7 @@ class GroupActivity : DatabaseLockActivity(),
)
},
{ searchInfo, autofillComponent ->
// Autofill selection
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
SearchHelper.checkAutoSearchInfo(activity,
database,
Expand All @@ -1719,7 +1707,7 @@ class GroupActivity : DatabaseLockActivity(),
},
{
// Here no search info found, disable auto search
GroupActivity.launchForAutofillResult(activity,
launchForAutofillResult(activity,
database,
autofillActivityResultLauncher,
autofillComponent,
Expand All @@ -1737,20 +1725,21 @@ class GroupActivity : DatabaseLockActivity(),
}
},
{ registerInfo ->
// Autofill registration
if (!database.isReadOnly) {
SearchHelper.checkAutoSearchInfo(activity,
database,
registerInfo?.searchInfo,
{ _, _ ->
// No auto search, it's a registration
GroupActivity.launchForRegistration(activity,
launchForRegistration(activity,
database,
registerInfo)
onLaunchActivitySpecialMode()
},
{
// Here no search info found, disable auto search
GroupActivity.launchForRegistration(activity,
launchForRegistration(activity,
database,
registerInfo)
onLaunchActivitySpecialMode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object EntrySelectionHelper {
return intent.getParcelableExtra(KEY_SEARCH_INFO)
}

fun addRegisterInfoInIntent(intent: Intent, registerInfo: RegisterInfo?) {
private fun addRegisterInfoInIntent(intent: Intent, registerInfo: RegisterInfo?) {
registerInfo?.let {
intent.putExtra(KEY_REGISTER_INFO, it)
}
Expand Down Expand Up @@ -113,7 +113,7 @@ object EntrySelectionHelper {
?: SpecialMode.DEFAULT
}

fun addTypeModeInIntent(intent: Intent, typeMode: TypeMode) {
private fun addTypeModeInIntent(intent: Intent, typeMode: TypeMode) {
intent.putExtra(KEY_TYPE_MODE, typeMode as Serializable)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ class SearchHelper {
onDatabaseClosed.invoke()
} else if (TimeoutHelper.checkTime(context)) {
var searchWithoutUI = false
if (PreferencesUtil.isAutofillAutoSearchEnable(context)
&& searchInfo != null && !searchInfo.manualSelection
&& !searchInfo.containsOnlyNullValues()) {
if (searchInfo != null
&& !searchInfo.manualSelection
&& !searchInfo.containsOnlyNullValues()) {
// If search provide results
database.createVirtualGroupFromSearchInfo(
searchInfo.toString(),
Expand Down
Loading

0 comments on commit 6574bd1

Please sign in to comment.