r8-analyzer

Identify redundant or overly broad R8/Proguard keep rules in Android Gradle projects.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ebarroso12/personal-skills --skill r8-analyzer-ebarroso12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/ebarroso12/personal-skills/tree/main/r8-analyzer
Command: npx skills add https://github.com/ebarroso12/personal-skills --skill r8-analyzer-ebarroso12

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

R8 keep rules can accidentally become redundant or overly broad, preventing code shrinking and increasing app size, especially when troubleshooting Proguard/R8 behavior across app and library boundaries.

Core Features & Use Cases

  • Build & R8 configuration review: Inspects Gradle build scripts and properties to catch missing release optimizations and full-mode configuration issues.
  • R8 rule impact analysis: Uses either quantitative analysis (via generated reports) or a heuristic review to identify redundant rules, overly broad package-wide patterns, and library consumer subsumption opportunities.
  • Change validation guidance: Produces an output report format suitable for evaluating example impacted classes and rule impacts, with validation suggestions for proposed changes.

Use Case Example: You suspect your proguard-rules.pro contains package-wide keep patterns or old manual rules that duplicate library-provided consumer rules; use this skill to locate and prioritize what to remove or refine to recover shrinking.

Quick Start

Run r8-analyzer against your Android project’s release build configuration and proguard-rules.pro to generate a Markdown report of rule redundancies and impact metrics.

Frequently Asked Questions about r8-analyzer

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

FAQPage Schema
How do I find redundant R8 keep rules that are increasing my Android app size?

Overly broad R8 keep rules prevent code shrinking and increase app size; analyze your proguard-rules.pro and build.gradle configurations to locate redundant patterns and library consumer rule subsumption opportunities.

What is the best way to optimize Proguard rules for Android release builds?

Optimizing Proguard rules involves reviewing your release configuration in build.gradle and proguard-rules.pro to remove redundant keep rules, prioritizing changes that recover shrinking and reduce app size.

Can I analyze R8 configuration usage with Python or protobuf?

Yes, analyzing R8 configuration can leverage Python and protobuf dependencies to parse generated reports and perform quantitative analysis of keep rule impacts across your Android project.

Why does my R8 full mode still result in a large app size?

R8 full mode can still yield large app sizes when manual keep rules duplicate library-provided consumer rules or use broad package patterns, preventing effective code shrinking across app and library boundaries.

How do I validate changes to keep rules before releasing an Android app?

To validate keep rule changes, generate an analysis report containing example impacted classes and rule impact metrics, then use the provided validation suggestions to safely remove or refine redundant configurations.