diff --git a/app/build.gradle b/app/build.gradle index 40a5ac75..d91eb4ba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -71,6 +71,8 @@ android { def abiCodes = ['universal': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'x86': 4, 'x86_64': 5] packagingOptions { resources { + pickFirst 'META-INF/LICENSE.md' + pickFirst 'META-INF/NOTICE.md' excludes += ['META-INF/DEPENDENCIES.txt', 'META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/LICENSE', 'META-INF/DEPENDENCIES', 'META-INF/notice.txt', 'META-INF/license.txt', 'META-INF/dependencies.txt', 'META-INF/LGPL2.1'] } } @@ -159,6 +161,8 @@ dependencies { //EmailKit implementation 'com.github.mailhu:emailkit:4.2.2' + implementation 'com.sun.mail:android-mail:1.6.7' + implementation 'com.sun.mail:android-activation:1.6.7' //Lombok //noinspection AnnotationProcessorOnCompilePath diff --git a/app/src/main/java/com/idormy/sms/forwarder/MyApplication.java b/app/src/main/java/com/idormy/sms/forwarder/MyApplication.java index 91adb2e7..089913dd 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/MyApplication.java +++ b/app/src/main/java/com/idormy/sms/forwarder/MyApplication.java @@ -22,6 +22,7 @@ import com.idormy.sms.forwarder.utils.PermissionInterceptor; import com.idormy.sms.forwarder.utils.PhoneUtils; import com.idormy.sms.forwarder.utils.SettingUtil; import com.idormy.sms.forwarder.utils.SharedPreferencesHelper; +import com.smailnet.emailkit.EmailKit; import com.umeng.commonsdk.UMConfigure; import java.util.ArrayList; @@ -88,7 +89,7 @@ public class MyApplication extends Application { SendHistory.init(this); SettingUtil.init(this); - //EmailKit.initialize(this); + EmailKit.initialize(this); SharedPreferences sp = MyApplication.this.getSharedPreferences(Define.SP_CONFIG, Context.MODE_PRIVATE); showHelpTip = sp.getBoolean(Define.SP_CONFIG_SWITCH_HELP_TIP, true); diff --git a/app/src/main/java/com/idormy/sms/forwarder/sender/SenderMailMsg.java b/app/src/main/java/com/idormy/sms/forwarder/sender/SenderMailMsg.java index 0dbb048a..9266315f 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/sender/SenderMailMsg.java +++ b/app/src/main/java/com/idormy/sms/forwarder/sender/SenderMailMsg.java @@ -3,7 +3,6 @@ package com.idormy.sms.forwarder.sender; import android.os.Handler; import android.util.Log; -import com.idormy.sms.forwarder.MyApplication; import com.idormy.sms.forwarder.utils.LogUtil; import com.smailnet.emailkit.Draft; import com.smailnet.emailkit.EmailKit; @@ -22,7 +21,7 @@ public class SenderMailMsg extends SenderBaseMsg { try { //初始化框架 - EmailKit.initialize(MyApplication.getContext()); + //EmailKit.initialize(MyApplication.getContext()); //配置发件人邮件服务器参数 EmailKit.Config config = new EmailKit.Config()