Enable symbolication and source context for net9.0-android#4033
Merged
jamescrosswell merged 51 commits intomainfrom Apr 2, 2025
Merged
Enable symbolication and source context for net9.0-android#4033jamescrosswell merged 51 commits intomainfrom
jamescrosswell merged 51 commits intomainfrom
Conversation
Contributor
|
With all the vendored-in code this is pretty hard to review. Can you link a diff showing your changes to the vendored code? |
ShortDevelopment
added a commit
to nearby-sharing/android
that referenced
this pull request
Apr 6, 2025
Should fix `net-9.0` symbolication on android getsentry/sentry-dotnet#4033
This was referenced Aug 18, 2025
This was referenced Sep 8, 2025
This was referenced Sep 15, 2025
This was referenced Oct 6, 2025
This was referenced Oct 20, 2025
This was referenced Nov 3, 2025
This was referenced Dec 8, 2025
This was referenced Dec 15, 2025
This was referenced Jan 18, 2026
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.
Closes #3761:
Fixes #3983:
Fixes #3985:
Summary
.NET 9 does introduced a new AssemblyStore format for APK files. Reading the new format is demonstrated in assembly-store-reader-mk2. This PR adds support for reading the new format to the
AndroidAssemblyReaderFactory.Also, the reason we didn't pick this up when we moved to
net9.0is that the device tests are/were only running againstnet8.0targets. In this PR we'll try to run the device tests onnet8.0-android/iosandnet9.0-android/ios.Notes for Reviewers
There's a lot of code here. However most of it is simply copied/vendored in from two external repositories.
ELFSharp
For the purposes of review, you can ignore all of the files in the "src/Sentry.Android.AssemblyReader/ELFSharp" folder.
The V2 format for APKs stores all assemblies in in an RID specific folder but Android requires all files in that folder to be ELF files... so during the build process any exe, dll, pdb or config files stored in there get "packed" into ELF files... we need to use ElfSharp to unpack these.
To avoid adding any dependencies, the code for ELFSharp has been copied in to the Sentry.Android.AssemblyReader project (with appropriate attribution).
dotnet/android
For the purposes of review, you can ignore most of the files in the "src/Sentry.Android.AssemblyReader/V2" folder.
src/Sentry.Android.AssemblyReader/V2/AndroidAssemblyStoreReaderV2.csandAndroidAssemblyDirectoryReaderV2are classes I wrote (althoughAndroidAssemblyDirectoryReaderV2.ArchiveAssemblyHelperwas vendored in). Otherwise, all of the files insrc/Sentry.Android.AssemblyReader/V2have been copied from thedotnet/androidrepo, with appropriate attribution at the top of each file.No functional changes were made to any of that code. The only alterations were:
publictointernalXamarin.LibZipSharp(using the built in ZipFile class instead)Ctrl + .in resharper to get the code to conform to our coding conventionsReferences
Relates to: