r8-analyzer

Analyze Android R8 keep rules and Gradle settings for optimization opportunities.

Updated May 5, 2023
One-click install
npx skills add https://github.com/uyelikanil/AwesomeSunsetWallpapers --skill r8-analyzer-uyelikanil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/uyelikanil/AwesomeSunsetWallpapers/tree/main/.agents/skills/r8-analyzer
Command: npx skills add https://github.com/uyelikanil/AwesomeSunsetWallpapers --skill r8-analyzer-uyelikanil

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill addresses the complexity of managing Android R8 keep rules, helping developers identify redundant, overly broad, or harmful configurations that bloat app size or cause runtime crashes.

Core Features & Use Cases

  • Quantitative Analysis: Uses R8's internal blast radius data to calculate precise optimization, shrinking, and obfuscation scores.
  • Heuristic Recommendations: Provides actionable advice for older projects where quantitative data is unavailable, including identifying redundant library rules.
  • Use Case: A developer wants to reduce their APK size but is unsure which ProGuard rules are safe to remove; this skill analyzes the build configuration and generates a report of high-impact rules to prune.

Quick Start

Run the r8-analyzer skill to evaluate the current build configuration and generate an optimization report.

Frequently Asked Questions about r8-analyzer

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

FAQPage Schema
How do I reduce my Android app size by optimizing ProGuard keep rules?

Android app size reduction is achieved by analyzing R8 keep rules to identify redundant, overly broad, or harmful configurations. This skill evaluates project-specific ProGuard files and Gradle settings to generate actionable recommendations for pruning high-impact rules and shrinking the APK.

How does R8 blast radius data help with Android shrinking and obfuscation?

R8 blast radius data calculates precise optimization, shrinking, and obfuscation scores by analyzing internal build configurations. It identifies exactly how modifying specific keep rules impacts overall app size and code obfuscation, enabling data-driven optimization decisions.

What's the best way to find redundant R8 keep rules in an older Android project?

For older Android projects lacking quantitative data, heuristic recommendations identify redundant library rules and optimization opportunities. It evaluates existing build configurations to provide actionable advice on safely removing unnecessary ProGuard rules without causing runtime crashes.

Do I need to execute Gradle tasks to analyze my Android build configuration?

Yes, analyzing R8 configuration requires access to project build files and the ability to execute Gradle tasks. This access is necessary to evaluate project-specific ProGuard files and Gradle settings for optimization opportunities accurately.

Why does removing ProGuard keep rules cause runtime crashes in my Android app?

Removing ProGuard keep rules causes runtime crashes when configurations are overly broad or incorrectly pruned, stripping necessary class references. R8 analysis identifies which rules are truly redundant versus which are essential for preventing crashes while reducing app size.