mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Add check for files which provide the app launcher
Adds support for filtering which applications include the `android.intent.action.MAIN` intent.
This commit is contained in:
@@ -98,6 +98,16 @@ class AndroidApplicationXmlElement extends XmlElement {
|
||||
attr.getValue() = "true"
|
||||
)
|
||||
}
|
||||
|
||||
predicate providesMainIntent() {
|
||||
exists(AndroidActivityXmlElement activity |
|
||||
activity = this.getAChild() and
|
||||
exists(AndroidIntentFilterXmlElement intentFilter |
|
||||
intentFilter = activity.getAChild() and
|
||||
intentFilter.getAnActionElement().getActionName() = "android.intent.action.MAIN"
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,11 @@ import semmle.code.xml.AndroidManifest
|
||||
|
||||
from AndroidApplicationXmlElement androidAppElem
|
||||
where
|
||||
androidAppElem.allowsBackup() and
|
||||
androidAppElem.getFile().(AndroidManifestXmlFile).isInBuildDirectory()
|
||||
not androidAppElem.getFile().(AndroidManifestXmlFile).isInBuildDirectory() and
|
||||
(
|
||||
androidAppElem.allowsBackupExplicitly()
|
||||
or
|
||||
androidAppElem.providesMainIntent() and
|
||||
androidAppElem.allowsBackup()
|
||||
)
|
||||
select androidAppElem, "The 'android:allowBackup' attribute is enabled."
|
||||
|
||||
Reference in New Issue
Block a user