mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Retrieve application id and domain
This commit is contained in:
@@ -42,12 +42,9 @@ internal class StructureParser(private val structure: AssistStructure) {
|
|||||||
usernameCandidate = null
|
usernameCandidate = null
|
||||||
mainLoop@ for (i in 0 until structure.windowNodeCount) {
|
mainLoop@ for (i in 0 until structure.windowNodeCount) {
|
||||||
val windowNode = structure.getWindowNodeAt(i)
|
val windowNode = structure.getWindowNodeAt(i)
|
||||||
/*
|
applicationId = windowNode.title.toString().split("/")[0]
|
||||||
title.add(windowNode.title)
|
Log.d(TAG, "Autofill applicationId: $applicationId")
|
||||||
windowNode.rootViewNode.webDomain?.let {
|
|
||||||
webDomain.add(it)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (parseViewNode(windowNode.rootViewNode))
|
if (parseViewNode(windowNode.rootViewNode))
|
||||||
break@mainLoop
|
break@mainLoop
|
||||||
}
|
}
|
||||||
@@ -65,6 +62,12 @@ internal class StructureParser(private val structure: AssistStructure) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun parseViewNode(node: AssistStructure.ViewNode): Boolean {
|
private fun parseViewNode(node: AssistStructure.ViewNode): Boolean {
|
||||||
|
// Get the domain of a web app
|
||||||
|
node.webDomain?.let {
|
||||||
|
result?.domain = it
|
||||||
|
Log.d(TAG, "Autofill domain: $it")
|
||||||
|
}
|
||||||
|
|
||||||
// Only parse visible nodes
|
// Only parse visible nodes
|
||||||
if (node.visibility == View.VISIBLE) {
|
if (node.visibility == View.VISIBLE) {
|
||||||
if (node.autofillId != null
|
if (node.autofillId != null
|
||||||
@@ -192,6 +195,13 @@ internal class StructureParser(private val structure: AssistStructure) {
|
|||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
internal class Result {
|
internal class Result {
|
||||||
|
var applicationId: String? = null
|
||||||
|
var domain: String? = null
|
||||||
|
set(value) {
|
||||||
|
if (field == null)
|
||||||
|
field = value
|
||||||
|
}
|
||||||
|
|
||||||
var usernameId: AutofillId? = null
|
var usernameId: AutofillId? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
if (field == null)
|
if (field == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user