mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
added predicates in the AndroidManifest library and adjusted tests
This commit is contained in:
@@ -18,6 +18,16 @@ class AndroidManifestXmlFile extends XMLFile {
|
||||
* Gets the top-level `<manifest>` element in this Android manifest file.
|
||||
*/
|
||||
AndroidManifestXmlElement getManifestElement() { result = this.getAChild() }
|
||||
|
||||
/**
|
||||
* Holds if this Android manifest file is located in a build directory.
|
||||
*/
|
||||
predicate isInBuildDirectory() {
|
||||
exists(AndroidManifestXmlFile file |
|
||||
file = this.getFile() and
|
||||
file.getRelativePath().matches("%build%")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,6 +61,23 @@ class AndroidApplicationXmlElement extends XMLElement {
|
||||
* Gets a component child element of this `<application>` element.
|
||||
*/
|
||||
AndroidComponentXmlElement getAComponentElement() { result = this.getAChild() }
|
||||
|
||||
/**
|
||||
* Holds if this application element has the attribute `android:debuggable` set to `true`.
|
||||
*/
|
||||
predicate isDebuggable() {
|
||||
exists(AndroidXmlAttribute attr |
|
||||
this.getAnAttribute() = attr and
|
||||
attr.getName() = "debuggable" and
|
||||
attr.getValue() = "true"
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides the getFile() predicate of the XMLElement class to get the
|
||||
* AndroidManifest.xml file itself.
|
||||
*/
|
||||
override AndroidManifestXmlFile getFile() { result = super.getFile() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user