Skip to content

Commit b5c54f5

Browse files
committed
Add check for android:allowBackup explicitly set
`android:allowBackup` has a default value of `true`. So we want to flag any file which explicitly sets it.
1 parent e6a1b1f commit b5c54f5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

java/ql/lib/semmle/code/xml/AndroidManifest.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ class AndroidApplicationXmlElement extends XmlElement {
8585
attr.getValue() = "false"
8686
)
8787
}
88+
89+
/**
90+
* Holds if this application element sets the `android:allowBackup` attribute to `true`.
91+
*
92+
* https://developer.android.com/guide/topics/data/autobackup
93+
*/
94+
predicate allowsBackupExplicitly() {
95+
exists(AndroidXmlAttribute attr |
96+
this.getAnAttribute() = attr and
97+
attr.getName() = "allowBackup" and
98+
attr.getValue() = "true"
99+
)
100+
}
88101
}
89102

90103
/**

0 commit comments

Comments
 (0)