mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Merge branch 'develop' into feature/Autofill_Save
This commit is contained in:
@@ -49,8 +49,7 @@ class KeeAutofillService : AutofillService() {
|
||||
override fun onFillRequest(request: FillRequest,
|
||||
cancellationSignal: CancellationSignal,
|
||||
callback: FillCallback) {
|
||||
val fillContexts = request.fillContexts
|
||||
val latestStructure = fillContexts[fillContexts.size - 1].structure
|
||||
val latestStructure = request.fillContexts.last().structure
|
||||
|
||||
cancellationSignal.setOnCancelListener { Log.w(TAG, "Cancel autofill.") }
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ internal class StructureParser(private val structure: AssistStructure,
|
||||
Log.d(TAG, "Autofill domain: $webDomain")
|
||||
}
|
||||
}
|
||||
val domainNotEmpty = result?.domain?.isNotEmpty() == true
|
||||
|
||||
var returnValue = false
|
||||
// Only parse visible nodes
|
||||
if (node.visibility == View.VISIBLE) {
|
||||
if (node.autofillId != null
|
||||
@@ -86,19 +88,24 @@ internal class StructureParser(private val structure: AssistStructure,
|
||||
val hints = node.autofillHints
|
||||
if (hints != null && hints.isNotEmpty()) {
|
||||
if (parseNodeByAutofillHint(node))
|
||||
return true
|
||||
returnValue = true
|
||||
} else if (parseNodeByHtmlAttributes(node))
|
||||
return true
|
||||
returnValue = true
|
||||
else if (parseNodeByAndroidInput(node))
|
||||
return true
|
||||
returnValue = true
|
||||
}
|
||||
// Optimized return but only if domain not empty
|
||||
if (domainNotEmpty && returnValue)
|
||||
return true
|
||||
// Recursive method to process each node
|
||||
for (i in 0 until node.childCount) {
|
||||
if (parseViewNode(node.getChildAt(i)))
|
||||
returnValue = true
|
||||
if (domainNotEmpty && returnValue)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return returnValue
|
||||
}
|
||||
|
||||
private fun parseNodeByAutofillHint(node: AssistStructure.ViewNode): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user