mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Add Kotlin test for CleartextStorageSharedPrefs
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
|
||||
class CleartextStorageSharedPrefsTestKt : Activity() {
|
||||
fun testSetSharedPrefs1(context: Context, name: String, password: String) {
|
||||
val sharedPrefs = context.getSharedPreferences("user_prefs", Context.MODE_PRIVATE);
|
||||
sharedPrefs.edit().putString("name", name).apply(); // Safe
|
||||
sharedPrefs.edit().putString("password", password).apply(); // $ hasCleartextStorageSharedPrefs
|
||||
}
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
// semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/google-android-9.0.0
|
||||
// codeql-extractor-kotlin-options: ${testdir}/../../../stubs/google-android-9.0.0
|
||||
|
||||
Reference in New Issue
Block a user