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

Update proguard rules #3310

Merged
merged 5 commits into from
Sep 20, 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
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,17 @@ android {
debug {
minifyEnabled false
shrinkResources false
// proguardFiles getDefaultProguardFile('proguard-android.txt'),
// 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

release {
minifyEnabled false
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

if (signingConfigs.release.storeFile) {
signingConfig signingConfigs.release
}
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
Expand Down
59 changes: 58 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations

# If you keep the line number information, uncomment this to
# hide the original source file name.
Expand All @@ -29,11 +30,67 @@
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-allowaccessmodification
-verbose
-printseeds seeds.txt
-printusage unused.txt
-printmapping mapping.txt
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-dontwarn jnr.posix.**
-dontwarn org.slf4j.**

-keepattributes Signature
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

#---------------Begin: proguard configuration for support library ----------
-keep class wallet.core {*;}
-keepclassmembers class * extends android.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}

-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}

#trust library
-keep class wallet.core.jni.HDWallet { *; }
-keep class wallet.core.jni.Hash { *; }
-keep class wallet.core.jni.Curve { *; }
-keep class wallet.core.jni.CoinType { *; }
-keep class wallet.core.jni.Mnemonic { *; }
-keep class wallet.core.jni.PrivateKey { *; }
-keep class wallet.core.jni.proto.** { *; }

#entities, jsInterface & listeners
-keep class com.alphawallet.token.** { *; }
-keep class com.alphawallet.app.walletconnect.** { *; }
-keep class com.alphawallet.app.web3.** { *; }
-keep class com.alphawallet.app.web3j.** { *; }
-keep class com.alphawallet.app.entity.** { *; }
-keep class io.stormbird.wallet.model.api.** { *; }

-keep public class java.beans.* { *; }
-keep class jnr.unixsocket.* { *; }
-keep class org.java_websocket.client.*
-keep class org.java_websocket.handshake.*

-keepclassmembers class org.web3j.protocol.** { *; }
-keepclassmembers class org.web3j.crypto.* { *; }

-keep class * extends org.web3j.abi.TypeReference
-keep class * extends org.web3j.abi.datatypes.Type

-dontwarn org.bouncycastle.jce.provider.X509LDAPCertStoreSpi
-dontwarn org.bouncycastle.x509.util.LDAPStoreHelper

-keep class java.beans.Transient.** {*;}
-keep class java.beans.ConstructorProperties.** {*;}
-keep class java.nio.file.Path.** {*;}

-repackageclasses
#-dontobfuscate
#-printconfiguration ../full-r8-config.txt
Loading