File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed 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. */
2
2
3
3
private import semmle.code.xml.AndroidManifest
4
4
5
+ /** Represents an implicitly exported Android component */
5
6
class 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
+ */
7
18
predicate isImplicitlyExported ( ) {
8
19
not this .hasExportedAttribute ( ) and
9
20
this .hasAnIntentFilterElement ( ) and
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ class AndroidComponentXmlElement extends XmlElement {
178
178
/**
179
179
* Holds if this component element has an `<intent-filter>` child element.
180
180
*/
181
- predicate hasAnIntentFilterElement ( ) { this .getAChild ( ) . hasName ( "intent-filter" ) }
181
+ predicate hasAnIntentFilterElement ( ) { exists ( this .getAnIntentFilterElement ( ) ) }
182
182
183
183
/**
184
184
* 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
16
16
from ImplicitlyExportedAndroidComponent impExpAndroidComp
17
17
where impExpAndroidComp .isImplicitlyExported ( )
18
18
select 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