You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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! 🙇♂️
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?
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?
@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())
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
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! 🙇♂️
@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
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.
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.
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.
Activity
stale commentedon Sep 21, 2020
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! 🙇♂️
gadregit commentedon Dec 14, 2020
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?
almakhanov commentedon Oct 8, 2021
same issue
lbalmaceda commentedon Oct 11, 2021
@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=trueproperty.proguards-rules.prois 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
Gsonproguard rules, as that's really the only dependency being used here. Thanksstale commentedon Mar 2, 2022
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! 🙇♂️
emartynov commentedon Mar 9, 2022
I believe this is due to usage of GSON.
emartynov commentedon Mar 9, 2022
I need help or some rubber ducking. The library works in debug. However, has issue when obfuscated.
Here is the code:
It doesn't produce any exception. I see output:
I have rules for GSON added. Any ideas what can go wrong?
Wewe12 commentedon Mar 15, 2022
@emartynov are you sure that you used the latest Gson proguard rules? Check if you have this rule:
I had similar problem and resolved it in this way
emartynov commentedon Mar 15, 2022
Thank you Ewelina, I have these already. I'm checking one more time why I have this problem.
emartynov commentedon Mar 29, 2022
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.
spacemase commentedon Aug 8, 2023
proguard rules should be supplied by JWT.decode. The directives above should be added to this
consumerProguardFilesfile, so everyone's projects work and the necessary directives are visible to consumers.