mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Unit tests for android:allowBackup query
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
class AllowBackupEnabledTest {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import java
|
||||
import semmle.code.xml.AndroidManifest
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class AllowBackupEnabledTest extends InlineExpectationsTest {
|
||||
AllowBackupEnabledTest() { this = "AllowBackupEnabledTest" }
|
||||
|
||||
override string getARelevantTag() { result = "hasAllowBackupEnabled" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasAllowedBackupEnabled" and
|
||||
exists(AndroidApplicationXmlElement androidAppElem |
|
||||
androidAppElem.allowsBackup() and
|
||||
not androidAppElem.getFile().(AndroidManifestXmlFile).isInBuildDirectory()
|
||||
|
|
||||
androidAppElem.getAttribute("allowBackup").getLocation() = location and
|
||||
element = androidAppElem.getAttribute("debuggable").toString() and
|
||||
value = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
android:versionCode="1"
|
||||
android:versionName="0.1" >
|
||||
|
||||
<application>
|
||||
<application android:allowBackup="true">
|
||||
<activity android:name=".CleartextStorageAndroidDatabaseTest"></activity>
|
||||
<activity android:name=".CleartextStorageAndroidFileSystemTest"></activity>
|
||||
<activity android:name=".CleartextStorageSharedPrefsTest"></activity>
|
||||
|
||||
Reference in New Issue
Block a user