r8-analyzer

Analyze Android R8 keep rules to identify redundancies and overly broad rules.

1|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/charleshall888/cortex-command --skill r8-analyzer-charleshall888
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/charleshall888/cortex-command/tree/main/plugins/android-dev-extras/skills/r8-analyzer
Command: npx skills add https://github.com/charleshall888/cortex-command --skill r8-analyzer-charleshall888

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Analyzes Android build files and R8 keep rules to identify redundancies, broad package-wide rules, and rules that subsume library consumer keep rules. Use when developers want to optimize their app's size, remove redundant or overly broad keep rules, or troubleshoot Proguard configurations.

Core Features & Use Cases

  • Identify redundant or overly broad keep rules across libraries and modules.
  • Recommend narrowly-scoped, conditional keep rules to preserve necessary functionality while allowing optimization.
  • Provide a guided workflow aligned with Android build configurations and ProGuard/R8.

Quick Start

Run the analyzer against an Android project to generate a prioritized keep-rule refinement report.

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 in my Android project?

Overly broad ProGuard keep rules hinder optimization by preventing code shrinking. The analyzer inspects keep-rule impact hierarchies and reflection usage patterns to recommend narrowly-scoped, conditional rules that preserve necessary functionality.

How do I optimize ProGuard configurations to reduce Android app size?

To optimize ProGuard configurations for app size, analyze R8 keep rules to remove redundancies and refine broad package-wide rules. The analyzer verifies library consumer rules and reflection patterns to deliver concrete removal recommendations.

Does the R8 analyzer work with library consumer keep rules across multiple modules?

Yes, the R8 analyzer works across Android library and app modules. It inspects library consumer keep rules to identify subsumed configurations, verifying rules against reflection usage patterns to ensure necessary functionality is preserved.

Why do overly broad keep rules hinder R8 code size optimization?

Overly broad keep rules hinder R8 code size optimization by preventing the shrinking of necessary classes. The analyzer identifies these rules by inspecting the keep-rule impact hierarchy and recommends narrowly-scoped alternatives.

What is the best way to troubleshoot Proguard configurations that prevent code shrinking?

The best way to troubleshoot Proguard configurations is to analyze R8 keep rules for redundancies and broad package-wide patterns. The analyzer provides a guided workflow aligned with Android build configurations to refine rules.