@@ -30,7 +30,8 @@ import org.junit.runner.RunWith
3030
3131@RunWith(AndroidJUnit4 ::class )
3232class SecurityTest : BaseAndroidTestCase () {
33- private val LOREM = (" Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"
33+
34+ private val exampleText = (" Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"
3435 + " incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"
3536 + " laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit "
3637 + " esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa "
@@ -57,7 +58,7 @@ class SecurityTest : BaseAndroidTestCase() {
5758
5859 @Test
5960 fun decryptUnencrypted () {
60- assertNotEquals(0 , decrypt(LOREM , PASS )!! .length.toLong())
61+ assertNotEquals(0 , decrypt(exampleText , PASS )!! .length.toLong())
6162 }
6263
6364 @Test
@@ -74,6 +75,13 @@ class SecurityTest : BaseAndroidTestCase() {
7475 assertThrows(ContentSecurityException ::class .java) { validatePath(path) }
7576 }
7677
78+ @Test
79+ fun validatePath_pathTraversal2 () {
80+ val path = " file:////////data/data/it.feio.android.omninotes.foss/shared_prefs/it.feio.android.omninotes.foss_preferences.xml"
81+
82+ assertThrows(ContentSecurityException ::class .java) { validatePath(path) }
83+ }
84+
7785 @Test
7886 fun validatePath_valid () {
7987 val path = " /images/screenshot/16844742322307525633366385236595.jpg"
0 commit comments