Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions build-logic/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,24 @@
-dontwarn com.simprints.**
# Do not obfuscate the simprints package
-keep class com.simprints.** { *; }
# Hilt
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class dagger.** { *; }

# Prevent ProGuard from removing @Module, @Inject, @Binds, etc.
-keep class **Module { *; }
-keep class **Inject { *; }
-keep class **Provides { *; }
-keep class **Binds { *; }
-keep class **Hilt_** { *; }

# Keep generated Hilt components
-keep class * implements dagger.hilt.internal.GeneratedComponent { *; }

# Keep classes annotated with @InstallIn to prevent them from being removed
-keep @dagger.hilt.InstallIn class * { *; }

# Keep Hilt components and related Dagger generated code
-keep class * extends dagger.hilt.internal.GeneratedComponentManager { *; }
-keep class * extends dagger.hilt.internal.GeneratedComponent { *; }
22 changes: 22 additions & 0 deletions id/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,25 @@

-keep class retrofit2.** { *; }
-keep interface retrofit2.** { *; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also apply the common proguard file in AndroidApplicationConventionPlugin similarly to how it is done in AndroidLibraryConventionPlugin to avoid config duplication.

# Hilt
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class dagger.** { *; }

# Prevent ProGuard from removing @Module, @Inject, @Binds, etc.
-keep class **Module { *; }
-keep class **Inject { *; }
-keep class **Provides { *; }
-keep class **Binds { *; }
-keep class **Hilt_** { *; }

# Keep generated Hilt components
-keep class * implements dagger.hilt.internal.GeneratedComponent { *; }

# Keep classes annotated with @InstallIn to prevent them from being removed
-keep @dagger.hilt.InstallIn class * { *; }

# Keep Hilt components and related Dagger generated code
-keep class * extends dagger.hilt.internal.GeneratedComponentManager { *; }
-keep class * extends dagger.hilt.internal.GeneratedComponent { *; }