File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,16 @@ class AndroidApplicationXmlElement extends XmlElement {
98
98
attr .getValue ( ) = "true"
99
99
)
100
100
}
101
+
102
+ predicate providesMainIntent ( ) {
103
+ exists ( AndroidActivityXmlElement activity |
104
+ activity = this .getAChild ( ) and
105
+ exists ( AndroidIntentFilterXmlElement intentFilter |
106
+ intentFilter = activity .getAChild ( ) and
107
+ intentFilter .getAnActionElement ( ) .getActionName ( ) = "android.intent.action.MAIN"
108
+ )
109
+ )
110
+ }
101
111
}
102
112
103
113
/**
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ import semmle.code.xml.AndroidManifest
15
15
16
16
from AndroidApplicationXmlElement androidAppElem
17
17
where
18
- androidAppElem .allowsBackup ( ) and
19
- androidAppElem .getFile ( ) .( AndroidManifestXmlFile ) .isInBuildDirectory ( )
18
+ not androidAppElem .getFile ( ) .( AndroidManifestXmlFile ) .isInBuildDirectory ( ) and
19
+ (
20
+ androidAppElem .allowsBackupExplicitly ( )
21
+ or
22
+ androidAppElem .providesMainIntent ( ) and
23
+ androidAppElem .allowsBackup ( )
24
+ )
20
25
select androidAppElem , "The 'android:allowBackup' attribute is enabled."
You can’t perform that action at this time.
0 commit comments