From f928699950b07706140363057909db1ce1bd0a64 Mon Sep 17 00:00:00 2001 From: Rui <102453770+ruixhuang@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:37:11 -0800 Subject: [PATCH] Fix crash on release build (#12) * Fix crash on release build * Update version --- app/proguard-rules.pro | 12 +++++++++++- cartera/build.gradle | 4 ++-- cartera/proguard-rules.pro | 2 +- .../main/java/exchange/dydx/cartera/CarteraConfig.kt | 2 +- gradle.properties | 4 +++- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index f4b5930..f674c16 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -28,4 +28,14 @@ -dontwarn org.conscrypt.ConscryptHostnameVerifier -dontwarn org.openjsse.javax.net.ssl.SSLParameters -dontwarn org.openjsse.javax.net.ssl.SSLSocket --dontwarn org.openjsse.net.ssl.OpenJSSE \ No newline at end of file +-dontwarn org.openjsse.net.ssl.OpenJSSE + +# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher. +-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken +-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken +-keep class com.google.gson.reflect.TypeToken +-keep class * extends com.google.gson.reflect.TypeToken +-keep public class * implements java.lang.reflect.Type + +-dontwarn java.beans.ConstructorProperties +-dontwarn java.beans.Transient \ No newline at end of file diff --git a/cartera/build.gradle b/cartera/build.gradle index 4d8e711..ee59503 100644 --- a/cartera/build.gradle +++ b/cartera/build.gradle @@ -61,10 +61,10 @@ dependencies { // https://github.com/WalletConnect/WalletConnectKotlinV2 // - implementation platform('com.walletconnect:android-bom:1.15.0') + implementation platform('com.walletconnect:android-bom:1.18.0') implementation('com.walletconnect:android-core') implementation 'com.walletconnect:sign' - implementation 'com.walletconnect:push' + //implementation 'com.walletconnect:push' // // https://docs.cloud.coinbase.com/wallet-sdk/docs/android-install diff --git a/cartera/proguard-rules.pro b/cartera/proguard-rules.pro index f1b4245..481bb43 100644 --- a/cartera/proguard-rules.pro +++ b/cartera/proguard-rules.pro @@ -18,4 +18,4 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/cartera/src/main/java/exchange/dydx/cartera/CarteraConfig.kt b/cartera/src/main/java/exchange/dydx/cartera/CarteraConfig.kt index 9f199cf..28cab1d 100644 --- a/cartera/src/main/java/exchange/dydx/cartera/CarteraConfig.kt +++ b/cartera/src/main/java/exchange/dydx/cartera/CarteraConfig.kt @@ -138,7 +138,7 @@ class CarteraConfig( private fun registerWalletsInternal(walletConfigJsonData: String): List? { val gson = Gson() - val walletListType: Type = object : TypeToken?>() {}.type + val walletListType: Type = object : TypeToken?>() {}.type return gson.fromJson(walletConfigJsonData, walletListType) } diff --git a/gradle.properties b/gradle.properties index 2a4eb8e..f6b5dd1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,4 +26,6 @@ android.nonTransitiveRClass=true LIBRARY_GROUP=dydxprotocol LIBRARY_ARTIFACT_ID=cartera-android -LIBRARY_VERSION_NAME=0.0.9 \ No newline at end of file +LIBRARY_VERSION_NAME=0.0.10 + +android.enableR8.fullMode = false \ No newline at end of file