r8-analyzer

Analyze Android R8 keep rules for redundancies and broad package-wide rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the common issue of bloated Android app sizes caused by redundant, overly broad, or harmful ProGuard/R8 keep rules that prevent the compiler from effectively shrinking and optimizing your code.

Core Features & Use Cases

  • Quantitative Analysis: Uses R8 configuration analyzer to generate precise impact metrics for keep rules in modern Android projects.
  • Heuristic Evaluation: Provides a fallback manual analysis path for older projects to identify redundant rules and broad package-wide wildcards.
  • Optimization Reporting: Generates a structured Markdown report detailing optimization, obfuscation, and shrinking scores, along with actionable recommendations to refine or remove unnecessary rules.

Quick Start

Run the r8-analyzer skill to inspect your current build configuration and generate an optimization report for your release build.

Frequently Asked Questions about r8-analyzer

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

FAQPage Schema
How do I reduce Android app size by finding redundant R8 keep rules?

To reduce Android app size, analyze R8 keep rules to identify redundancies, broad package-wide rules, and rules that subsume library consumer keep rules. This generates actionable reports detailing optimization, obfuscation, and shrinking scores to refine your build configuration.

Why does ProGuard prevent code shrinking in my release build?

ProGuard or R8 keep rules prevent code shrinking when they are overly broad or redundant, restricting the compiler from safely removing unused code. Analyzing these rules pinpoints harmful configurations that bloat your Android app size and provides refinement strategies.

How do I analyze R8 keep rules for older Android projects?

You can analyze R8 keep rules for older Android projects using heuristic evaluation, which serves as a fallback manual analysis path to identify redundant rules and broad package-wide wildcards when quantitative data generation is unavailable.

Can I get quantitative impact metrics for Android keep rules?

Yes, you can get quantitative impact metrics for Android keep rules by using the R8 configuration analyzer, which supports precise data generation for R8 9.3.7-dev and newer modern Android project configurations.

Do I need Python to run R8 keep rule analysis?

Yes, you need Python and protobuf dependencies installed in your environment to run the R8 keep rule analysis, as the skill requires these components to parse build files and generate optimization reports.

What is the best way to identify broad package-wide wildcards in ProGuard configurations?

The best way to identify broad package-wide wildcards in ProGuard configurations is to run an analysis that flags rules subsuming library consumer keep rules, generating a structured Markdown report with actionable recommendations to refine or remove them.