Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[One .NET] Do not preserve IO stream adapter/invoker (dotnet#5449)
Context: dotnet#5167 Context: dotnet#5206 The following types are accessed through the `CallbackCode` type in `src/Mono.Android.Export` via System.Reflection: * `Android.Runtime.InputStreamAdapter` * `Android.Runtime.InputStreamInvoker` * `Android.Runtime.OutputStreamAdapter` * `Android.Runtime.OutputStreamInvoker` Historically the use of these types via Reflection required that they always be preserved, just in case `Mono.Android.Export.dll` was used. .NET 6 ILLink is able to detect such reflection use. These types no longer need to be explicitly preserved in all circumstances. Stop explicitly preserving these types, and rely on ILLink to preserve them when `Mono.Android.Export.dll` is used. This change reduces the `.apk` size in a common situation, when `Mono.Android.Export.dll` is not used. apk size comparison, BuildReleaseArm64False test: > apkdiff -f -e dll$ before.apk after.apk Size difference in bytes ([*1] apk1 only, [*2] apk2 only): - 80 assemblies/System.Console.dll - 129 assemblies/Java.Interop.dll - 1,237 assemblies/System.Private.CoreLib.dll - 6,093 assemblies/Mono.Android.dll Summary: - 7,539 Assemblies -1.01% (of 749,078)
- Loading branch information