Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add important proguard rules to keep Netty classes #101

Merged
merged 2 commits into from
Aug 18, 2023
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
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
benchmark {
Expand Down
22 changes: 20 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,26 @@
#-renamesourcefileattribute SourceFile

-dontobfuscate
-keepattributes SourceFile, LineNumberTable, *Annotation*, Signature, InnerClasses, EnclosingMethod

-keep class org.onionshare.android.** { *; }
-keep class org.torproject.jni.** { *; }

-keep class ch.qos.** { *; }
-keep class org.slf4j.** { *; }
# Keep logging
-keep public class org.slf4j.** { *; }
-keep public class ch.qos.logback.** { *; }

# Keep Netty classes that are loaded via reflection
-keep class io.netty.util.ReferenceCountUtil { *; }
-keep class io.netty.buffer.WrappedByteBuf { *; }

-dontwarn com.fasterxml.jackson.databind.ext.Java7SupportImpl
-dontwarn io.netty.internal.tcnative.*
-dontwarn java.lang.management.*
-dontwarn org.apache.log4j.*
-dontwarn org.apache.logging.log4j.**
-dontwarn org.conscrypt.*
-dontwarn org.eclipse.jetty.npn.*
-dontwarn org.jetbrains.annotations.*
-dontwarn reactor.blockhound.integration.BlockHoundIntegration
-dontwarn javax.mail.**
Loading