scottyab / secure-preferences

Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure.
1.53k stars 235 forks source link

After updating to Android Q, i am not able to retrieve the data from the Secure preferences? #98

Open i-m-aman opened 5 years ago

i-m-aman commented 5 years ago

I upgraded my device to Android Q and now I am not able to retrieve the data stored in the SecurePreferences. Android Q release mode is around the corner and now it will be a disaster for my users if they are not able to see their data which is empty.

Please tell me if there is any way to tackle this bug.

samratshaw commented 5 years ago

@deathstroke007 Android Q does not allow developers to retrieve Device Serial number anymore. Thus you need to migrate your existing application data to the new version of the library, where you will need to pass your own data.

I will be creating a PR explaining how we can migrate to the new version of the library & your existing data (if we can still access Serial Number).

Will tag in once completed.

i-m-aman commented 5 years ago

is there a new version of the library? I am afraid there isn't any new release for this project. I have been using v0.1.7 which I think is the latest one. Anyways I am using another library which is working fine as of now. And you cannot get the Serial Number from Android Q. Google won't let you since it is a non-resettable identifier. Looking forward to the new release with the fix. Instead of Serial Number, you can use the Device ID which I think is the safest way to get the unique identifier (unique for every Application from Android 8.0.0).

Appreciate your reply though.

scottyab commented 5 years ago

new version 0.1.8 incoming to fix the crash on Android Q/10 (thanks for reporting). However If you are using the default Salt (which is Device Serial) I don't see that there's any way to add a migration option to decrypt previousily encrypted values as once the device upgraded to Android Q, they'll be no way to decrypt the values encrypted. Only suggestion is to migrate now to a Salt you provide yourself via contructor. I'll see if I can create a gist of how to, unless someone else beats me to in.

kkazakov commented 5 years ago

@scottyab we really need the migration guide ... more and more users are upgrading to Android Q and we're losing them.

dzungpv commented 5 years ago

@kkazakov since Android Q not possible to get serial and you use it to store user data, so before user update to Q,, release and update and store the serial in normal preference, after update to 10 you use it as salt and you read serial not from user device but preference.

kkazakov commented 5 years ago

@scottyab I know that ... I had to do a workaround and did "migration" pre- Android 10 and it works when they update, with 1.0.7 now. I just had to dig deeper to find out how it works, but managed it :)

umeshNova commented 4 years ago

hello, @scottyab its a really nice library and I really appreciate your efforts.

I see that you have given the fix to this and this has been updated in the list of changes as 0.1.8. But it was never released. Can you please release it over maven, if this is stable. Again, I appreciate your help.

codemonk03 commented 4 years ago

Hey, @scottyab ! Appreciate this awesome library.. I see that v0.1.8, which has the Android 10 fix, is marked released but not yet pushed to maven central. Could you also give an update there if all good??

Thanks :)

kartik1225 commented 4 years ago

Any update on this?

shahnawazahmed88 commented 3 years ago

@scottyab is not released yet v0.1.8?