Skip to content
Back to skills

Enable R8 Proguard

ASecurity

Enable R8/ProGuard with proper keep rules for RN+Expo Android. Use when the user says 'enable r8', 'proguard rules', 'minify android'.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 4, 2026
developmentgobashreact

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 4, 2026

npx -y skills add khadinakbarlabs/expo-mobile-app-builder --skill enable-r8-proguard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Enable R8 Proguard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Enable R8 Proguard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/khadinakbarlabs-enable-r8-proguard/badge)](https://www.skillsdirectory.com/skills/khadinakbarlabs-enable-r8-proguard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "enable-r8-proguard"
description: "Enable R8/ProGuard with proper keep rules for RN+Expo Android. Use when the user says 'enable r8', 'proguard rules', 'minify android'."
---

# Enable R8 + ProGuard

R8 = Google's minifier (replaces ProGuard). Removes unused code + obfuscates.

## Build gate

The configuration changes are local, but an EAS build can consume cloud resources and use signing credentials. Prepare the command and test plan first; run it only after the owner confirms the EAS account, build profile, and action.

## Enable in app.json
```json
{
  "expo-build-properties": {
    "android": {
      "enableProguardInReleaseBuilds": true,
      "enableShrinkResourcesInReleaseBuilds": true,
      "extraProguardRules": "..."
    }
  }
}
```

## Required keep rules

Common RN deps that need rules to survive minification:

```
# React Native
-keep class com.facebook.react.** { *; }
-keep class com.facebook.hermes.** { *; }

# Reanimated
-keep class com.swmansion.reanimated.** { *; }

# Sentry
-keep class io.sentry.** { *; }
-keepattributes LineNumberTable,SourceFile

# Crashlytics
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable

# Your native modules (if any)
-keep class com.yourcompany.nativemodule.** { *; }
```

## Save as `proguard-rules.pro` and reference in expo-build-properties

## Test minified build after confirmation
```bash
eas build --profile production --platform android --local
adb install build.apk
# Run full E2E to verify nothing broke
```

## Common gotchas
- Reflection-using libraries break under R8 → add keep rule
- Stack traces unreadable → enable mapping file upload to Sentry/Crashlytics
- ~30% size reduction on AAB after R8

## Pair with
- `optimize-aab-size`
- `add-sentry-rn-android` (need mapping file for stack traces)

Files in this skill

  • SKILL.md1.8 KB
  • agents/openai.yaml185 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…