Skip to content

Commit eee1226

Browse files
Jami CogswellJami Cogswell
authored andcommitted
excluded action main from query results, added unit test
1 parent c5526ff commit eee1226

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ class ImplicitlyExportedAndroidComponent extends AndroidComponentXmlElement {
99
this.hasAnIntentFilterElement() and
1010
not this.getAnIntentFilterElement().getACategoryElement().getCategoryName() =
1111
"android.intent.category.LAUNCHER" and
12+
not this.getAnIntentFilterElement().getAnActionElement().getActionName() =
13+
"android.intent.action.MAIN" and
1214
not this.requiresPermissions() and
1315
not this.getParent().(AndroidApplicationXmlElement).requiresPermissions() and
14-
not this.getFile().(AndroidManifestXmlFile).isInBuildDirectory() //and
15-
//not this.getAnIntentFilterElement().getAnActionElement().getActionName() =
16-
// "android.intent.action.MAIN"
16+
not this.getFile().(AndroidManifestXmlFile).isInBuildDirectory()
1717
}
1818
}

java/ql/test/query-tests/security/CWE-926/AndroidManifest.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@
102102
</intent-filter>
103103
</activity>
104104

105+
<!-- Safe: has action 'android.intent.category.MAIN' --> <activity
106+
android:name=".Activity">
107+
<intent-filter>
108+
<action android:name="android.intent.action.MAIN" />
109+
</intent-filter>
110+
</activity>
111+
105112
</application>
106113

107114
</manifest>

0 commit comments

Comments
 (0)