Skip to content

Commit

Permalink
Add important proguard rules to keep Netty classes
Browse files Browse the repository at this point in the history
Issues with those only manifest in release builds with proguard turned on.

This commit also removes some proguard warnings related to Netty.
  • Loading branch information
grote committed Aug 17, 2023
1 parent d7d408e commit d0fbfa8
Showing 1 changed file with 20 additions and 2 deletions.
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.**

0 comments on commit d0fbfa8

Please sign in to comment.