Skip to content

Pro-guard Issue #49

Closed
Closed

Description

@Srj-Love

I'm not able to extract data when I enable minifyEnabled true in release build, instead it's working perfectly in debug mode.

Activity

  1. stale commented on Sep 21, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

  2. gadregit commented on Dec 14, 2020

    @gadregit

    I am also facing the same issue, the moment i turn on minifyEnabled true in my build gradle for different build type it crashes right upon login. Are there any proguard rules that we need to follow when adding this library?

  3. almakhanov commented on Oct 8, 2021

    @almakhanov

    I am also facing the same issue, the moment i turn on minifyEnabled true in my build gradle for different build type it crashes right upon login. Are there any proguard rules that we need to follow when adding this library?

    same issue

  4. lbalmaceda commented on Oct 11, 2021

    @lbalmaceda
    Contributor

    @gadregit @almakhanov I cannot reproduce this. I tried using this library to decode a simple JWT and print one of its claims. I'm using the release build with the minifyEnabled=true property.

    val jwt = JWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
    Log.e("TEST", jwt.subject.toString())

    image
    image

    proguards-rules.pro is an empty file, and the other one is the default included with the Android SDK.

    If you can please share a reproduceable sample. Otherwise, you can try looking for Gson proguard rules, as that's really the only dependency being used here. Thanks

  5. added
    waiting for customerThis issue is waiting for a response from the issue or PR author
    and removed
    closed:staleIssue or PR has not seen activity recently
    on Oct 11, 2021
  6. stale commented on Mar 2, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

  7. added
    closed:staleIssue or PR has not seen activity recently
    on Mar 2, 2022
  8. emartynov commented on Mar 9, 2022

    @emartynov

    I believe this is due to usage of GSON.

  9. removed
    closed:staleIssue or PR has not seen activity recently
    on Mar 9, 2022
  10. emartynov commented on Mar 9, 2022

    @emartynov

    I need help or some rubber ducking. The library works in debug. However, has issue when obfuscated.

    Here is the code:

                            Timber.d("JWT ${jwtValue}")
                            val jwtToken = JWT(jwtValue)
                            val claim = jwtToken.claims["e"]
                            Timber.d("JSON ${claim!!.asString()}")
    

    It doesn't produce any exception. I see output:

    JWT eyJ0eXAiOiJ.....
    JSON null
    

    I have rules for GSON added. Any ideas what can go wrong?

  11. Wewe12 commented on Mar 15, 2022

    @Wewe12

    @emartynov are you sure that you used the latest Gson proguard rules? Check if you have this rule:

    # 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
    

    I had similar problem and resolved it in this way

  12. emartynov commented on Mar 15, 2022

    @emartynov

    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

    Thank you Ewelina, I have these already. I'm checking one more time why I have this problem.

  13. emartynov commented on Mar 29, 2022

    @emartynov

    Oke, to update you about our issue - we are getting our class data serialized in the JWT. So problem was that we obfuscated own class and since our project don't use GSON annotations that was not possible to deserialize.

  14. spacemase commented on Aug 8, 2023

    @spacemase

    proguard rules should be supplied by JWT.decode. The directives above should be added to this consumerProguardFiles file, so everyone's projects work and the necessary directives are visible to consumers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for customerThis issue is waiting for a response from the issue or PR author

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions