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

Abierto
#737 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
android, kotlin, swift

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?
Lenguaje dominante
Swift
Estrellas
3.3k
Forks
115
Merge medio
1 d 15 h
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de skiptools/skip

Todos los issues de skiptools/skip

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.