Skip to content

Commit 6e581c4

Browse files
Thanos update 2
Updated ProGuard rules for Flutter engine integration and FOSS compliance. Optimized the keep rules for embedding classes and corrected syntax for deferred components.
1 parent e94bbc5 commit 6e581c4

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

mobile/android/app/proguard-rules.pro

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,23 @@
2525
-keep class com.google.gson.** { *; }
2626
-dontwarn com.google.gson.**
2727

28-
# 4. FLUTTER ENGINE & NATIVE PLUGINS INTEGRATION (Minimized optimization scope)
29-
# Keep the core embedding engine classes required for application initialization
30-
-keep class io.flutter.embedding.** { *; }
28+
# 4. FLUTTER ENGINE & NATIVE PLUGINS INTEGRATION (Optimized optimization scope)
29+
# REPLACED BROAD EMBEDDING KEEP RULE: Allows R8 to strip unused embedding classes (like SplitInstall)
30+
# while safely preserving the core infrastructure used during app startup.
31+
-keep class io.flutter.embedding.engine.FlutterJNI { *; }
32+
-keep class io.flutter.embedding.engine.loader.FlutterLoader { *; }
33+
-keep class io.flutter.embedding.android.FlutterActivity { *; }
34+
-keep class io.flutter.embedding.android.FlutterFragment { *; }
35+
-keep class io.flutter.embedding.android.FlutterView { *; }
3136
-keep class io.flutter.plugin.** { *; }
3237
-keep class io.flutter.util.** { *; }
3338
-keep class io.flutter.view.** { *; }
3439

35-
# 5. FOSS COMPLIANCE: PLAY CORE HOOKS SILENCING
40+
# 5. FOSS COMPLIANCE & DEFERRED COMPONENTS REMOVAL
41+
# Correct R8 syntax to mark the Play Store manager and listeners as entry points that CAN be shrunk/deleted
42+
-keep,allowshrinking class io.flutter.embedding.engine.deferredcomponents.PlayStoreDeferredComponentManager { *; }
43+
-keep,allowshrinking class io.flutter.embedding.engine.deferredcomponents.PlayStoreDeferredComponentManager$FeatureInstallStateUpdatedListener { *; }
44+
3645
# Tells R8 to safely ignore missing Google Play binary symbols without packing non-free SDKs
3746
-dontwarn com.google.android.play.core.**
3847
-dontwarn io.flutter.embedding.engine.deferredcomponents.**
@@ -43,4 +52,4 @@
4352
public static int d(...);
4453
public static int i(...);
4554
public static int w(...);
46-
}
55+
}

0 commit comments

Comments
 (0)