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

Add Java's R8 Proguard rules for Gson #465

Merged
merged 1 commit into from
Mar 9, 2021
Merged

Add Java's R8 Proguard rules for Gson #465

merged 1 commit into from
Mar 9, 2021

Conversation

lbalmaceda
Copy link
Contributor

Adds the Proguard rules required for Gson to deserialize credentials from the Credential Manager classes.

I was able to reproduce this issue with a snippet like the following:

val scm = SecureCredentialsManager(
    requireContext(),
    apiClient,
    SharedPreferencesStorage(requireContext())
)
scm.saveCredentials(result)
scm.getCredentials(object: Callback<Credentials, CredentialsManagerException> {
    override fun onSuccess(result: Credentials) {
        Log.e("TAG", "success")
    }

    override fun onFailure(error: CredentialsManagerException) {
        Log.e("TAG", "failure", error)
    }

})

The observed behavior before this change is that "failure" is logged. When the new rules are set, the snippet logs "success".

The changes include defining the debug signing configuration for easily testing the sample app with a release configuration.

Reference

https://r8.googlesource.com/r8/+/refs/heads/master/compatibility-faq.md
Closes #462

@lbalmaceda lbalmaceda added CH: Fixed small Small review labels Mar 3, 2021
@lbalmaceda lbalmaceda added this to the v2-Next milestone Mar 3, 2021
@lbalmaceda lbalmaceda requested a review from a team as a code owner March 3, 2021 17:23
@lbalmaceda lbalmaceda merged commit 3889261 into main Mar 9, 2021
@lbalmaceda lbalmaceda modified the milestones: v2-Next, 2.1.0 Mar 26, 2021
@poovamraj poovamraj deleted the pro-gson branch July 18, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed small Small review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SecureCredentialsManager.getCredentials fails when minifyEnabled is true
2 participants