secure-preferences icon indicating copy to clipboard operation
secure-preferences copied to clipboard

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

Open i-m-aman opened this issue 5 years ago • 10 comments

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.

i-m-aman avatar Jul 15 '19 14:07 i-m-aman

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

samratshaw avatar Jul 22 '19 08:07 samratshaw

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.

i-m-aman avatar Aug 18 '19 23:08 i-m-aman

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.

scottyab avatar Aug 30 '19 14:08 scottyab

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

kkazakov avatar Sep 13 '19 13:09 kkazakov

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

dzungpv avatar Sep 20 '19 07:09 dzungpv

@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 :)

kkazakov avatar Sep 20 '19 13:09 kkazakov

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.

umeshNova avatar Jan 22 '20 18:01 umeshNova

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 :)

codemonk03 avatar Jan 23 '20 06:01 codemonk03

Any update on this?

kartik1225 avatar Apr 27 '20 13:04 kartik1225

@scottyab is not released yet v0.1.8?

shahnawazahmed88 avatar Mar 23 '21 09:03 shahnawazahmed88