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

Should the ProGuard rules include -dontnote rules? #1900

Closed
Whathecode opened this issue Apr 12, 2022 · 0 comments
Closed

Should the ProGuard rules include -dontnote rules? #1900

Whathecode opened this issue Apr 12, 2022 · 0 comments
Assignees
Labels

Comments

@Whathecode
Copy link
Contributor

What is your use-case and why do you need this feature?

When running a build with ProGuard 7.2.1, I get a lot of notes in the output similar to:

Note: the configuration keeps the entry point 'some.serializable.Class$$serializer { some.serializable.Class deserialize(kotlinx.serialization.encoding.Decoder); }', but not the descriptor class 'kotlinx.serialization.encoding.Decoder'
Note: the configuration keeps the entry point 'some.serializable.Class$$serializer { void serialize(kotlinx.serialization.encoding.Encoder,some.serializable.Class); }', but not the descriptor class 'kotlinx.serialization.encoding.Encoder'

Similar notes are added for:

  • kotlinx.serialization.encoding.CompositeEncoder
  • kotlinx.serialization.descriptors.SerialDescriptor
  • kotlinx.serialization.internal.SerializationConstructorMarker
  • kotlinx.serialization.KSerializer

Describe the solution you'd like

Should we add the following to the Android ProGuard rules? These remove all the notes for me.

-dontnote kotlinx.serialization.encoding.*
-dontnote kotlinx.serialization.internal.*
-dontnote kotlinx.serialization.KSerializer
-dontnote kotlinx.serialization.descriptors.SerialDescriptor

I'm fairly confident the internal namespace can safely be ignored. After all, these classes are supposed to be internal, so obfuscation should not matter. But, I wonder whether it doesn't make sense to simply ignore the entire kotlinx.serialization.** namespace. I don't imagine obfuscation would ever be a problem. Wouldn't the only use case to not want these classes to be obfuscated be to expose serializers in an API? E.g., you may want to keep kotlinx.serialization.KSerializer and SerialDescriptor. But, I somehow doubt that's a common use case.

P.s. In a previous PR I removed a -dontnote kotlinx.serialization.AnnotationsKt rule. I tried adding this again, but, this does not make a difference.

@Whathecode Whathecode changed the title Should the ProGuard rules include -dontnote? Should the ProGuard rules include -dontnote rules? Apr 12, 2022
shanshin added a commit that referenced this issue Nov 8, 2022
Resolves #1121
Resolves #1899
Resolves #1900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants