From 563d09d573ea48aa1229d46373ac4612d59671fa Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 23 Jan 2023 13:27:30 +0000 Subject: [PATCH 1/6] Update dependencies from https://github.com/dotnet/installer build 20230120.23 Microsoft.Dotnet.Sdk.Internal From Version 8.0.100-alpha.1.23063.11 -> To Version 8.0.100-alpha.1.23070.23 Dependency coherency updates Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100 From Version 8.0.100-1.23055.2 -> To Version 8.0.100-1.23067.1 (parent: Microsoft.Dotnet.Sdk.Internal --- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 8 ++++---- 2 files changed, 12 insertions(+), 12 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 From c06ab6e7f495562ea71cde2b092c2293f6637ae7 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 24 Jan 2023 13:05:09 -0600 Subject: [PATCH 2/6] Update .apkdesc files --- .../BuildReleaseArm64SimpleDotNet.apkdesc | 22 ++--- .../BuildReleaseArm64XFormsDotNet.apkdesc | 86 +++++++++---------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc index 36de188647a..107c2f39542 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc @@ -8,34 +8,34 @@ "Size": 1024 }, "assemblies/Java.Interop.dll": { - "Size": 58916 + "Size": 58913 }, "assemblies/Mono.Android.dll": { - "Size": 87170 + "Size": 87163 }, "assemblies/Mono.Android.Runtime.dll": { - "Size": 5931 + "Size": 5895 }, "assemblies/rc.bin": { "Size": 1182 }, "assemblies/System.Console.dll": { - "Size": 6586 + "Size": 6438 }, "assemblies/System.Linq.dll": { - "Size": 9252 + "Size": 9122 }, "assemblies/System.Private.CoreLib.dll": { - "Size": 517260 + "Size": 516811 }, "assemblies/System.Runtime.dll": { - "Size": 2611 + "Size": 2620 }, "assemblies/System.Runtime.InteropServices.dll": { - "Size": 2265 + "Size": 3753 }, "assemblies/UnnamedProject.dll": { - "Size": 3257 + "Size": 3219 }, "classes.dex": { "Size": 19020 @@ -47,7 +47,7 @@ "Size": 434704 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3089272 + "Size": 3090760 }, "lib/arm64-v8a/libSystem.IO.Compression.Native.so": { "Size": 723840 @@ -56,7 +56,7 @@ "Size": 94328 }, "lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": { - "Size": 152960 + "Size": 155056 }, "lib/arm64-v8a/libxamarin-app.so": { "Size": 16760 diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc index ab046791729..13a9ae3540c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc @@ -11,127 +11,127 @@ "Size": 7313 }, "assemblies/Java.Interop.dll": { - "Size": 66790 + "Size": 66786 }, "assemblies/Mono.Android.dll": { - "Size": 444768 + "Size": 444703 }, "assemblies/Mono.Android.Runtime.dll": { - "Size": 5931 + "Size": 5895 }, "assemblies/mscorlib.dll": { - "Size": 3863 + "Size": 3857 }, "assemblies/netstandard.dll": { - "Size": 5572 + "Size": 5567 }, "assemblies/rc.bin": { "Size": 1182 }, "assemblies/System.Collections.Concurrent.dll": { - "Size": 10661 + "Size": 10529 }, "assemblies/System.Collections.dll": { - "Size": 15394 + "Size": 15258 }, "assemblies/System.Collections.NonGeneric.dll": { - "Size": 7648 + "Size": 7487 }, "assemblies/System.ComponentModel.dll": { - "Size": 2151 + "Size": 1964 }, "assemblies/System.ComponentModel.Primitives.dll": { - "Size": 2641 + "Size": 2579 }, "assemblies/System.ComponentModel.TypeConverter.dll": { - "Size": 6198 + "Size": 6069 }, "assemblies/System.Console.dll": { - "Size": 6750 + "Size": 6610 }, "assemblies/System.Core.dll": { - "Size": 1988 + "Size": 1982 }, "assemblies/System.Diagnostics.TraceSource.dll": { - "Size": 6738 + "Size": 6580 }, "assemblies/System.dll": { - "Size": 2344 + "Size": 2338 }, "assemblies/System.Drawing.dll": { - "Size": 2029 + "Size": 2023 }, "assemblies/System.Drawing.Primitives.dll": { - "Size": 12091 + "Size": 11996 }, "assemblies/System.IO.Compression.dll": { - "Size": 16975 + "Size": 16847 }, "assemblies/System.IO.IsolatedStorage.dll": { - "Size": 10151 + "Size": 9957 }, "assemblies/System.Linq.dll": { - "Size": 19591 + "Size": 19441 }, "assemblies/System.Linq.Expressions.dll": { - "Size": 163969 + "Size": 164128 }, "assemblies/System.Net.Http.dll": { - "Size": 66013 + "Size": 65982 }, "assemblies/System.Net.Primitives.dll": { - "Size": 22534 + "Size": 22441 }, "assemblies/System.Net.Requests.dll": { - "Size": 3738 + "Size": 3620 }, "assemblies/System.ObjectModel.dll": { - "Size": 8186 + "Size": 8144 }, "assemblies/System.Private.CoreLib.dll": { - "Size": 805075 + "Size": 808708 }, "assemblies/System.Private.DataContractSerialization.dll": { - "Size": 192436 + "Size": 192356 }, "assemblies/System.Private.Uri.dll": { - "Size": 42864 + "Size": 42878 }, "assemblies/System.Private.Xml.dll": { - "Size": 215941 + "Size": 216193 }, "assemblies/System.Private.Xml.Linq.dll": { - "Size": 16796 + "Size": 16662 }, "assemblies/System.Runtime.dll": { - "Size": 2756 + "Size": 2763 }, "assemblies/System.Runtime.InteropServices.dll": { - "Size": 2265 + "Size": 3753 }, "assemblies/System.Runtime.Serialization.dll": { - "Size": 1950 + "Size": 1943 }, "assemblies/System.Runtime.Serialization.Formatters.dll": { - "Size": 2677 + "Size": 2509 }, "assemblies/System.Runtime.Serialization.Primitives.dll": { - "Size": 3847 + "Size": 3791 }, "assemblies/System.Security.Cryptography.dll": { - "Size": 7900 + "Size": 7766 }, "assemblies/System.Text.RegularExpressions.dll": { - "Size": 156731 + "Size": 156677 }, "assemblies/System.Xml.dll": { - "Size": 1839 + "Size": 1833 }, "assemblies/System.Xml.Linq.dll": { - "Size": 1862 + "Size": 1856 }, "assemblies/UnnamedProject.dll": { - "Size": 5335 + "Size": 5294 }, "assemblies/Xamarin.AndroidX.Activity.dll": { "Size": 5870 @@ -209,7 +209,7 @@ "Size": 434704 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3089272 + "Size": 3090760 }, "lib/arm64-v8a/libSystem.IO.Compression.Native.so": { "Size": 723840 @@ -218,7 +218,7 @@ "Size": 94328 }, "lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": { - "Size": 152960 + "Size": 155056 }, "lib/arm64-v8a/libxamarin-app.so": { "Size": 333760 @@ -1976,5 +1976,5 @@ "Size": 341228 } }, - "PackageSize": 7824132 + "PackageSize": 7828228 } \ No newline at end of file From a197ed02b2dcc4f0249f08098cb080a74854db8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Rozs=C3=ADval?= Date: Thu, 26 Jan 2023 19:14:48 +0100 Subject: [PATCH 3/6] Use .jar files from the .NET runtime pack (#7665) Since https://github.com/dotnet/runtime/pull/77386 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. I'm not sure if this is the best way to pull the .jar from the runtimepack so feedback is welcome. * Collect jar files from the runtime pack * Remove invalid dependency --- .../Xamarin.Android.Common.targets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 70a86d1ecab..c275a836fff 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1388,6 +1388,12 @@ because xbuild doesn't support framework reference assemblies. + + + + + + <_RuntimeJar Condition=" '$(UsingAndroidNETSdk)' != 'True' ">$(MSBuildThisFileDirectory)\java_runtime.jar @@ -1909,6 +1915,7 @@ because xbuild doesn't support framework reference assemblies. <_CompileJavaDependsOnTargets> + _CollectRuntimePackJarFiles; _AdjustJavacVersionArguments; _GeneratePackageManagerJava; _FindJavaStubFiles; From e003e67d947c266dd0183f2e47a3611c24ea4e3b Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 26 Jan 2023 12:59:54 -0600 Subject: [PATCH 4/6] Disambiguate `.jar` files from Mono runtime packs We currently get 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. --- ...oft.Android.Sdk.AssemblyResolution.targets | 3 +++ .../Tasks/ProcessAssemblies.cs | 24 ++++++++++++++++--- .../Xamarin.Android.Common.targets | 7 ------ 3 files changed, 24 insertions(+), 10 deletions(-) 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/Tasks/ProcessAssemblies.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs index d7e2d101c20..39c3dc52238 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.TryGetValue (name, out var javaLibrary)) { + javaLibraries [name] = item; + } + } + OutputJavaLibraries = javaLibraries.Values.ToArray (); + } + return !Log.HasLoggedErrors; } @@ -112,7 +130,7 @@ void SetMetadataForAssemblies (List output, Dictionary output, Dictionary output, Dictionary - - - - - - <_RuntimeJar Condition=" '$(UsingAndroidNETSdk)' != 'True' ">$(MSBuildThisFileDirectory)\java_runtime.jar @@ -1915,7 +1909,6 @@ because xbuild doesn't support framework reference assemblies. <_CompileJavaDependsOnTargets> - _CollectRuntimePackJarFiles; _AdjustJavacVersionArguments; _GeneratePackageManagerJava; _FindJavaStubFiles; From 4069fe35d14890e7c3181f980c16b1fa403f9870 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 26 Jan 2023 13:27:20 -0600 Subject: [PATCH 5/6] Use ContainsKey instead --- src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs index 39c3dc52238..80d16a1f72c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessAssemblies.cs @@ -89,7 +89,7 @@ public override bool RunTask () if (!IsFromAKnownRuntimePack (item)) continue; var name = Path.GetFileNameWithoutExtension(item.ItemSpec); - if (!javaLibraries.TryGetValue (name, out var javaLibrary)) { + if (!javaLibraries.ContainsKey (name)) { javaLibraries [name] = item; } } From 262c19b2fe07bda91b55bd871ea08607abf6157f Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 27 Jan 2023 13:37:13 -0600 Subject: [PATCH 6/6] Update proguard_xamarin.cfg --- src/Xamarin.Android.Build.Tasks/Resources/proguard_xamarin.cfg | 3 +++ 1 file changed, 3 insertions(+) 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*(...);