-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSec works on .NET MAUI (Android) #81
Comments
This isn't an issue, but since theres no discussions tab I decided to post it here. |
…oid support. The Android part comes from here (assuming I'm interpreting it correctly): ektrah/nsec#81
That's great to hear! Does every application have to have its own libsodium.so with a BuildAction of AndroidNativeLibrary or is there maybe a way to wrap this all up and offer it as a NuGet package? If the latter, we could add this to the libsodium NuGet package. Sorry, I'm not very familiar with .NET on Android. |
I didn't understand a single F# 😢 I just needed to know if it could be used in MAUI Android (and now I know it can). 🤟 So, thank you very much for the information. I know that to understand what you're saying, I need to learn all the 'dark magic' of If at some point in your life; you can provide a step-by-step guide, I would greatly appreciate it, as where I'm from, there's no one who knows how to help me. ❤ |
Hello,
I got NSec working on Android.
For it to work, I had to edit NSec, remove the reference to libsodium and edit src/Interop/Interop.Libraries.cs, changing "libsodium" to "libsodium.so", then use that edited NSec with MAUI.
After that, I had to compile libsodium from source for android, grab the .so it built (the files along with it, like libsodium.a etc. aren't needed) and then put it inside the project, inside a folder called "arm64-v8a" that's inside a folder called "lib". The libsodium.so also had to have BuildAction of AndroidNativeLibrary.
The reason I had to remove the reference to libsodium was because, with it, the compiler would add the libsodium.so for linux aarch64 and not our custom android one, which the libsodium nuget package didn't contain. The reason Interop.Libraries.cs had to be modified was because MAUI wouldn't find "libsodium" if it was passed to DllImport, but it would find libsodium.so.
The text was updated successfully, but these errors were encountered: