Skip to main content
Home/All Tools/Android Development/Android ProGuard & R8 Rules Generator
How to Use & Guide ↓

Android ProGuard & R8 Rules Generator

proguard-rules.pro
# Generated ProGuard & R8 Configuration Rules
# Optimized for release builds & code shrinking

-keepattributes SourceFile,LineNumberTable
-keepattributes *Annotation*

# Custom Data Models
-keep class com.example.app.data.model.** { *; }

# Retrofit 2
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations

# Google Gson
-keepattributes Signature
-keepattributes *Annotation*
-dontwarn sun.misc.**
-keep class com.google.gson.** { *; }
-keepclassmembers class * { @com.google.gson.annotations.SerializedName <fields>; }

# Kotlin Coroutines
-dontwarn kotlinx.coroutines.**
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}

Android ProGuard & R8 Rules Generator

4.89•290K Users•100% Client-Side Privacy
Unlimited Free

Generate clean ProGuard and R8 obfuscation and shrinking rules with 1-click presets for Retrofit, Gson, Room, Kotlin Coroutines, and Glide.

Retrofit & Gson presetsKotlin Coroutines rulesModel class preservationRelease build optimization

How to Use Android ProGuard & R8 Rules Generator

Follow these simple steps to process your files securely in browser memory.

1Step 1 of 3

Select Active Libraries

Check libraries used: Retrofit, Gson, Room, Coroutines, Glide, Firebase.

Pro Tip: Gson and Moshi require keeping serialized model fields.
2Step 2 of 3

Specify Model Packages

Enter app model package path (e.g. com.example.models.**) to preserve DTOs.

Pro Tip: -dontwarn silences benign third-party bytecode analysis warnings.
3Step 3 of 3

Copy proguard-rules.pro

Paste generated rules into app/proguard-rules.pro before building release.

Pro Tip: Verify release APK with Android Studio APK Analyzer.

Who Is Android ProGuard & R8 Rules Generator Built For?

Designed for professionals seeking fast, private, and unlimited client-side execution.

Primary Target Audience
🎯Android Developers & Library Maintainers
Also Widely Used By
Release EngineersKotlin Developers
Typical Real-World Use Cases
  • Generating ProGuard/R8 rules for Retrofit, Room, Gson
  • Preventing ClassNotFoundException crashes in release builds
  • Keeping data models from obfuscation

Curated Library Presets

Battle-tested rules for Retrofit, OkHttp, Room, Gson.

Zero Release Crashes

Safeguard reflection without bloating APK size.

1-Click Copy Configuration

Drop ready rules into proguard-rules.pro.

Frequently Asked Questions about Android ProGuard & R8 Rules Generator

R8 strips unused code and obfuscates names, breaking reflection in libraries like Retrofit or Gson.
Top Search Queries for Android ProGuard & R8 Rules Generator:
proguard rules generator android r8retrofit gson proguard rules keep modelsprevent release crash r8 minifyenabledandroid proguard configuration generator onlinekeep kotlin coroutines room proguard rules