Skip to content

Commit 5990975

Browse files
committed
Change allowBackup tests to use qlref test format
Due to some limitations of comments in XML, it is simpler to implement the `android:allowBackup` tests using the qlref/expectations test format.
1 parent e69a826 commit 5990975

File tree

6 files changed

+7
-20
lines changed

6 files changed

+7
-20
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| TestExplicitlyEnabled/AndroidManifest.xml:6:5:27:19 | application | The 'android:allowBackup' attribute is enabled. |
2+
| TestMissing/AndroidManifest.xml:6:5:27:19 | application | The 'android:allowBackup' attribute is enabled. |

java/ql/test/query-tests/security/CWE-312/android/backup/AllowBackupEnabledTest.ql

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Security/CWE/CWE-312/AllowBackupAttributeEnabled.ql

java/ql/test/query-tests/security/CWE-312/android/backup/TestExplicitlyEnabled/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
package="com.example.myapplication">
55

6-
<!-- $ hasAllowBackupEnabled --> <application
6+
<application
77
android:allowBackup="true"
88
android:dataExtractionRules="@xml/data_extraction_rules"
99
android:fullBackupContent="@xml/backup_rules"

java/ql/test/query-tests/security/CWE-312/android/backup/TestMissing/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
package="com.example.myapplication">
55

6-
<!-- $ hasAllowBackupEnabled --> <application
6+
<application
77
android:dataExtractionRules="@xml/data_extraction_rules"
88
android:fullBackupContent="@xml/backup_rules"
99
android:icon="@mipmap/ic_launcher"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/google-android-9.0.0
2+
// codeql-extractor-kotlin-options: ${testdir}/../../../../../stubs/google-android-9.0.0

0 commit comments

Comments
 (0)