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

SecureCredentialsManager.getCredentials fails when minifyEnabled is true #462

Closed
sproctor opened this issue Feb 24, 2021 · 1 comment · Fixed by #465
Closed

SecureCredentialsManager.getCredentials fails when minifyEnabled is true #462

sproctor opened this issue Feb 24, 2021 · 1 comment · Fixed by #465
Labels
needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue

Comments

@sproctor
Copy link

Describe the problem

https://github.com/auth0/Auth0.Android/blob/main/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt#L305

bridgeCredentials fails to properly parse json when shipping a minified build. Adding proguard rules found here works around this issue: https://medium.com/@harryaung/mysterious-null-crash-with-gson-serializedname-fields-when-r8-proguard-is-on-f8a4bd036e34

This issue is new in 2.0

What was the expected behavior?

minifyEnabled to work without adding extra rules.

Environment

Auth0.Android 2.0.0

@lbalmaceda
Copy link
Contributor

Thanks. I'll add these rules to the consumer proguard rules so that it gets shipped with the next release.

In the meantime, and for anyone looking for a solution in 2.0.0, add the following rules to the proguard rules file in your project.

-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}
-keep,allowobfuscation @interface com.google.gson.annotations.SerializedName

I'll tag this as needs-investigation to signal that the follow-up is on my side.

@lbalmaceda lbalmaceda added the needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants