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

Minimisation with Proguard causes a ClassCastException on GSON #6

Open
ntyrrell-decodedsolutions opened this issue May 8, 2017 · 0 comments

Comments

@ntyrrell-decodedsolutions

When minimised using Proguard listed below, a ClassCastException occurs.

I believe that this is caused by the following lines (309 - 313 of HPPManagerFragment)
try {
mListener.hppManagerCompletedWithResult(ApiAdapter.getGson().fromJson(msg, method.getParameterTypes()[0]));
} catch (Exception error) {
mListener.hppManagerFailedWithError(new HPPError(msg, error, hppManager.getHppResponseConsumerURL()));
}

Proguard configuration
# Realex Payment
-keep class com.realexpayments.hpp.** { *; }
-keep class com.ex.ample.sync.dto.ConsumerResponse { *; }

-keepattributes Signature

-keepattributes *Annotation*

-keep class sun.misc.Unsafe { *; }

# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant