Skip to content
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

Open
kerosina opened this issue Jun 29, 2024 · 1 comment
Open

NSec works on .NET MAUI (Android) #81

kerosina opened this issue Jun 29, 2024 · 1 comment

Comments

@kerosina
Copy link

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.

@kerosina
Copy link
Author

This isn't an issue, but since theres no discussions tab I decided to post it here.

samuel-lucas6 added a commit to samuel-lucas6/Geralt that referenced this issue Aug 17, 2024
…oid support.

The Android part comes from here (assuming I'm interpreting it correctly): ektrah/nsec#81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant