File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- /** Provides a class to reason about Android implicitly exported components. */
1+ /** Provides a class to identify implicitly exported Android components. */
22
33private import semmle.code.xml.AndroidManifest
44
5+ /** Represents an implicitly exported Android component */
56class ImplicitlyExportedAndroidComponent extends AndroidComponentXmlElement {
6- //ImplicitlyExportedAndroidComponent() { }
7+ // ImplicitlyExportedAndroidComponent() {
8+ // not this.hasExportedAttribute() and
9+ // this.hasAnIntentFilterElement() and
10+ // not this.requiresPermissions() and
11+ // not this.getParent().(AndroidApplicationXmlElement).hasAttribute("permission") and
12+ // not this.getAnIntentFilterElement().hasLauncherCategoryElement() and
13+ // not this.getFile().(AndroidManifestXmlFile).isInBuildDirectory()
14+ // }
15+ /**
16+ * Holds if this Android component is implicitly exported.
17+ */
718 predicate isImplicitlyExported ( ) {
819 not this .hasExportedAttribute ( ) and
920 this .hasAnIntentFilterElement ( ) and
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ class AndroidComponentXmlElement extends XmlElement {
178178 /**
179179 * Holds if this component element has an `<intent-filter>` child element.
180180 */
181- predicate hasAnIntentFilterElement ( ) { this .getAChild ( ) . hasName ( "intent-filter" ) }
181+ predicate hasAnIntentFilterElement ( ) { exists ( this .getAnIntentFilterElement ( ) ) }
182182
183183 /**
184184 * Gets the value of the `android:name` attribute of this component element.
Original file line number Diff line number Diff line change @@ -16,3 +16,6 @@ import semmle.code.java.security.ImplicitlyExportedAndroidComponent
1616from ImplicitlyExportedAndroidComponent impExpAndroidComp
1717where impExpAndroidComp .isImplicitlyExported ( )
1818select impExpAndroidComp , "This component is implicitly exported."
19+ // from ImplicitlyExportedAndroidComponent impExpAndroidComp
20+ // where exists(impExpAndroidComp)
21+ // select impExpAndroidComp, "This component is implicitly exported."
You can’t perform that action at this time.
0 commit comments