diff --git a/osu.Android.props b/osu.Android.props index d1539915e4c3..69d76e81b4b9 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -93,28 +93,50 @@ libbass*.so coming from ppy.osu.Framework.Android's AAR (jni/arm64-v8a/). The Linux ELF is linked against glibc and cannot be loaded by Android's bionic dynamic linker, which surfaces at startup as System.DllNotFoundException: bass from AudioManager..ctor → - ManagedBass.Bass.get_DeviceCount, immediately crashing the app. --> + ManagedBass.Bass.get_DeviceCount, immediately crashing the app. + + Implementation notes: + * Uses a two-step item helper list + Remove-by-identity pattern, which batches + over item metadata reliably (an earlier inline `Remove="@(X)" Condition="…"` + with a nested OR of Replace/Contains calls silently no-op'd — the Linux libbass + leaked into the APK in build v2026.421.144). + * Uses a single inverted match: any `.so` under `/runtimes//native/` whose + RID does not start with `android` is stripped. This covers every non-Android + desktop/mobile RID in one rule and is future-proof against new RIDs. + * The path match uses forward-slash normalisation with the doubled-backslash + escape `'\\'` required inside MSBuild property-function string literals + (the previous `'\'` form is ambiguous to the expression parser). + * Applied to `ResolvedFileToPublish` (the primary input to the .NET Android SDK's + publish step) and also to `ReferenceCopyLocalPaths` / `RuntimeCopyLocalItems` + in case a NuGet package flows native assets through those collections. --> - - - + + <_DesktopNativeToStripFromPublish Include="@(ResolvedFileToPublish)" + Condition="'%(Extension)' == '.so' + AND $([System.String]::Copy('%(Identity)').Replace('\\','/').Contains('/runtimes/')) + AND !$([System.String]::Copy('%(Identity)').Replace('\\','/').Contains('/runtimes/android'))" /> + + + <_DesktopNativeToStripFromRefCopy Include="@(ReferenceCopyLocalPaths)" + Condition="'%(Extension)' == '.so' + AND $([System.String]::Copy('%(Identity)').Replace('\\','/').Contains('/runtimes/')) + AND !$([System.String]::Copy('%(Identity)').Replace('\\','/').Contains('/runtimes/android'))" /> + + + <_DesktopNativeToStripFromRuntimeCopy Include="@(RuntimeCopyLocalItems)" + Condition="'%(Extension)' == '.so' + AND $([System.String]::Copy('%(Identity)').Replace('\\','/').Contains('/runtimes/')) + AND !$([System.String]::Copy('%(Identity)').Replace('\\','/').Contains('/runtimes/android'))" /> + + +