HomeFeaturesGuidesGetting StartedPricingDictionariesBlogFeedback
R8 Dictionaries

R8 and ProGuard Obfuscation Dictionary Guide

Learn whether R8 supports ProGuard obfuscation dictionaries, how to configure dictionary files, how to validate mapping output, and when Unicode confusable dictionaries help.

8 min read

R8 supports ProGuard-style obfuscation dictionary directives. You can use -obfuscationdictionary, -classobfuscationdictionary, and -packageobfuscationdictionary to influence generated names in release builds.

What an Obfuscation Dictionary Does

An obfuscation dictionary supplies candidate names for R8 when it renames methods, fields, classes, or packages. Instead of predictable names such as a, b, and c, the output can use custom words or Unicode confusable characters.

This does not make the app impossible to reverse engineer, but it can make decompiled output harder to read, search, and reason about.

Dictionary Directives

proguard-rules.pro
-obfuscationdictionary proguard-dic-homoglyph.txt -classobfuscationdictionary proguard-dic-homoglyph.txt -packageobfuscationdictionary proguard-dic-homoglyph.txt

Manual Workflow

  1. Choose a dictionary file with valid Java identifier characters.
  2. Place it beside your ProGuard rule file or use a stable relative path.
  3. Add one or more dictionary directives to proguard-rules.pro.
  4. Build the release variant with R8 enabled.
  5. Inspect mapping.txt and decompiled output to confirm the dictionary is used.
  6. Run release smoke tests to catch any unrelated keep-rule regressions.

Dictionary Options

StrategyBest ForTradeoff
Minimal confusableLightweight visual confusionSmaller name space.
HomoglyphGeneral-purpose Unicode confusionHarder to inspect in some tools.
Greek or CyrillicReadable but non-ASCII outputMay be easier to classify by script.
UltimateLarge projects needing a large poolMore aggressive output.

How ADB Pro Helps

R8 Assistant exposes dictionary management in the IDE and links dictionary selection with R8 configuration. The public ProGuard Dictionaries page provides preset dictionary files that can be downloaded and used directly.

FAQ

Does R8 still use ProGuard rule syntax?

Yes. Android projects commonly use ProGuard-compatible rule files even when R8 is the actual shrinker.

Can dictionaries replace keep rules?

No. Dictionaries only influence generated names. Keep rules are still required for runtime-sensitive classes and members.

How do I know whether a dictionary worked?

Check mapping.txt. If renamed classes or members use your dictionary characters, the directive is active.

Related Guides

Handle This Workflow Faster with ADB Pro

Run Android release checks, signing, AAB handling, R8 rules, and resource obfuscation without leaving your JetBrains IDE.

View PricingStart Free Trial