Skip to content Skip to sidebar Skip to footer

Proguard Removes Com.sun.mail.imap.imapprovider

In my app I send emails to some specific address, it all works fine, but when it comes to obfuscation, shrinking, etc with ProGuard it fails I've tried adding some ProGuard rules,

Solution 1:

Well, I found the solution. It's not great, but at least it works

-keep classcom.sun.mail.imap.IMAPProvider
-keep classcom.sun.mail.imap.IMAPSSLProvider
-keep classcom.sun.mail.smtp.** {*;}

Solution 2:

Using keepclassmembernames for a class tells ProGuard not to obfuscate the class members, but does not have an effect on the class itself. So ProGuard does its job and changes the class name.

So if you want to prevent ProGuard from obfuscating the class name you should use keepnames instead.

To prevent both the obfuscation and shrinking (which is removing in case of not being used), you should use keepclassmembers if you want to target only the class members and keep to target the class itself and its members.

Post a Comment for "Proguard Removes Com.sun.mail.imap.imapprovider"