Files
SpotiFLAC-Mobile/android/app/proguard-rules.pro
T
zarzet 04e26c96e3 build(android): keep unused resources and assets out of the APK
- Resource tables keep the app's 13 languages (localeFilters);
  libraries shipped strings for every language Android knows.
- Assets Android never loads stay out: the desktop and merged-surface
  glass shaders and media_kit's web player script. The Copy task
  filter that did part of this had stopped matching, as Flutter 3.50
  copies assets with its own task type; ignoreAssetsPattern does it.
- Kotlin metadata, version stamps and build metadata files are left
  out of the package. Nothing in the app uses Kotlin reflection.
- R8 keeps the generated UniFFI library interface, its structures and
  its callbacks instead of every class of com.mornye.backend.
- The scheduled-notification receivers of flutter_local_notifications
  go: the app only shows immediate notifications.
- Gradle adds MORNYE_MOBILE=true to the Dart defines of every build,
  and ABI splits switch off for bundle tasks.
2026-11-22 00:20:41 +07:00

72 lines
2.7 KiB
Prolog

# Ignore missing Play Core classes (not used, but referenced by Flutter)
-dontwarn com.google.android.play.core.splitcompat.**
-dontwarn com.google.android.play.core.splitinstall.**
-dontwarn com.google.android.play.core.tasks.**
# Ignore missing javax.xml.stream (not used on Android)
-dontwarn javax.xml.stream.**
# The FFmpeg plugin ships its JNI keep rules in its AAR.
# UniFFI/JNA resolves FFI methods and structure fields by their generated names.
# Preserve JNA runtime internals and the generated Rust FFI bridge surface.
-keep class com.sun.jna.** { *; }
-keep class com.mornye.backend.UniffiLib { *; }
-keep class com.mornye.backend.UniffiLib$* { *; }
-keep class com.mornye.backend.* implements com.sun.jna.Structure$ByValue { *; }
-keep class com.mornye.backend.* extends com.sun.jna.Structure { *; }
-keep class com.mornye.backend.* implements com.sun.jna.Callback { *; }
# JNA's desktop AWT helpers are unavailable and unused on Android.
# https://github.com/java-native-access/jna/blob/master/www/FrequentlyAskedQuestions.md#jna-on-android
-dontwarn java.awt.Component
-dontwarn java.awt.GraphicsEnvironment
-dontwarn java.awt.HeadlessException
-dontwarn java.awt.Window
-keepclasseswithmembernames class * {
native <methods>;
}
# Kotlin coroutines - expanded rules
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepclassmembers class kotlinx.coroutines.** {
volatile <fields>;
}
-keepclassmembernames class kotlinx.** {
volatile <fields>;
}
-dontwarn kotlinx.coroutines.**
# Runtime annotations used by serializers and generated bindings.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
-dontwarn kotlin.**
# Android instantiates these components from the manifest. Preserve only their
# names and constructors; normal reachability can now shrink/optimize helpers,
# coroutine state machines, and unused members in the rest of the app package.
-keep,allowoptimization class com.zarz.mornye.MainActivity {
public <init>();
}
-keep,allowoptimization class com.zarz.mornye.DownloadService {
public <init>();
}
-keep,allowoptimization class com.zarz.mornye.DownloadQueueWidgetProvider {
public <init>();
}
# Flutter's fragment builders instantiate this class through reflection.
-keep,allowoptimization class com.zarz.mornye.MainActivity$ImpellerAwareFlutterFragment {
public <init>();
}
-keepattributes SourceFile,LineNumberTable
-keepattributes Signature
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes EnclosingMethod
# Flutter invokes the generated registrant by name. Individual plugins are
# referenced by this class and retain their own consumer rules.
-keep class io.flutter.plugins.GeneratedPluginRegistrant { *; }