File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,17 @@ class AndroidApplicationXmlElement extends XmlElement {
7474 predicate requiresPermissions ( ) { this .getAnAttribute ( ) .( AndroidPermissionXmlAttribute ) .isFull ( ) }
7575
7676 /**
77- * Holds if this application element has the attribute `android:allowBackup` set to `true`.
77+ * Holds if this application element enables the `android:allowBackup` attribute.
78+ *
79+ * https://developer.android.com/guide/topics/data/autobackup
7880 */
7981 predicate allowsBackup ( ) {
80- exists ( AndroidXmlAttribute attr |
82+ // The default value for the attribute `android:allowBackup` is `true`.
83+ // Therefore we also check if it is not present.
84+ not exists ( AndroidXmlAttribute attr |
8185 this .getAnAttribute ( ) = attr and
8286 attr .getName ( ) = "allowBackup" and
83- attr .getValue ( ) = "true "
87+ attr .getValue ( ) = "false "
8488 )
8589 }
8690}
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ from AndroidApplicationXmlElement androidAppElem
1717where
1818 androidAppElem .allowsBackup ( ) and
1919 androidAppElem .getFile ( ) .( AndroidManifestXmlFile ) .isInBuildDirectory ( )
20- select androidAppElem . getAttribute ( "allowBackup" ) , "The 'android:allowBackup' attribute is enabled."
20+ select androidAppElem , "The 'android:allowBackup' attribute is enabled."
Original file line number Diff line number Diff line change 1+ <manifest ... >
2+ <!-- BAD: no 'android:allowBackup' set, defaults to 'true' -->
3+ <application >
4+ <activity ... >
5+ </activity >
6+ </application >
7+ </manifest >
You can’t perform that action at this time.
0 commit comments