@@ -79,10 +79,20 @@ class AndroidApplicationXmlElement extends XmlElement {
79
79
* https://developer.android.com/guide/topics/data/autobackup
80
80
*/
81
81
predicate allowsBackup ( ) {
82
- not exists ( AndroidXmlAttribute attr |
83
- this .getAnAttribute ( ) = attr and
84
- attr .getName ( ) = "allowBackup" and
85
- attr .getValue ( ) = "false"
82
+ not this .getFile ( ) .( AndroidManifestXmlFile ) .isInBuildDirectory ( ) and
83
+ (
84
+ // explicitly sets android:allowBackup="true"
85
+ this .allowsBackupExplicitly ( )
86
+ or
87
+ // Manifest providing the main intent for an application, and does not explicitly
88
+ // disallow the allowBackup attribute
89
+ this .providesMainIntent ( ) and
90
+ // Check that android:allowBackup="false" is not present
91
+ not exists ( AndroidXmlAttribute attr |
92
+ this .getAnAttribute ( ) = attr and
93
+ attr .getName ( ) = "allowBackup" and
94
+ attr .getValue ( ) = "false"
95
+ )
86
96
)
87
97
}
88
98
@@ -91,7 +101,7 @@ class AndroidApplicationXmlElement extends XmlElement {
91
101
*
92
102
* https://developer.android.com/guide/topics/data/autobackup
93
103
*/
94
- predicate allowsBackupExplicitly ( ) {
104
+ private predicate allowsBackupExplicitly ( ) {
95
105
exists ( AndroidXmlAttribute attr |
96
106
this .getAnAttribute ( ) = attr and
97
107
attr .getName ( ) = "allowBackup" and
@@ -103,7 +113,7 @@ class AndroidApplicationXmlElement extends XmlElement {
103
113
* Holds if the application element contains a child element which provides the
104
114
* `android.intent.action.MAIN` intent.
105
115
*/
106
- predicate providesMainIntent ( ) {
116
+ private predicate providesMainIntent ( ) {
107
117
exists ( AndroidActivityXmlElement activity |
108
118
activity = this .getAChild ( ) and
109
119
exists ( AndroidIntentFilterXmlElement intentFilter |
0 commit comments