Closed ssbssb-cmd closed 1 month ago
Hey - has anyone else experienced this? or found any workaround
Hi all - anyone else facing this? Am blocked with migrating from xamarin to MAUI at the moment and struggling to work out how to investigate this further or fix
Seen a similar thing I think.
One thing that I'm not sure about, the example code for migration in the AndroidKeyStore code has a call to
LegacySecureStorage.RemoveAll();
This will fire in the first 'Get' call to get a single key (the first decrypt).
This seems - odd. Surely its going to clear all saved secure storage keys the moment you try and get 1, so only the first might work? 🤷
I'm also currently working in the migration of old SecureStorage items to MAUI and see the same incorrect behaviour. I'm not sure if I missed an important step, but I followed the linked documentation and it's still not working.
@ssbssb-cmd I think I found a solution! Based on a comment here (https://github.com/jfversluis/Plugin.Maui.FormsMigration/issues/1#issuecomment-1887524054) I created a signing key for my debug configuration (I followed https://learn.microsoft.com/en-us/dotnet/maui/android/deployment/publish-cli?view=net-maui-8.0) and signed the Xamarin.Forms based app as well as the MAUI based app with the same keystore...and it worked!
If you're migrating an android app surely you need to be signing it with the same key, otherwise you're not going to be able to upload to the playstore or install and update over the top?
If you're migrating an android app surely you need to be signing it with the same key, otherwise you're not going to be able to upload to the playstore or install and update over the top?
yeah, that's true. But (at least in my case) we had the issue in an unsigned debug build as a proof-of-concept if the migration is working. Therefore I was just not aware that even this build needs to be signed already
@ssbssb-cmd I think I found a solution! Based on a comment here (jfversluis/Plugin.Maui.FormsMigration#1 (comment)) I created a signing key for my debug configuration (I followed https://learn.microsoft.com/en-us/dotnet/maui/android/deployment/publish-cli?view=net-maui-8.0) and signed the Xamarin.Forms based app as well as the MAUI based app with the same keystore...and it worked!
OK great - i will give it a go! Did you have to do it via command line? Or is there someway within Visual Studio Mac to sign the debug package with the prod key?
Hey - just wanted to check-in on this, how would I be able sign the debug build with the release / production key?
It's been a long time since I've done it but you should able to create a local signing key and upload it to the playstore to use as the signing key - so all builds can be signed the same
As pointed out, make sure all is the same. I'm pretty sure all will work as intended then. If something still doesn't seem right, please open a new issue, thanks!
Description
Followed the steps here to migrate entries from Xamarin SecureStorage into MAUI SecureStorage, but it is always returning null
https://learn.microsoft.com/en-us/dotnet/maui/migration/secure-storage?view=net-maui-8.0
Steps to Reproduce
Create a new MAUI app
Copy paste the code from https://learn.microsoft.com/en-us/dotnet/maui/migration/secure-storage?view=net-maui-8.0, creating new classes for AndroidKeyStore, LegacySecureStorage, KeyChain
Try and retrieve the token
On Android It is returning null
Link to public reproduction project repository
No response
Version with bug
8.0.6 SR1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Not yet
Relevant log output
No response