0
我有问题在SharedPreference中加密我的数据,这是我当前的SharedPreference,保存数据未加密。我不知道什么加密数据。如何将列表数据加密到SharedPreference
public class MySharedPreference {
//this is name PREFS_NAME
public static final String PREFS_NAME = "LIST_CARD";
//this is CARD where are save data Card
public static final String CARD = "CARD";
public MySharedPreference() {
super();
}
//this is functon witch save array list to Sharepreference
public void saveCardToSharedPreference(Context context, ArrayList<Card> cardList) {
SharedPreferences settings;
SharedPreferences.Editor editor;
settings = context.getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
editor = settings.edit();
Gson gson = new Gson();
String jsonString = gson.toJson(cardList);
editor.putString(CARD, jsonString);
editor.commit();
}
}