Skip to content

R8 full mode#198

Merged
mmathieum merged 7 commits into
masterfrom
mm/r8_full_mode
Apr 21, 2026
Merged

R8 full mode#198
mmathieum merged 7 commits into
masterfrom
mm/r8_full_mode

Conversation

@mmathieum

Copy link
Copy Markdown
Member

@github-actions

github-actions Bot commented Apr 20, 2026

Copy link
Copy Markdown

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@mmathieum mmathieum marked this pull request as ready for review April 20, 2026 18:09

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the ProGuard configuration by consolidating attribute preservation rules and removing specific configurations for OKHTTP, Retrofit, and InMobi. Feedback highlights that removing Retrofit rules is risky and could lead to runtime exceptions if the project still relies on it. Additionally, redundant attribute declarations were identified in the Crashlytics section.

I am having trouble creating individual review comments. Click here to see my feedback.

app-android/proguard-rules.pro (60-99)

high

The removal of the Retrofit-specific ProGuard rules is risky when enabling R8 full mode. R8 full mode is more aggressive and often requires these specific -if interface and -keep rules to prevent the stripping of generic signatures and interfaces used by Retrofit's dynamic proxies. If the project still uses Retrofit, removing these rules may cause runtime exceptions (e.g., IllegalArgumentException regarding service method return types). Please ensure these rules are either provided by the library's consumer ProGuard configuration or are indeed no longer needed.

app-android/proguard-rules.pro (9-13)

medium

The -keepattributes SourceFile,LineNumberTable directive is redundant here because these attributes are already included in the consolidated list on line 4. Removing this duplicate entry keeps the configuration clean and avoids confusion.

# CRASHLYTICS - START
# https://firebase.google.com/docs/crashlytics/android/get-deobfuscated-reports#config-r8-proguard-dexguard
-keep public class * extends java.lang.Exception  # Optional: Keep custom exceptions.
# CRASHLYTICS - END

@mmathieum mmathieum added enhancement P3 ⏸️ Priority 3: Medium danger ⚠️ Dangerous consequences labels Apr 20, 2026
@mmathieum mmathieum requested a review from Copilot April 21, 2026 01:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the app’s ProGuard/R8 configuration in support of running with R8 full mode, simplifying legacy rules and aligning keep/dontwarn entries with current SDK guidance.

Changes:

  • Consolidates and expands -keepattributes to retain additional metadata used by reflection/annotations.
  • Updates Crashlytics and Facebook Audience Network ProGuard rules to match current documentation.
  • Removes legacy/duplicate ProGuard sections (e.g., older OkHttp/Retrofit/InMobi-related blocks).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app-android/proguard-rules.pro
Comment thread app-android/proguard-rules.pro
Comment thread app-android/proguard-rules.pro
@mmathieum mmathieum merged commit a9d5743 into master Apr 21, 2026
7 checks passed
@mmathieum mmathieum deleted the mm/r8_full_mode branch April 21, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

danger ⚠️ Dangerous consequences enhancement P3 ⏸️ Priority 3: Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants