Fix Android NativeAOT test crypto JNI export#129872
Open
sbomer wants to merge 1 commit into
Open
Conversation
Keep the Android crypto trust-manager JNI callback rooted and exported for runtime NativeAOT test APKs, and re-enable the tests disabled for the missing export. Assisted-by: Copilot:gpt-5.5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Android NativeAOT test app build settings to ensure the crypto trust-manager JNI callback symbol is retained and exported from the final shared library, and re-enables previously excluded Android NativeAOT test projects.
Changes:
- Add NativeAOT
IlcArg/ linker args for exporting + forcing inclusion ofJava_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificatein Android test builds. - Remove Android NativeAOT
ProjectExclusionsforSystem.Net.Requests.TestsandSystem.Net.WebSockets.Client.Tests.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/tests.proj | Removes Android NativeAOT test exclusions for System.Net.Requests and System.Net.WebSockets.Client test projects. |
| eng/testing/tests.android.targets | Adds NativeAOT export/undefined-symbol linker arguments so the crypto JNI trust-manager callback is retained and exported in test APKs. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
This was referenced Jun 26, 2026
Open
MichalStrehovsky
approved these changes
Jun 26, 2026
Member
Author
|
/azp run runtime-android |
Member
Author
|
/azp run runtime-androidemulator |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Android NativeAOT test APK packaging so the Android crypto trust-manager JNI callback is both retained and exported from the final app shared library.
This also removes the issue 120959 Android NativeAOT test exclusions for
System.Net.Requests.TestsandSystem.Net.WebSockets.Client.Tests.For customer Android NativeAOT apps, the proper fix lives in dotnet/android’s NativeAOT packaging/linking path: it already models
libSystem.Security.Cryptography.Native.Android.awithjniOnLoadName: AndroidCryptoNative_InitLibraryOnLoadandSymbolsToPreserveforJava_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate; the Android workload should flow that metadata into the final app link/export. This runtime change is scoped to runtime test APK packaging only.Note
This pull request description was created with assistance from GitHub Copilot.