mirror of
https://github.com/github/codeql.git
synced 2025-12-23 20:26:32 +01:00
updated predicates
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
/** Provides a class to reason about Android implicitly exported components. */
|
||||
/** Provides a class to identify implicitly exported Android components. */
|
||||
|
||||
private import semmle.code.xml.AndroidManifest
|
||||
|
||||
/** Represents an implicitly exported Android component */
|
||||
class ImplicitlyExportedAndroidComponent extends AndroidComponentXmlElement {
|
||||
//ImplicitlyExportedAndroidComponent() { }
|
||||
// ImplicitlyExportedAndroidComponent() {
|
||||
// not this.hasExportedAttribute() and
|
||||
// this.hasAnIntentFilterElement() and
|
||||
// not this.requiresPermissions() and
|
||||
// not this.getParent().(AndroidApplicationXmlElement).hasAttribute("permission") and
|
||||
// not this.getAnIntentFilterElement().hasLauncherCategoryElement() and
|
||||
// not this.getFile().(AndroidManifestXmlFile).isInBuildDirectory()
|
||||
// }
|
||||
/**
|
||||
* Holds if this Android component is implicitly exported.
|
||||
*/
|
||||
predicate isImplicitlyExported() {
|
||||
not this.hasExportedAttribute() and
|
||||
this.hasAnIntentFilterElement() and
|
||||
|
||||
@@ -178,7 +178,7 @@ class AndroidComponentXmlElement extends XmlElement {
|
||||
/**
|
||||
* Holds if this component element has an `<intent-filter>` child element.
|
||||
*/
|
||||
predicate hasAnIntentFilterElement() { this.getAChild().hasName("intent-filter") }
|
||||
predicate hasAnIntentFilterElement() { exists(this.getAnIntentFilterElement()) }
|
||||
|
||||
/**
|
||||
* Gets the value of the `android:name` attribute of this component element.
|
||||
|
||||
@@ -16,3 +16,6 @@ import semmle.code.java.security.ImplicitlyExportedAndroidComponent
|
||||
from ImplicitlyExportedAndroidComponent impExpAndroidComp
|
||||
where impExpAndroidComp.isImplicitlyExported()
|
||||
select impExpAndroidComp, "This component is implicitly exported."
|
||||
// from ImplicitlyExportedAndroidComponent impExpAndroidComp
|
||||
// where exists(impExpAndroidComp)
|
||||
// select impExpAndroidComp, "This component is implicitly exported."
|
||||
|
||||
Reference in New Issue
Block a user