Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ android {
}

release {
minifyEnabled false // False for fix of a lot crash in release
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
versionNameSuffix rootProject.ext.app.betaSuffix
}
Expand Down
107 changes: 106 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,109 @@
-keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Flowable
-keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Maybe
-keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Observable
-keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Single
-keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Single

#----------------- Additional Rules for V2er App ------------------------

# Keep RxJava2 (current version used in app)
-keep class io.reactivex.** { *; }
-keep interface io.reactivex.** { *; }
Comment on lines +141 to +142
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

These broad RxJava2 rules conflict with the existing specific RxJava3 rules (lines 134-136) and are overly permissive. The existing rules already handle RxJava properly with selective obfuscation. Consider removing these duplicate rules or being more specific about which RxJava2 classes need preservation.

Suggested change
-keep class io.reactivex.** { *; }
-keep interface io.reactivex.** { *; }
-keep,allowobfuscation,allowshrinking class io.reactivex.Flowable
-keep,allowobfuscation,allowshrinking class io.reactivex.Maybe
-keep,allowobfuscation,allowshrinking class io.reactivex.Observable
-keep,allowobfuscation,allowshrinking class io.reactivex.Single

Copilot uses AI. Check for mistakes.
-dontwarn io.reactivex.**

# Dagger 2 rules
-dontwarn com.google.errorprone.annotations.**
-keep class dagger.** { *; }
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

This rule is overly broad and prevents any obfuscation of Dagger classes. Consider using more specific rules that only keep the essential Dagger classes while allowing others to be obfuscated, such as -keep class dagger.Module and -keep class dagger.Component only.

Suggested change
-keep class dagger.** { *; }

Copilot uses AI. Check for mistakes.
-keep class javax.inject.** { *; }
-keep class * extends dagger.Module
-keep class * extends dagger.Component
-keep @dagger.Component class *
-keep @dagger.Module class * { *; }
-keep @dagger.Provides class * { *; }
-keep @javax.inject.Inject class * { *; }

# ButterKnife rules
-keep class butterknife.** { *; }
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

This rule is overly broad for ButterKnife. The subsequent specific rules (lines 159-165) should be sufficient to handle ButterKnife's annotation processing. Consider removing this blanket rule to allow better obfuscation of ButterKnife internals.

Suggested change
-keep class butterknife.** { *; }

Copilot uses AI. Check for mistakes.
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}

# Custom Fruit HTML parsing library
-keep class me.ghui.fruit.** { *; }
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

This rule prevents all obfuscation of the Fruit library. The annotation-specific rules (lines 170-176) should be sufficient for proper functionality. Consider removing this blanket rule to allow obfuscation of non-essential Fruit classes.

Suggested change
-keep class me.ghui.fruit.** { *; }

Copilot uses AI. Check for mistakes.
-dontwarn me.ghui.fruit.**
-keep @me.ghui.fruit.annotations.* class * { *; }
-keepclasseswithmembernames class * {
@me.ghui.fruit.annotations.* <methods>;
}
-keepclasseswithmembernames class * {
@me.ghui.fruit.annotations.* <fields>;
}

# RxLifecycle
-keep class com.trello.rxlifecycle2.** { *; }
-dontwarn com.trello.rxlifecycle2.**

# Logger library
-keep class com.orhanobut.logger.** { *; }
-dontwarn com.orhanobut.logger.**

# Flurry Analytics (referenced in CLAUDE.md)
-keep class com.flurry.** { *; }
-dontwarn com.flurry.**

# Sentry (referenced in CLAUDE.md)
-keep class io.sentry.** { *; }
-dontwarn io.sentry.**

# Keep only essential application classes (allow most classes to be obfuscated)
-keep class me.ghui.v2er.BuildConfig { *; }
-keep class me.ghui.v2er.R { *; }
-keep class me.ghui.v2er.R$* { *; }

# Keep Application class and Activities (required by Android)
-keep class me.ghui.v2er.Application { *; }
-keep class * extends android.app.Application { *; }

# Keep data models used for JSON parsing (Gson/Fruit)
-keep class me.ghui.v2er.network.bean.** { *; }

# Keep classes with native methods
-keepclasseswithmembernames class * {
native <methods>;
}

# Keep all Activities, Services, BroadcastReceivers
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider

# Keep view constructors (for layout inflation)
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

# Keep custom views and their constructors
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}

# Keep Parcelable implementations
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator CREATOR;
}

# Keep enums
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
Loading