# Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile # ==================== ОБЩИЕ ПРАВИЛА ==================== -keepattributes Signature -keepattributes *Annotation* -keepattributes SourceFile,LineNumberTable -keepattributes EnclosingMethod # Не обфусцировать имена классов с аннотациями -keep @kotlin.Metadata class * -keep class kotlin.Metadata { *; } # ==================== KOTLIN ==================== -keep class kotlin.** { *; } -keep class kotlinx.coroutines.** { *; } -keep class kotlinx.serialization.** { *; } -dontwarn kotlinx.coroutines.** -dontwarn kotlinx.serialization.** # Корутины -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory { *; } -keepnames class kotlinx.coroutines.CoroutineExceptionHandler { *; } -keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler { *; } -keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory { *; } # ==================== ANDROIDX ==================== -keep class androidx.** { *; } -keep interface androidx.** { *; } -dontwarn androidx.** # Compose -keep class androidx.compose.** { *; } -keep class androidx.compose.runtime.** { *; } -keep class androidx.compose.ui.** { *; } -keep class androidx.compose.material.** { *; } -keep class androidx.compose.material3.** { *; } -dontwarn androidx.compose.** # Room -keep class * extends androidx.room.RoomDatabase -keep @androidx.room.Entity class * -keep @androidx.room.Dao class * -keepclassmembers class * { @androidx.room.* ; } -keep class androidx.room.** { *; } -dontwarn androidx.room.paging.** # Hilt -keep class dagger.hilt.** { *; } -keep class javax.inject.** { *; } -keep class com.google.dagger.hilt.** { *; } -dontwarn dagger.hilt.android.** -dontwarn com.google.errorprone.annotations.* # ViewModel -keep class * extends androidx.lifecycle.ViewModel { (...); } -keepclassmembers class * extends androidx.lifecycle.ViewModel { (...); } # ==================== RETROFIT & OKHTTP ==================== -dontwarn okhttp3.** -dontwarn okio.** -dontwarn javax.annotation.** -dontwarn org.conscrypt.** -keepattributes Signature -keepattributes Exceptions -keep class retrofit2.** { *; } -keepclasseswithmembers class * { @retrofit2.http.* ; } -keep class okhttp3.** { *; } -keep interface okhttp3.** { *; } # ==================== GSON ==================== -keep class com.google.gson.** { *; } -keep class com.example.myserver.** { *; } # Сохраняем наши модели -keepclassmembers class com.example.myserver.** { (...); ; } -keepattributes Signature -keepattributes *Annotation* # ==================== FIREBASE ==================== -keep class com.google.firebase.** { *; } -keep class com.google.android.gms.** { *; } -dontwarn com.google.firebase.** -dontwarn com.google.android.gms.** # ==================== GLIDE ==================== -keep class com.bumptech.glide.** { *; } -keep class com.bumptech.glide.integration.okhttp3.** { *; } -dontwarn com.bumptech.glide.** -dontwarn com.bumptech.glide.load.engine.bitmap_recycle.** # ==================== ROOM ==================== -keep class * extends androidx.room.RoomDatabase -keep @androidx.room.Entity class * -keepclassmembers class * { @androidx.room.* ; } -keep class androidx.room.** { *; } -keep class *Database_Impl { *; } # ==================== WEBSOCKET ==================== -keep class okhttp3.** { *; } -keep interface okhttp3.** { *; } -keep class org.java_websocket.** { *; } # ==================== SECURITY (EncryptedPreferences) ==================== -keep class androidx.security.** { *; } -keep class com.google.crypto.tink.** { *; } -dontwarn com.google.crypto.tink.** # ==================== МЕДИА (Compressor, Transcoder) ==================== -keep class id.zelory.compressor.** { *; } -keep class com.otaliastudios.transcoder.** { *; } -dontwarn com.otaliastudios.transcoder.** # ==================== НАШИ МОДЕЛИ И DATA CLASSES ==================== # Сохраняем все наши модели (для Gson/Room) -keep class com.example.myserver.** { *; } -keepclassmembers class com.example.myserver.** { *** Companion; *** INSTANCE; (...); ; } # Сохраняем sealed классы -keep class com.example.myserver.AuthState { *; } -keep class com.example.myserver.SessionState { *; } -keep class com.example.myserver.MessageStatus { *; } # ==================== УДАЛЕНИЕ ЛОГОВ В RELEASE ==================== -assumenosideeffects class android.util.Log { public static boolean isLoggable(java.lang.String, int); public static int v(...); public static int d(...); public static int i(...); public static int w(...); public static int e(...); } # ==================== РАЗНОЕ ==================== -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } -keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField[] serialPersistentFields; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } -keepclassmembers class * { @android.webkit.JavascriptInterface ; }