Skip to content

Commit 115f76a

Browse files
Jami CogswellJami Cogswell
authored andcommitted
fixed typo in unit tests; added a couple more tests
1 parent b88d545 commit 115f76a

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed

java/ql/test/query-tests/security/CWE-926/AndroidManifest.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
4444

4545
</intent-filter>
46-
</service>
46+
</provider>
4747

4848
<!-- Safe: 'android:exported' explicitly set --> <activity
4949
android:name=".Activity"
@@ -73,7 +73,25 @@
7373
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
7474

7575
</intent-filter>
76-
</service>
76+
</provider>
77+
78+
<!-- $ hasImplicitExport --> <provider
79+
android:name=".MyCloudProvider"
80+
android:readPermission=".TestRead">
81+
<intent-filter>
82+
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
83+
84+
</intent-filter>
85+
</provider>
86+
87+
<!-- $ hasImplicitExport --> <provider
88+
android:name=".MyCloudProvider"
89+
android:writePermission=".TestWrite">
90+
<intent-filter>
91+
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
92+
93+
</intent-filter>
94+
</provider>
7795

7896
<!-- Safe: has category 'android.intent.category.LAUNCHER' --> <activity
7997
android:name=".Activity">

java/ql/test/query-tests/security/CWE-926/TestApplicationPermission/AndroidManifest.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
4545

4646
</intent-filter>
47-
</service>
47+
</provider>
4848

4949
<!-- Safe: 'android:exported' explicitly set --> <activity
5050
android:name=".Activity"
@@ -74,7 +74,25 @@
7474
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
7575

7676
</intent-filter>
77-
</service>
77+
</provider>
78+
79+
<!-- Safe: 'application' element has 'permission' attribute --> <provider
80+
android:name=".MyCloudProvider"
81+
android:readPermission=".TestRead">
82+
<intent-filter>
83+
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
84+
85+
</intent-filter>
86+
</provider>
87+
88+
<!-- Safe: 'application' element has 'permission' attribute --> <provider
89+
android:name=".MyCloudProvider"
90+
android:writePermission=".TestWrite">
91+
<intent-filter>
92+
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
93+
94+
</intent-filter>
95+
</provider>
7896

7997
<!-- Safe: has category 'android.intent.category.LAUNCHER' --> <activity
8098
android:name=".Activity">

java/ql/test/query-tests/security/CWE-926/Testbuild/AndroidManifest.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
4444

4545
</intent-filter>
46-
</service>
46+
</provider>
4747

4848
<!-- Safe: 'android:exported' explicitly set --> <activity
4949
android:name=".Activity"
@@ -73,7 +73,25 @@
7373
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
7474

7575
</intent-filter>
76-
</service>
76+
</provider>
77+
78+
<!-- Safe: in build directory --> <provider
79+
android:name=".MyCloudProvider"
80+
android:readPermission=".TestRead">
81+
<intent-filter>
82+
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
83+
84+
</intent-filter>
85+
</provider>
86+
87+
<!-- Safe: in build directory --> <provider
88+
android:name=".MyCloudProvider"
89+
android:writePermission=".TestWrite">
90+
<intent-filter>
91+
<action android:name="android.intent.action.DOCUMENTS_PROVIDER"/>
92+
93+
</intent-filter>
94+
</provider>
7795

7896
<!-- Safe: has category 'android.intent.category.LAUNCHER' --> <activity
7997
android:name=".Activity">

0 commit comments

Comments
 (0)