mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Modify getAndroidComponentXmlElement to handle activity-alias
Since aliases have both the `name` and `targetActivity` attributes, we should check all identifying attributes in order to add `<activity-alias>` elements as dataflow sources.
This commit is contained in:
@@ -26,7 +26,12 @@ class AndroidComponent extends Class {
|
||||
|
||||
/** The XML element corresponding to this Android component. */
|
||||
AndroidComponentXmlElement getAndroidComponentXmlElement() {
|
||||
result.getResolvedComponentName() = this.getQualifiedName()
|
||||
// Find an element with an identifier matching the qualified name of the component.
|
||||
// Aliases have two identifiers (name and target), so check both identifiers (if present).
|
||||
exists(AndroidIdentifierXmlAttribute identifier |
|
||||
identifier = result.getAnAttribute() and
|
||||
result.getResolvedIdentifier(identifier) = this.getQualifiedName()
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if this Android component is configured as `exported` in an `AndroidManifest.xml` file. */
|
||||
|
||||
Reference in New Issue
Block a user