Skip Lite: Auto-generated -keep class <app.package>.** { *; } in the transpiled module's proguard-rules.pro blocks R8 shrinking/obfuscation/optimization for the entire app, triggering Google Play's "DEX code optimization is below our threshold" warning

Open
#737 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
android, kotlin, swift

Research direction

Start by locating the generation of the per-module proguard-rules.pro and compare its behavior for transpiled-mode and Skip Fuse projects. Investigate whether skip.bridge.** and ModuleBundleAccessor require the blanket rule, and check the available skip.yml or build settings. Done means the generated rules can be narrowed or customized without breaking required runtime behavior.

Written by the indexing model from the issue text.

Description

Summary

Google Play Console now flags apps whose R8 optimization/obfuscation/shrinking percentages fall under 25%, with an enforcement deadline:

DEX code optimization is below our threshold
Improve your percentages in the following categories:

  • Obfuscation (24%)
  • Shrinking (24%)

Percentages under 25% in any category of your app may impact your visibility and publishing capabilities on Google Play. To prevent this, optimize your app by the deadline.

Release name: 245 (2.35.1)
Fix by: Feb 2027

Investigating why our percentages were so low, we found that the Skip Gradle plugin auto-generates a proguard-rules.pro for the app's own transpiled module (<TargetName>) that includes a blanket:

-keep class <app.package>.** { *; }

This covers essentially our entire transpiled app code (100% of our own classes).

We inspected our transpiled Kotlin app code to understand why this keep might be required:

  • Codable/Decodable conformance is transpiled into explicit, compiler-generated encode(to:)/init(from:) methods with a CodingKeys enum holding hardcoded JSON key strings (e.g. container.encode(householdId, forKey = CodingKeys.householdId), where CodingKeys.householdId.rawValue == "household_id"). This is not name-based reflection — the Kotlin property name and the JSON key are decoupled, so renaming/obfuscating properties doesn't break (de)serialization.
  • We found zero uses of Class.forName, getDeclaredField, ::class.simpleName, or other string-based reflection over our own app classes anywhere in the transpiled output.

So for at least the common case (plain Codable model structs, view models, business logic), a full -keep ... { *; } over the entire app package looks like defensive boilerplate rather than a real requirement — but since we don't know the full set of reasons Skip's runtime might reflect over the app's own module (e.g. skip.bridge.** interfaces, _ModuleBundleAccessor_, JNA-based interop), we didn't want to blindly rip it out without guidance from the maintainers.

We raised this in the Slack and got the response that this is a "moot point" since "most of the code is native." We believe that reasoning applies to Skip Fuse projects (native Swift binary + thin JNI bridge, where the JVM-side classes genuinely are minimal and DEX metrics matter less) rather than to transpiled projects like ours, where the entire app is ordinary Kotlin/DEX bytecode and fully subject to (and currently fully exempted from) R8's passes. We wanted to raise this explicitly in case the generated ruleset doesn't currently distinguish between the two build modes.

Impact

Because this rule is regenerated by the toolchain itself (not something we authored), every transpiled-mode Skip Android app is presumably hitting the same Play Console warning, with the same Feb 2027 enforcement deadline for "visibility and publishing capabilities."

Ask
  • Could the generated per-module proguard-rules.pro scope its -keep more narrowly than <app.package>.** { *; } for transpiled-mode projects — e.g. -keep,allowobfuscation,allowoptimization,allowshrinking for classes that don't need name preservation, or an explicit allowlist for the specific bridging mechanisms that actually require it (skip.bridge.** implementers, _ModuleBundleAccessor_, etc.)?
  • Alternatively, is there a supported skip.yml/build setting to opt out of or customize this generated keep rule per-project, so transpiled apps that don't rely on reflection over their own generated code can shrink/obfuscate/optimize normally?
  • If this rule is required for correctness in the general case, could you point to what specifically depends on it, so we can evaluate whether it's safe to narrow for our project's ruleset instead?
Dominant language
Swift
Stars
3.3k
Forks
115
Avg merge
1d 15h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from skiptools/skip

All issues in skiptools/skip

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.