mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
Java: Re-enable Widget.qll flow steps
The library Widget.qll was accidentally removed from the global context when its sources were migrated to models-as-data in #13136. This re-adds it so that its flow steps are enabled again.
This commit is contained in:
@@ -2,6 +2,7 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.widget.EditText;
|
||||
import androidx.security.crypto.MasterKey;
|
||||
import androidx.security.crypto.EncryptedSharedPreferences;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -101,4 +102,11 @@ public class CleartextStorageSharedPrefsTest extends Activity {
|
||||
sharedPrefs.edit().putString("name", name).apply(); // Safe
|
||||
sharedPrefs.edit().putString("password", password).apply(); // $hasCleartextStorageSharedPrefs
|
||||
}
|
||||
|
||||
public void testSetSharedPrefs7(Context context, EditText name, EditText password) {
|
||||
SharedPreferences sharedPrefs =
|
||||
context.getSharedPreferences("user_prefs", Context.MODE_PRIVATE);
|
||||
sharedPrefs.edit().putString("name", name.getText().toString()).apply(); // Safe
|
||||
sharedPrefs.edit().putString("password", password.getText().toString()).apply(); // $hasCleartextStorageSharedPrefs
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user