android-r8-analyzer

Analyzes Android R8 keep rules to identify redundant and overly broad optimization blockers.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/Zeyad-37/tech-agency --skill android-r8-analyzer-zeyad-37
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: android-r8-analyzer
Source: https://github.com/Zeyad-37/tech-agency/tree/main/.claude/skills/android-r8-analyzer
Command: npx skills add https://github.com/Zeyad-37/tech-agency --skill android-r8-analyzer-zeyad-37

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires protobuf, and includes references (resource) components.

What problem does it solve? Android apps often ship with redundant or overly broad ProGuard/R8 keep rules that prevent code shrinking, obfuscation, and optimization, inflating app size. This Skill audits your build configuration and keep rules to pinpoint exactly which rules block R8 optimizations and what to remove or refine. ## Core Features & Use Cases - Quantitative Analysis: On R8 9.3.7-dev or later, runs the R8 Configuration Analyzer to generate optimization, shrinking, and obfuscation scores plus per-rule impact metrics. - Heuristic Evaluation: On older R8 versions, manually inspects proguard-rules.pro against known redundant library rules (Gson, Retrofit, Room, Coroutines) and a keep-rule impact hierarchy. - Structured Report: Outputs a strict Markdown report with scores, rule impact percentages, subsumed rules, and Remove/Refine actions. - Use Case: Before a release, run the analysis to discover that a package-wide -keep class com.example.models.** { *; } rule blocks obfuscation for 30% of your codebase, then refine it using @SerializedName annotations. ## Quick Start Analyze my Android project's R8 keep rules and tell me which ones to remove or refine to reduce app size.

Frequently Asked Questions about android-r8-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find redundant ProGuard keep rules in my Android app?▼

Run an R8 keep rule analysis that compares your proguard-rules.pro against rules already bundled by libraries like Gson, Retrofit, Room, and Kotlin Coroutines. Rules targeting androidx, kotlin, or kotlinx packages are typically redundant and can be deleted.

How to measure R8 optimization score for an Android project?▼

With R8 9.3.7-dev or later, run a release build with the -Dcom.android.tools.r8.dumpkeepradiustodirectory flag to generate a Configuration Analyzer report. Converting the protobuf output to JSON yields optimization, shrinking, and obfuscation scores as percentages.

What R8 version is required for quantitative keep rule analysis?▼

Quantitative analysis requires R8 9.3.7-dev or later, available in AGP 9.3.0-alpha05 and newer. On older versions, only heuristic manual inspection of proguard-rules.pro against known redundant rule patterns is possible.

Does R8 full mode need to be enabled for app optimization?▼

R8 full mode is enabled by default in AGP 8.0 and later. Ensure android.enableR8.fullMode=false is not present in gradle.properties, and use proguard-android-optimize.txt rather than the deprecated proguard-android.txt default file.

Why are package-wide keep rules harmful for app size?▼

Rules like -keep class com.example.** { *; } prevent R8 from shrinking, obfuscating, or optimizing every class and member in the package tree. They should be refined to target specific classes or replaced with annotations like @SerializedName.

Can the R8 analyzer modify my ProGuard configuration automatically?▼

No, the analysis is read-only. It outputs a Markdown report with Remove or Refine recommendations per rule, but never modifies build files or keep rules, so all changes remain under developer control.