Firstly, I already mentioned a similar post, Android, javamail and proguard
The decision was made to explicitly save 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 glance, this seemed to work, as it was compiled without any warning. However, it does not read the contents of the message and simply skips it. I tried the following:
- -includelibraryjars explicitly names the 3 jar files needed for javamail.
- - freed banks as an external library, following the new libs / include format.
- -Got the default android settings in proguard-android.txt
- - Followed the troubleshooting guide for the proguard faq file.
- - launched a new project and copied it to the source files.
- -tried various proguard options, including -dontshrink, keepnames, etc.
- -objective project / clean
After hours of disappointment, here is 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, this is absurd, because I include -dontobfuscate and -dontshrink. Does any protector and javal guru have a solution? I am ADT17 using 2.1 (api7) for build. If I could completely eliminate banks from the process? At the moment, any advice would be a godsend.
ThumbsDP
source share