From 7d6c00a4b895a57e1a2ea49d61cf10c762c8c683 Mon Sep 17 00:00:00 2001 From: Giovani Gonzalez Date: Tue, 13 Feb 2024 12:56:39 -0600 Subject: [PATCH 1/2] Adding fix for R8 --- example/build.gradle | 2 +- example/proguard-rules.pro | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/build.gradle b/example/build.gradle index 1b6255d73..e84d8622b 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -31,7 +31,7 @@ android { buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } diff --git a/example/proguard-rules.pro b/example/proguard-rules.pro index 481bb4348..9cb6c424d 100644 --- a/example/proguard-rules.pro +++ b/example/proguard-rules.pro @@ -18,4 +18,6 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile +-dontwarn java.beans.ConstructorProperties +-dontwarn java.beans.Transient \ No newline at end of file From 8487d36d42128a7c0382647820c49342eff6c267 Mon Sep 17 00:00:00 2001 From: Giovani Gonzalez Date: Mon, 19 Feb 2024 18:01:56 -0600 Subject: [PATCH 2/2] Updating obfuscation for R8 --- example/proguard-rules.pro | 35 +++++++++++++++++++++++++++++++++-- library/proguard-rules.pro | 3 ++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/example/proguard-rules.pro b/example/proguard-rules.pro index 9cb6c424d..806edf49e 100644 --- a/example/proguard-rules.pro +++ b/example/proguard-rules.pro @@ -14,10 +14,41 @@ # Uncomment this to preserve the line number information for # debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +-keepattributes SourceFile,LineNumberTable +-printconfiguration ~/tmp/full-r8-config.txt # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile +-keep public class * extends android.view.View { + public (android.content.Context); +} -dontwarn java.beans.ConstructorProperties --dontwarn java.beans.Transient \ No newline at end of file +-dontwarn java.beans.Transient + +-keep class com.walletconnect.* { *; } +-keep class com.walletconnect.wcmodal.client.* { *; } + +-keepclasseswithmembernames class org.xmtp.proto.message.contents.* { *; } +-keep class com.sun.jna.* { *; } +-keep class uniffi.xmtpv3.* { *; } + +-dontwarn java.awt.Component +-dontwarn java.awt.GraphicsEnvironment +-dontwarn java.awt.HeadlessException +-dontwarn java.awt.Window + +# Lifecycle +-keep public interface androidx.lifecycle.** { *; } + +-assumenosideeffects class android.util.Log { + public static *** d(...); + public static *** v(...); + public static *** i(...); +} + +-dontwarn com.google.android.gms.** +-keep public class com.google.android.gms.** +-keep class com.google.android.gms.common.ConnectionResult { + int SUCCESS; +} diff --git a/library/proguard-rules.pro b/library/proguard-rules.pro index b17f2462e..3817f55a7 100644 --- a/library/proguard-rules.pro +++ b/library/proguard-rules.pro @@ -22,4 +22,5 @@ -dontwarn java.awt.* -keep class com.sun.jna.* { *; } --keepclassmembers class * extends com.sun.jna.* { public *; } \ No newline at end of file +-keepclassmembers class * extends com.sun.jna.* { public *; } +-keepclassmembers class * extends com.walletconnect.* { *; } \ No newline at end of file