mirror of
https://github.com/github/codeql.git
synced 2026-04-18 05:24:01 +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:
4
java/ql/lib/change-notes/2024-02-23-widget-flowsteps.md
Normal file
4
java/ql/lib/change-notes/2024-02-23-widget-flowsteps.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: fix
|
||||
---
|
||||
* Some flow steps related to `android.text.Editable.toString` that were accidentally disabled have been re-enabled.
|
||||
@@ -14,6 +14,7 @@ private module Frameworks {
|
||||
private import semmle.code.java.frameworks.android.Intent
|
||||
private import semmle.code.java.frameworks.android.Slice
|
||||
private import semmle.code.java.frameworks.android.SQLite
|
||||
private import semmle.code.java.frameworks.android.Widget
|
||||
private import semmle.code.java.frameworks.apache.Lang
|
||||
private import semmle.code.java.frameworks.ApacheHttp
|
||||
private import semmle.code.java.frameworks.guava.Guava
|
||||
|
||||
@@ -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