Proguard/R8 rules
Automatic Configuration (Recommended)
The Kotzilla SDK includes consumer ProGuard rules that are automatically applied to your app. These rules preserve essential SDK classes and handle kotlinx.serialization requirements.
No manual ProGuard configuration is needed for most projects.
The SDK automatically includes consumer rules for:
- Core SDK classes (
io.kotzilla.sdk.**,io.kotzilla.data.json.**) - kotlinx.serialization support
Manual Configuration (Advanced)
If you need to customize ProGuard rules or your build doesn't automatically apply consumer rules, add the following to your ProGuard file:
-keep class io.kotzilla.data.json.** { *; }
-keep class io.kotzilla.sdk.** { *; }
Additionally, ensure to keep classes related to Kotlin serialization:
-keepclassmembers class kotlinx.** { volatile <fields>; }
R8 Compatibility
All ProGuard rules are fully compatible with R8 (the modern code shrinker used by Android Gradle Plugin 8.0+).
R8 automatically applies the SDK's consumer rules during the build process, ensuring correct behavior in release builds without additional configuration.
Native HTTP Client (SDK 1.4.0+)
Starting with SDK 1.4.0, the SDK uses platform-native HTTP clients instead of external libraries like Ktor or OkHttp.
You do not need any Ktor or OkHttp ProGuard rules for the Kotzilla SDK.
If you previously used rules like -keep class io.ktor.** { *; } for the SDK, these can be safely removed.