Skip to content
This repository was archived by the owner on Mar 1, 2022. It is now read-only.
This repository was archived by the owner on Mar 1, 2022. It is now read-only.

Hashing the keys broke the getAll() and onSharedPreferenceChanged(SharedPreferences, String) methods #85

@awasisto

Description

@awasisto

The keys returned by the SecurePreferences#getAll() method or passed through the OnSharedPreferenceChangeListener#onSharedPreferenceChanged(SharedPreferences, String) method are the hashed keys instead of the real keys.

Example:

SharedPreferences preferences = new SecurePreferences(getContext());
    
preferences.edit().putString("userBirthPlace", "Mars").apply();
preferences.edit().putString("userFavouriteAnimal", "Unicorn").apply();
    
System.out.println(preferences.getAll());

/*
 * Output: {/ntTe3/atqHnZpVLXZFdZCh1kXCeMNI4ZxZakEmn46M==Unicorn, EKfKV82MWU69SaHA6DzF5LIJ2m6EhElrylXmoC4qFkY==Mars}
 */

I think the keys shouldn't be hashed since they shouldn't contain any user data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions