-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Android support #242
Android support #242
Conversation
src/main/java/io/netty/incubator/codec/quic/BoringSSLCertificateVerifyCallback.java
Outdated
Show resolved
Hide resolved
src/main/java/io/netty/incubator/codec/quic/QuicheQuicSslContext.java
Outdated
Show resolved
Hide resolved
@JBou can you please rebase on latest main branch ? |
Yes, I will do it tonight 👍 Have you seen the changes I requested on #249? |
@JBou no there are no comments on the PR... hmm. Can you open a PR with the requested changes ? |
@JBou ok lets rebase now |
I rebased yesterday |
@normanmaurer do you have some time to review the rest of this PR? |
@JBou yep I will do it this week. |
@JBou sorry but I need to ask you one last time to rebase :/ |
This fixes the exception: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "logf" ...
I rebased again 👍 |
@JBou thanks a lot! |
Awesome, thanks for merging! |
This reverts commit 7f1759f.
This reverts commit 7f1759f.
This PR builds and packs a .aar library for Android that contains native libraries for the currently supported ABIs. An .aar library is like a .jar library, specifically for Android, that also supports native-libraries. More on the aar file structure here.
I also added a GitHub workflow as example to build the library. A sample workflow run and the resulting .aar library attached as artifact can be found here.
The minimum Android API level is 21. It's tied to the minAPI of quiche.
Note that on API 21-23 you have to enable Java 8+ API desugaring support, otherwise the app will crash, it won't find a lambda class. On Android API Level >=24, Java 8 features used in netty-incubator-codec-quic (like lambdas) are supported and it's working without enabling desugaring.
I made a sample application here to test this out. It includes the sample server and client code from the example package and a simple Android client.
Currently, when sending messages from the Android client to the server works perfectly fine, but when receiving messages from the server on the Android client the app crashes with a native exception. The GitHub issue can be found here. It needs to be fixed to make this implementation work, but currently I don't know if the problem is caused by netty or quiche or some android specific problem. I would kindly ask your help to solve it, because I'm new to C/native programming and still had a lot to learn and fix to make this library cross-compile for Android.I changed the library name on Android to netty_quiche.so, because most of the times an Android phone supports multiple architectures and falls back to other architectures, so the name needs to be the same. Secondly, I needed to change it because the PlatformDependent class returned
netty_quiche_linux_aarch_64
on Android.We should check if the
extraCflags
,extraCxxflags
,cmakeAsmFlags
,cmakeCFlags
,cmakeCxxFlags
,cflags
,extraLdflags
are correct. I'm not quite familiar with the flags.I'm looking forward to fix this crash and make this PR work. I'm sure there are still some things to change before merging this, just let me know.
Making
QUIC
available as transport protocol for Netty on Android would be a great step forward, especially because it has some great features that are useful on mobile networks and mobile devices (such as connection migration, ...). Thanks for all of your hard work on this framework and I hope I can contribute something back to the community with this addition.