Skip to content

R8 private-members still caps obfuscation at ~15% on .NET 11 GA (Google Play Feb 2027 requirement) #13603

Open

Description

@ilmian

Follow-up to #12535, which is now locked.

Numbers from a production .NET MAUI app on .NET 11 GA, for anyone tracking the Feb 2027 requirement: optimization and shrinking now pass, but obfuscation doesn't, and the cause looks structural.

Setup

  • .NET SDK 11.0.100, Microsoft.Android.Sdk.Darwin 37.2.31 (R8 9.5.26), MAUI 11.0.10, CoreCLR, Release AAB
  • <AndroidLinkTool>r8</AndroidLinkTool>, AndroidR8ObfuscationMode left at the .NET 11 default (private-members)
  • Clean obj/. Our own proguard.cfg keeps only the reflection-reached ad mediation / protobuf / coroutines packages that need it.
  • Ads: Google Mobile Ads with Meta Audience Network and Unity mediation; Firebase Analytics/Auth; MAUI Essentials

Results (BUNDLE-METADATA/com.android.tools/r8.json)

.NET 10, 36.1.118 + private-members .NET 11, 37.2.31 (default) Play threshold
Optimization 29.7% 29.4% 25%
Shrinking – 30.9% 25%
Obfuscation 16.6% 15.2% 25%

"stats":{"noObfuscationPercentage":84.83,"noOptimizationPercentage":70.59,"noShrinkingPercentage":69.15}

The field keeps from #13239 work. There were no NoSuchFieldErrors in the build, and the ~1.4 point drop from .NET 10 is about what you'd expect from keeping bound field names.

Why obfuscation is capped

R8.WriteObfuscationRules on release/11.0.1xx still emits:

-keep,allowshrinking,allowoptimization class **
-keepclassmembers,allowshrinking,allowoptimization class ** {
   public protected *;
}

So every class name and every public/protected member keeps its name. The mapping shows only 744 of 28,938 classes renamed (2.6%). Project rules can't loosen a keep rule, so there's nothing an app can add to get past this.

Shrinking the DEX below 10 MB isn't an option for us

DEX is 21.9 MB on .NET 11 and 26.8 MB on .NET 10 (shrink only). By class bytes: AndroidX + Material ~4.0 MB, Google Mobile Ads ~3.9 MB, Meta Audience Network ~2.9 MB, Firebase ~2.0 MB, Unity + protobuf ~2.0 MB, ExoPlayer ~1.6 MB, Tink (pulled in by MAUI Essentials) ~1.5 MB. The parts we can't remove are already over 10 MB.

Questions

  1. Is there a supported path to ≥25% obfuscation for apps on the default build path, i.e. not NativeAOT / trimmable typemap ([Xamarin.Android.Build.Tasks] Wire opt-in R8 runtime remapping #12692)? For example, generate class-name keeps only for types that managed code actually references (acw-map / proguard_project_references.cfg) and let R8 rename library-internal classes, which are most of the DEX in an ad-supported app.
  2. Is runtime remapping ([Xamarin.Android.Build.Tasks] Wire opt-in R8 runtime remapping #12692) planned for CoreCLR MAUI apps in a .NET 11 servicing release, and is a .NET 10 servicing backport of the obfuscation work planned?

We're happy to test a nightly or a servicing build on this app (AAB metrics plus device testing of ads mediation, Firebase, billing, Realm).

Activity

  1. added
    needs-triage
    on Nov 18, 2026
  2. removed
    needs-triage
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions