-
Notifications
You must be signed in to change notification settings - Fork 54
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
Removing okhttp testing deobfuscation #180
Conversation
android { | ||
buildTypes { | ||
debug { | ||
isMinifyEnabled = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong but I guess isMinifyEnabled
is NoOp for debug
builds, not sure if this has something to do with the problem you've faced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if that's the reason because it seems to work well when the desugaring is disabled 🤔 The problem I saw with desugaring enabled is that it seems like the corelib classes are trimmed by R8, even though I add rules to keep them... Specifically, the test crashed because the function Duration.toMillis wasn't found, and the error was mentioning the class like so: Lj$/time/Duration;
. I'm guessing j$
is the shade name given by Google's desugaring to the corelib classes.
Based on that, I tried to avoid it by adding these rules:
-keep class java.time.** { *; }
-keep class j$.time.** { *; }
But no luck, they seem to be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test on API >= 26?
https://developer.android.com/reference/java/time/Duration#toMillis()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was done on API 33.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, thats what this PR does and the java.time
requires desugaring so I guess its the right solution.
I wanted to include R8/ProGuard verifications to the okhttp instrumentation test, however, R8/ProGuard doesn't seem to work well when corelib desugaring is enabled, so I've deleted the R8/ProGuard verification in this PR to address this issue.