Merge pull request #15709 from atorralba/atorralba/java/enable-widget-taint-steps

Java: Re-enable Widget.qll flow steps
This commit is contained in:
Tony Torralba
2024-02-29 17:33:05 +01:00
committed by GitHub
3 changed files with 13 additions and 0 deletions

View File

@@ -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
}
}