Răsfoiți Sursa

Enhance ProGuard rules and update deployment target settings

- Updated ProGuard rules across multiple modules to improve class retention and reduce obfuscation for Koin and Compose-related classes.
- Added new ProGuard rules for Moshi and Retrofit to ensure proper handling of serialization and network operations.
- Modified deployment target settings in deploymentTargetSelector.xml to include a new default boot target for the emulator.
Carles Sentis 2 zile în urmă
părinte
comite
261975bc38

+ 8 - 0
.idea/deploymentTargetSelector.xml

@@ -4,6 +4,14 @@
     <selectionStates>
       <SelectionState runConfigName="app">
         <option name="selectionMode" value="DROPDOWN" />
+        <DropdownSelection timestamp="2025-04-11T13:02:46.185076Z">
+          <Target type="DEFAULT_BOOT">
+            <handle>
+              <DeviceId pluginId="LocalEmulator" identifier="path=/Users/colosseum/.android/avd/Pixel_3a_API_34_extension_level_7_arm64-v8a.avd" />
+            </handle>
+          </Target>
+        </DropdownSelection>
+        <DialogSelection />
       </SelectionState>
     </selectionStates>
   </component>

+ 3 - 0
app/build.gradle.kts

@@ -28,11 +28,14 @@ android {
     buildTypes {
         release {
             isMinifyEnabled = ConfigData.isMinifyRelease
+            //applicationIdSuffix = ".release"
+            //versionNameSuffix = "-RELEASE"
             proguardFiles(
                 getDefaultProguardFile("proguard-android-optimize.txt"),
                 "proguard-rules.pro"
             )
             isShrinkResources = true
+            //signingConfig = signingConfigs.getByName("debug")
         }
         debug {
             isMinifyEnabled = ConfigData.isMinifyDebug

+ 19 - 2
core/local/proguard-rules.pro

@@ -14,7 +14,7 @@
 
 # Uncomment this to preserve the line number information for
 # debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
+-keepattributes SourceFile,LineNumberTable
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
@@ -35,4 +35,21 @@
 -keep class com.codeskraps.core.local.domain.repository.LocalResourceRepository { *; }
 
 # Java language APIs
--dontwarn java.lang.invoke.StringConcatFactory
+-dontwarn java.lang.invoke.StringConcatFactory
+
+# Less aggressive obfuscation
+-keepnames class com.codeskraps.core.local.** { *; }
+-keepnames class com.codeskraps.core.local.data.** { *; }
+-keepnames class com.codeskraps.core.local.domain.** { *; }
+-keepnames class com.codeskraps.core.local.di.** { *; }
+
+# Keep Kotlin metadata
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+
+# Keep Kotlin coroutines
+-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
+-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}

+ 22 - 1
core/location/proguard-rules.pro

@@ -14,7 +14,7 @@
 
 # Uncomment this to preserve the line number information for
 # debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
+-keepattributes SourceFile,LineNumberTable
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
@@ -29,5 +29,26 @@
 -keep class com.codeskraps.core.location.di.CoreLocationModule_ProvidesLocationTrackerFactory { *; }
 -keep class com.codeskraps.core.location.domain.LocationTracker { *; }
 
+# Keep Koin module classes
+-keep class com.codeskraps.core.location.di.** { *; }
+-keep class com.codeskraps.core.location.di.FeatureModuleKt { *; }
+
+# Less aggressive obfuscation
+-keepnames class com.codeskraps.core.location.** { *; }
+-keepnames class com.codeskraps.core.location.data.** { *; }
+-keepnames class com.codeskraps.core.location.domain.** { *; }
+-keepnames class com.codeskraps.core.location.di.** { *; }
+
+# Keep Kotlin metadata
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+
+# Keep Kotlin coroutines
+-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
+-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
+
 # Java language APIs
 -dontwarn java.lang.invoke.StringConcatFactory

+ 31 - 1
feature/common/proguard-rules.pro

@@ -14,7 +14,7 @@
 
 # Uncomment this to preserve the line number information for
 # debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
+-keepattributes SourceFile,LineNumberTable
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
@@ -36,5 +36,35 @@
 -keep class com.codeskraps.feature.common.navigation.Screen$Map { *; }
 -keep class com.codeskraps.feature.common.navigation.Screen$Weather { *; }
 
+# Keep Koin module classes
+-keep class com.codeskraps.feature.common.di.** { *; }
+-keep class com.codeskraps.feature.common.di.FeatureModuleKt { *; }
+
+# Keep Compose-related classes
+-keep class androidx.compose.** { *; }
+-keep class androidx.compose.runtime.** { *; }
+-keep class androidx.compose.ui.** { *; }
+-keep class androidx.compose.foundation.** { *; }
+-keep class androidx.compose.material.** { *; }
+-keep class androidx.compose.material3.** { *; }
+
+# Less aggressive obfuscation
+-keepnames class com.codeskraps.feature.common.** { *; }
+-keepnames class com.codeskraps.feature.common.di.** { *; }
+-keepnames class com.codeskraps.feature.common.dispatcher.** { *; }
+-keepnames class com.codeskraps.feature.common.mvi.** { *; }
+-keepnames class com.codeskraps.feature.common.navigation.** { *; }
+
+# Keep Kotlin metadata
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+
+# Keep Kotlin coroutines
+-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
+-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
+
 # Java language APIs
 -dontwarn java.lang.invoke.StringConcatFactory

+ 55 - 2
feature/geocoding/proguard-rules.pro

@@ -14,7 +14,7 @@
 
 # Uncomment this to preserve the line number information for
 # debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
+-keepattributes SourceFile,LineNumberTable
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
@@ -34,4 +34,57 @@
 
 # Keep Hilt ViewModel factory and members injector
 -keep class com.codeskraps.feature.geocoding.presentation.GeocodingViewModel_Factory { *; }
--keep class com.codeskraps.feature.geocoding.presentation.GeocodingViewModel_MembersInjector { *; }
+-keep class com.codeskraps.feature.geocoding.presentation.GeocodingViewModel_MembersInjector { *; }
+
+# Keep Koin module classes
+-keep class com.codeskraps.feature.geocoding.di.** { *; }
+-keep class com.codeskraps.feature.geocoding.di.FeatureModuleKt { *; }
+
+# Keep Compose screen classes
+-keep class com.codeskraps.feature.geocoding.presentation.components.** { *; }
+-keep class com.codeskraps.feature.geocoding.presentation.components.GeocodingScreenKt { *; }
+-keep class com.codeskraps.feature.geocoding.presentation.components.GeocodingScreenKt$* { *; }
+
+# Keep Compose-related classes
+-keep class androidx.compose.** { *; }
+-keep class androidx.compose.runtime.** { *; }
+-keep class androidx.compose.ui.** { *; }
+-keep class androidx.compose.foundation.** { *; }
+-keep class androidx.compose.material.** { *; }
+-keep class androidx.compose.material3.** { *; }
+
+# Keep Moshi-related classes
+-keep class com.codeskraps.feature.geocoding.data.remote.** { *; }
+-keep class com.squareup.moshi.** { *; }
+-keep class com.squareup.moshi.internal.** { *; }
+-keep class com.squareup.moshi.internal.Util { *; }
+-keep class com.squareup.moshi.internal.Util$* { *; }
+
+# Keep Moshi annotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+
+# Keep Retrofit-related classes
+-keep class retrofit2.** { *; }
+-keep class okhttp3.** { *; }
+-keep class okio.** { *; }
+
+# Less aggressive obfuscation
+-keepnames class com.codeskraps.feature.geocoding.** { *; }
+-keepnames class com.codeskraps.feature.geocoding.data.** { *; }
+-keepnames class com.codeskraps.feature.geocoding.domain.** { *; }
+-keepnames class com.codeskraps.feature.geocoding.presentation.** { *; }
+
+# Keep Kotlin metadata
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+
+# Keep Kotlin coroutines
+-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
+-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}

+ 35 - 1
feature/maps/proguard-rules.pro

@@ -14,7 +14,7 @@
 
 # Uncomment this to preserve the line number information for
 # debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
+-keepattributes SourceFile,LineNumberTable
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
@@ -39,6 +39,40 @@
 -keep class com.codeskraps.core.location.domain.** { *; }
 -keep class com.codeskraps.umami.domain.** { *; }
 
+# Keep Koin module classes
+-keep class com.codeskraps.maps.di.** { *; }
+-keep class com.codeskraps.maps.di.FeatureModuleKt { *; }
+
+# Keep Compose screen classes
+-keep class com.codeskraps.maps.presentation.components.** { *; }
+-keep class com.codeskraps.maps.presentation.components.MapScreenKt { *; }
+-keep class com.codeskraps.maps.presentation.components.MapScreenKt$* { *; }
+
+# Keep Compose-related classes
+-keep class androidx.compose.** { *; }
+-keep class androidx.compose.runtime.** { *; }
+-keep class androidx.compose.ui.** { *; }
+-keep class androidx.compose.foundation.** { *; }
+-keep class androidx.compose.material.** { *; }
+-keep class androidx.compose.material3.** { *; }
+
+# Less aggressive obfuscation
+-keepnames class com.codeskraps.maps.** { *; }
+-keepnames class com.codeskraps.maps.data.** { *; }
+-keepnames class com.codeskraps.maps.domain.** { *; }
+-keepnames class com.codeskraps.maps.presentation.** { *; }
+
+# Keep Kotlin metadata
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+
+# Keep Kotlin coroutines
+-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
+-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
+
 # Dontwarn rules
 -dontwarn com.codeskraps.core.local.domain.model.GeoLocation
 -dontwarn com.codeskraps.core.local.domain.repository.LocalGeocodingRepository

+ 57 - 2
feature/weather/proguard-rules.pro

@@ -14,7 +14,7 @@
 
 # Uncomment this to preserve the line number information for
 # debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
+-keepattributes SourceFile,LineNumberTable
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
@@ -34,4 +34,59 @@
 
 # Keep Hilt ViewModel factory and members injector
 -keep class com.codeskraps.feature.weather.presentation.WeatherViewModel_Factory { *; }
--keep class com.codeskraps.feature.weather.presentation.WeatherViewModel_MembersInjector { *; }
+-keep class com.codeskraps.feature.weather.presentation.WeatherViewModel_MembersInjector { *; }
+
+# Keep Koin module classes
+-keep class com.codeskraps.feature.weather.di.** { *; }
+-keep class com.codeskraps.feature.weather.di.FeatureModuleKt { *; }
+
+# Keep Compose screen classes
+-keep class com.codeskraps.feature.weather.presentation.components.** { *; }
+-keep class com.codeskraps.feature.weather.presentation.components.WeatherScreenKt { *; }
+-keep class com.codeskraps.feature.weather.presentation.components.WeatherScreenKt$* { *; }
+
+# Keep Compose-related classes
+-keep class androidx.compose.** { *; }
+-keep class androidx.compose.runtime.** { *; }
+-keep class androidx.compose.ui.** { *; }
+-keep class androidx.compose.foundation.** { *; }
+-keep class androidx.compose.material.** { *; }
+-keep class androidx.compose.material3.** { *; }
+
+# Keep Moshi-related classes
+-keep class com.codeskraps.feature.weather.data.remote.** { *; }
+-keep class com.codeskraps.feature.weather.data.remote.WeatherDto { *; }
+-keep class com.codeskraps.feature.weather.data.remote.WeatherDto$* { *; }
+-keep class com.squareup.moshi.** { *; }
+-keep class com.squareup.moshi.internal.** { *; }
+-keep class com.squareup.moshi.internal.Util { *; }
+-keep class com.squareup.moshi.internal.Util$* { *; }
+
+# Keep Moshi annotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+
+# Keep Retrofit-related classes
+-keep class retrofit2.** { *; }
+-keep class okhttp3.** { *; }
+-keep class okio.** { *; }
+
+# Less aggressive obfuscation
+-keepnames class com.codeskraps.feature.weather.** { *; }
+-keepnames class com.codeskraps.feature.weather.data.** { *; }
+-keepnames class com.codeskraps.feature.weather.domain.** { *; }
+-keepnames class com.codeskraps.feature.weather.presentation.** { *; }
+
+# Keep Kotlin metadata
+-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeVisibleTypeAnnotations
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes InnerClasses
+-keepattributes EnclosingMethod
+
+# Keep Kotlin coroutines
+-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
+-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}