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 keep rule for kotlin.coroutines.Continuation #3563

Merged

Conversation

mkj-gram
Copy link
Contributor

I am unsure if the factory that checks for suspend functions relies on the name. If not, and the library do not need the name or location, this could be -keep,allowobfuscation instead.

@JakeWharton
Copy link
Collaborator

Sorry I missed this. We do not rely on the name so we can allow obfuscation. Also you'll need to rebase since Christoffer also sent a PR to add a rule.

The check for coroutines is the very last attempt to match a method signature so we compare against a class literal which has a try/catch:

try {
  if (Utils.getRawType(parameterType) == Continuation.class) {
    isKotlinSuspendFunction = true;
    return null;
  }
} catch (NoClassDefFoundError ignored) {
}
throw parameterError(method, p, "No Retrofit annotation found.");

Add keep rule to retain generic signature of Call
@mkj-gram mkj-gram force-pushed the add-kotlin-continuation-keeprule branch from 6901c29 to 0aef0d7 Compare July 13, 2021 07:57
@mkj-gram
Copy link
Contributor Author

I rebased (I think) and also allowed for obfuscation and shrinking.

@JakeWharton JakeWharton merged commit b33d43d into square:master Jul 13, 2021
@JakeWharton
Copy link
Collaborator

Thanks!

@Simay15
Copy link

Simay15 commented Jul 28, 2022

android.enableR8.fullMode=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants