From 35db5272e555c2ac3e8d0c6e4ab82efb6a3b313d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 28 Jan 2023 14:46:53 -0600 Subject: [PATCH] Bump to dotnet/installer/main@779a644 8.0.100-alpha.1.23070.23 (#7728) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: https://github.com/dotnet/installer/compare/9962c6a...779a644 Changes: https://github.com/dotnet/linker/compare/4b3f78c...c790896 Changes: https://github.com/dotnet/runtime/compare/5da4a9e...ddb6988 Changes: https://github.com/dotnet/emsdk/compare/66b9845...5b46122 Updates: * Microsoft.Dotnet.Sdk.Internal: from 8.0.100-alpha.1.23063.11 to 8.0.100-alpha.1.23070.23 * Microsoft.NET.ILLink.Tasks: from 8.0.100-1.23055.2 to 8.0.100-1.23067.1 * Microsoft.NETCore.App.Ref: from 8.0.0-alpha.1.23058.2 to 8.0.0-alpha.1.23070.1 * Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100: from 8.0.0-alpha.1.22620.1 to 8.0.0-alpha.1.23066.1 ~~ Other Changes ~~ * Update `.apkdesc` files for app size changes. * Use .jar files from the .NET runtime pack (#7665) Since [dotnet/runtime#77386][0] has been merged, .NET will require a certain class from `libSystem.Security.Cryptography.Native.Android.jar` that will be located in the runtime pack files. [0]: https://github.com/dotnet/runtime/pull/77386 * Disambiguate `.jar` files from Mono runtime packs. We were getting the build error: error JAVA0000: Caused by: com.android.tools.r8.internal.f: Type net.dot.android.crypto.DotnetProxyTrustManager is defined multiple times This `.jar` file is contained in each runtime pack (4 architectures) gives us 4 `.jar` files! We can pass in these files to the `` MSBuild task. We also filter them based on `%(NuGetPackageId)`, so that any random `.jar` file doesn't get added to `@(AndroidJavaLibrary)`. I renamed the `IsFrameworkAssembly()` method to `IsFromAKnownRuntimePack()` to make this more clear in the existing code. * Update `proguard_xamarin.cfg` for .NET 8. Apps using `$(AndroidLinkTool)` of r8, now need to preserve: -keep class net.dot.android.crypto.DotnetProxyTrustManager { *; (...); } Otherwise we run into a crash when this type isn't present, such as: 01-26 23:59:19.855 8684 8684 F DEBUG : #02 pc 00000000000191d6 /data/app/Mono.Android.NET_Tests-cpTzt8Q9KwgS-znzkuAdNQ==/split_config.x86_64.apk!libSystem.Security.Cryptography.Native.Android.so (offset 0xe7000) (JNI_OnLoad+31302) (BuildId: 7d9e4013a9dd99810070587ab42956703fef69f9) Co-authored-by: Jonathan Peppers Co-authored-by: Šimon Rozsíval --- eng/Version.Details.xml | 16 ++-- eng/Versions.props | 8 +- ...oft.Android.Sdk.AssemblyResolution.targets | 3 + .../Resources/proguard_xamarin.cfg | 3 + .../Tasks/ProcessAssemblies.cs | 24 +++++- .../BuildReleaseArm64SimpleDotNet.apkdesc | 20 ++--- .../BuildReleaseArm64XFormsDotNet.apkdesc | 84 +++++++++---------- 7 files changed, 91 insertions(+), 67 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 352d199e59e..4907216b6f3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,20 +1,20 @@ - + https://github.com/dotnet/installer - 9962c6a686a31ba1e7c20983a810ba7989c3fc0c + 779a6442daf6b95c5662d2f0c20801de5e179a05 - + https://github.com/dotnet/linker - 4b3f78cbc7284b4198652a695e9fe0267133728e + c790896f128957acd2999208f44f09ae1e826c8c - + https://github.com/dotnet/runtime - 5da4a9e919dcee35f831ab69b6e475baaf798875 + ddb69889684da95dc8d83a51b987774de5e47598 - + https://github.com/dotnet/emsdk - 66b984594a008151bdb14dc60589373e3d44be83 + 5b46122b31036064483ce2e55b5e2240e5548204 diff --git a/eng/Versions.props b/eng/Versions.props index 0ec50925fb4..b6912ea71dc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,12 +1,12 @@ - 8.0.100-alpha.1.23063.11 - 8.0.100-1.23055.2 - 8.0.0-alpha.1.23058.2 + 8.0.100-alpha.1.23070.23 + 8.0.100-1.23067.1 + 8.0.0-alpha.1.23070.1 7.0.0-beta.22103.1 7.0.0-beta.22103.1 - 8.0.0-alpha.1.22620.1 + 8.0.0-alpha.1.23066.1 $(MicrosoftNETWorkloadEmscriptennet7Manifest80100Version) 7.0.100-rc.1.22410.7 diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index d0845544971..a79e8081604 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -116,14 +116,17 @@ _ResolveAssemblies MSBuild target. <_ResolvedAssemblyFiles Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.dll' " /> <_ResolvedSymbolFiles Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.pdb' " /> + <_ResolvedJavaLibraries Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.jar' " /> + diff --git a/src/Xamarin.Android.Build.Tasks/Resources/proguard_xamarin.cfg b/src/Xamarin.Android.Build.Tasks/Resources/proguard_xamarin.cfg index 87c29d8f212..c0616acdcc7 100644 --- a/src/Xamarin.Android.Build.Tasks/Resources/proguard_xamarin.cfg +++ b/src/Xamarin.Android.Build.Tasks/Resources/proguard_xamarin.cfg @@ -25,6 +25,9 @@ -keep class md52ce486a14f4bcd95899665e9d932190b.** { *; (...); } -keepclassmembers class md52ce486a14f4bcd95899665e9d932190b.** { *; (...); } +# .NET 8 runtime +-keep class net.dot.android.crypto.DotnetProxyTrustManager { *; (...); } + # Android's template misses fluent setters... -keepclassmembers class * extends android.view.View { *** set*(...); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs index d7e2d101c20..80d16a1f72c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs @@ -32,9 +32,14 @@ public class ProcessAssemblies : AndroidTask public ITaskItem [] InputAssemblies { get; set; } = Array.Empty (); + public ITaskItem [] InputJavaLibraries { get; set; } = Array.Empty (); + [Output] public ITaskItem []? OutputAssemblies { get; set; } + [Output] + public ITaskItem []? OutputJavaLibraries { get; set; } + [Output] public ITaskItem []? ShrunkAssemblies { get; set; } @@ -78,6 +83,19 @@ public override bool RunTask () ShrunkAssemblies = shrunkAssemblies.ToArray (); } + if (InputJavaLibraries != null) { + var javaLibraries = new Dictionary (StringComparer.OrdinalIgnoreCase); + foreach (var item in InputJavaLibraries) { + if (!IsFromAKnownRuntimePack (item)) + continue; + var name = Path.GetFileNameWithoutExtension(item.ItemSpec); + if (!javaLibraries.ContainsKey (name)) { + javaLibraries [name] = item; + } + } + OutputJavaLibraries = javaLibraries.Values.ToArray (); + } + return !Log.HasLoggedErrors; } @@ -112,7 +130,7 @@ void SetMetadataForAssemblies (List output, Dictionary output, Dictionary output, Dictionary