From cf3e5a0abe5f0a7082b2385dcff38a882575f252 Mon Sep 17 00:00:00 2001 From: Ed Minnix Date: Fri, 23 Sep 2022 21:09:23 -0400 Subject: [PATCH] Add class for XML Attributes meant to hold an identifier in AndroidManifest Some Android component attributes hold an identifier (e.g. `android:name` and `android:targetActivity` for ``). --- java/ql/lib/semmle/code/xml/AndroidManifest.qll | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/java/ql/lib/semmle/code/xml/AndroidManifest.qll b/java/ql/lib/semmle/code/xml/AndroidManifest.qll index c18b32751ed..91e34aa493e 100644 --- a/java/ql/lib/semmle/code/xml/AndroidManifest.qll +++ b/java/ql/lib/semmle/code/xml/AndroidManifest.qll @@ -212,6 +212,13 @@ class AndroidPermissionXmlAttribute extends XmlAttribute { predicate isWrite() { this.getName() = "writePermission" } } +/** + * The attribute `android:name` or `android:targetActivity`. + */ +class AndroidIdentifierXmlAttribute extends AndroidXmlAttribute { + AndroidIdentifierXmlAttribute() { this.getName() = ["name", "targetActivity"] } +} + /** * The ` element of a `` in an Android manifest file. */