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

オープン
#737 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
android, kotlin, swift

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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?
主要言語
Swift
スター
3.3k
フォーク
115
平均マージ
1日 15時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

skiptools/skip のほかの issue

skiptools/skip の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。