First off, i've already to referred to a similar post, Android, javamail and proguard
The solution mentioned was to explicitly keep the following in proguard-project.txt:
-dontwarn java.awt.**
-dontwarn java.beans.Beans
-dontwarn javax.security.**
-keep class javamail.** {*;}
-keep class javax.mail.** {*;}
-keep class javax.activation.** {*;}
-keep class com.sun.mail.dsn.** {*;}
-keep class com.sun.mail.handlers.** {*;}
-keep class com.sun.mail.smtp.** {*;}
-keep class com.sun.mail.util.** {*;}
-keep class mailcap.** {*;}
-keep class mimetypes.** {*;}
-keep class myjava.awt.datatransfer.** {*;}
-keep class org.apache.harmony.awt.** {*;}
-keep class org.apache.harmony.misc.** {*;}
At first sight, this seemed to work, as it compiled without any warnings. However, it fails at reading the message content and just skips right over it. I've tried the following:
- -includelibraryjars explicitly naming the 3 jar files required for javamail.
- -removed the jars as an external library, following the new libs/ include format.
- -maintained the default android settings in proguard-android.txt
- -followed the troubleshooting guide in the proguard faq.
- -started a new project and copied over the source files to it.
- -tried various proguard options, including -dontshrink, keepnames, etc
- -obsessive project/clean
After a few hours of frustration, here's what i found that seemed to work:
-dontobfuscate
-dontshrink
-keepdirectories
-keeppackagenames javax.mail.**
-keeppackagenames javax.activation.**
-keeppackagenames com.sun.mail.**
-keeppackagenames myjava.**
-keeppackagenames org.apache.harmony.**
-keeppackagenames mailcap.**
-keeppackagenames mimetypes.**
-keep class javamail.** {*;}
-keep class javax.mail.** {*;}
-keep class javax.activation.** {*;}
-keep class com.sun.mail.dsn.** {*;}
-keep class com.sun.mail.handlers.** {*;}
-keep class com.sun.mail.smtp.** {*;}
-keep class com.sun.mail.util.** {*;}
-keep class mailcap.** {*;}
-keep class mimetypes.** {*;}
-keep class myjava.awt.datatransfer.** {*;}
-keep class org.apache.harmony.awt.** {*;}
-keep class org.apache.harmony.misc.** {*;}
-dontwarn java.awt.**
-dontwarn java.beans.Beans
-dontwarn javax.security.**
Of course that's absurd because i'm turning on -dontobfuscate and -dontshrink. Any proguard and javamail gurus have a solution to this? I'm ADT17, using 2.1(api7) for the build. If i could exclude the jars entirely from the process maybe? Any advice will be a godsend at this point.