Merge pull request #6053 from k9mail/jvm_logging
Replace usages of Timber in mail libraries
This commit is contained in:
commit
4cbd8424ee
39 changed files with 301 additions and 40 deletions
|
@ -285,6 +285,7 @@ object K9 : EarlyInit {
|
|||
|
||||
override fun debugSensitive(): Boolean = isSensitiveDebugLoggingEnabled
|
||||
})
|
||||
com.fsck.k9.logging.Timber.logger = TimberLogger()
|
||||
|
||||
checkCachedDatabaseVersion(context)
|
||||
|
||||
|
|
121
app/core/src/main/java/com/fsck/k9/TimberLogger.kt
Normal file
121
app/core/src/main/java/com/fsck/k9/TimberLogger.kt
Normal file
|
@ -0,0 +1,121 @@
|
|||
package com.fsck.k9
|
||||
|
||||
import android.os.Build
|
||||
import com.fsck.k9.logging.Logger
|
||||
import java.util.regex.Pattern
|
||||
import timber.log.Timber
|
||||
|
||||
class TimberLogger : Logger {
|
||||
override fun v(message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.v(message, *args)
|
||||
}
|
||||
|
||||
override fun v(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.v(t, message, *args)
|
||||
}
|
||||
|
||||
override fun v(t: Throwable?) {
|
||||
setTimberTag()
|
||||
Timber.v(t)
|
||||
}
|
||||
|
||||
override fun d(message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.d(message, *args)
|
||||
}
|
||||
|
||||
override fun d(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.d(t, message, *args)
|
||||
}
|
||||
|
||||
override fun d(t: Throwable?) {
|
||||
setTimberTag()
|
||||
Timber.d(t)
|
||||
}
|
||||
|
||||
override fun i(message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.i(message, *args)
|
||||
}
|
||||
|
||||
override fun i(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.i(t, message, *args)
|
||||
}
|
||||
|
||||
override fun i(t: Throwable?) {
|
||||
setTimberTag()
|
||||
Timber.i(t)
|
||||
}
|
||||
|
||||
override fun w(message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.w(message, *args)
|
||||
}
|
||||
|
||||
override fun w(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.w(t, message, *args)
|
||||
}
|
||||
|
||||
override fun w(t: Throwable?) {
|
||||
setTimberTag()
|
||||
Timber.w(t)
|
||||
}
|
||||
|
||||
override fun e(message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.e(message, *args)
|
||||
}
|
||||
|
||||
override fun e(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
setTimberTag()
|
||||
Timber.e(t, message, *args)
|
||||
}
|
||||
|
||||
override fun e(t: Throwable?) {
|
||||
setTimberTag()
|
||||
Timber.e(t)
|
||||
}
|
||||
|
||||
private fun setTimberTag() {
|
||||
val tag = Throwable().stackTrace
|
||||
.first { it.className !in IGNORE_CLASSES }
|
||||
.let(::createStackElementTag)
|
||||
|
||||
// We explicitly set a tag, otherwise Timber will always derive the tag "TimberLogger".
|
||||
Timber.tag(tag)
|
||||
}
|
||||
|
||||
private fun createStackElementTag(element: StackTraceElement): String {
|
||||
var tag = element.className.substringAfterLast('.')
|
||||
val matcher = ANONYMOUS_CLASS.matcher(tag)
|
||||
if (matcher.find()) {
|
||||
tag = matcher.replaceAll("")
|
||||
}
|
||||
|
||||
// Tag length limit was removed in API 26.
|
||||
return if (tag.length <= MAX_TAG_LENGTH || Build.VERSION.SDK_INT >= 26) {
|
||||
tag
|
||||
} else {
|
||||
tag.substring(0, MAX_TAG_LENGTH)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val MAX_TAG_LENGTH = 23
|
||||
private val ANONYMOUS_CLASS = Pattern.compile("(\\$\\d+)+$")
|
||||
|
||||
private val IGNORE_CLASSES = setOf(
|
||||
Timber::class.java.name,
|
||||
Timber.Forest::class.java.name,
|
||||
Timber.Tree::class.java.name,
|
||||
Timber.DebugTree::class.java.name,
|
||||
TimberLogger::class.java.name,
|
||||
com.fsck.k9.logging.Timber::class.java.name
|
||||
)
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ buildscript {
|
|||
versions = [
|
||||
'kotlin': '1.6.10',
|
||||
'kotlinCoroutines': '1.6.0',
|
||||
'jetbrainsAnnotations': '23.0.0',
|
||||
'androidxAppCompat': '1.4.1',
|
||||
'androidxActivity': '1.4.0',
|
||||
'androidxRecyclerView': '1.2.1',
|
||||
|
|
|
@ -6,11 +6,12 @@ if (rootProject.testCoverage) {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
api "org.jetbrains:annotations:${versions.jetbrainsAnnotations}"
|
||||
|
||||
implementation "org.apache.james:apache-mime4j-core:${versions.mime4j}"
|
||||
implementation "org.apache.james:apache-mime4j-dom:${versions.mime4j}"
|
||||
implementation "com.squareup.okio:okio:${versions.okio}"
|
||||
implementation "commons-io:commons-io:${versions.commonsIo}"
|
||||
implementation "com.jakewharton.timber:timber:${versions.timber}"
|
||||
implementation "com.squareup.moshi:moshi:${versions.moshi}"
|
||||
|
||||
testImplementation project(":mail:testing")
|
||||
|
|
26
mail/common/src/main/java/com/fsck/k9/logging/Logger.kt
Normal file
26
mail/common/src/main/java/com/fsck/k9/logging/Logger.kt
Normal file
|
@ -0,0 +1,26 @@
|
|||
package com.fsck.k9.logging
|
||||
|
||||
/**
|
||||
* Logging abstraction based on Timber.
|
||||
*/
|
||||
interface Logger {
|
||||
fun v(message: String?, vararg args: Any?)
|
||||
fun v(t: Throwable?, message: String?, vararg args: Any?)
|
||||
fun v(t: Throwable?)
|
||||
|
||||
fun d(message: String?, vararg args: Any?)
|
||||
fun d(t: Throwable?, message: String?, vararg args: Any?)
|
||||
fun d(t: Throwable?)
|
||||
|
||||
fun i(message: String?, vararg args: Any?)
|
||||
fun i(t: Throwable?, message: String?, vararg args: Any?)
|
||||
fun i(t: Throwable?)
|
||||
|
||||
fun w(message: String?, vararg args: Any?)
|
||||
fun w(t: Throwable?, message: String?, vararg args: Any?)
|
||||
fun w(t: Throwable?)
|
||||
|
||||
fun e(message: String?, vararg args: Any?)
|
||||
fun e(t: Throwable?, message: String?, vararg args: Any?)
|
||||
fun e(t: Throwable?)
|
||||
}
|
36
mail/common/src/main/java/com/fsck/k9/logging/NoOpLogger.kt
Normal file
36
mail/common/src/main/java/com/fsck/k9/logging/NoOpLogger.kt
Normal file
|
@ -0,0 +1,36 @@
|
|||
package com.fsck.k9.logging
|
||||
|
||||
/**
|
||||
* A [Logger] implementation that does nothing.
|
||||
*/
|
||||
class NoOpLogger : Logger {
|
||||
override fun v(message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun v(t: Throwable?, message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun v(t: Throwable?) = Unit
|
||||
|
||||
override fun d(message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun d(t: Throwable?, message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun d(t: Throwable?) = Unit
|
||||
|
||||
override fun i(message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun i(t: Throwable?, message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun i(t: Throwable?) = Unit
|
||||
|
||||
override fun w(message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun w(t: Throwable?, message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun w(t: Throwable?) = Unit
|
||||
|
||||
override fun e(message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun e(t: Throwable?, message: String?, vararg args: Any?) = Unit
|
||||
|
||||
override fun e(t: Throwable?) = Unit
|
||||
}
|
83
mail/common/src/main/java/com/fsck/k9/logging/Timber.kt
Normal file
83
mail/common/src/main/java/com/fsck/k9/logging/Timber.kt
Normal file
|
@ -0,0 +1,83 @@
|
|||
package com.fsck.k9.logging
|
||||
|
||||
/**
|
||||
* Our fake `Timber` object.
|
||||
*/
|
||||
object Timber {
|
||||
var logger: Logger = NoOpLogger()
|
||||
|
||||
@JvmStatic
|
||||
fun v(message: String?, vararg args: Any?) {
|
||||
logger.v(message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun v(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
logger.v(t, message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun v(t: Throwable?) {
|
||||
logger.v(t)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun d(message: String?, vararg args: Any?) {
|
||||
logger.d(message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun d(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
logger.d(t, message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun d(t: Throwable?) {
|
||||
logger.d(t)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun i(message: String?, vararg args: Any?) {
|
||||
logger.i(message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun i(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
logger.i(t, message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun i(t: Throwable?) {
|
||||
logger.i(t)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun w(message: String?, vararg args: Any?) {
|
||||
logger.w(message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun w(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
logger.w(t, message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun w(t: Throwable?) {
|
||||
logger.w(t)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun e(message: String?, vararg args: Any?) {
|
||||
logger.e(message)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun e(t: Throwable?, message: String?, vararg args: Any?) {
|
||||
logger.e(t, message, *args)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun e(t: Throwable?) {
|
||||
logger.e(t)
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.helper.Rfc822Token;
|
||||
import com.fsck.k9.mail.helper.Rfc822Tokenizer;
|
||||
import com.fsck.k9.mail.helper.TextUtils;
|
||||
|
@ -18,7 +19,6 @@ import org.apache.james.mime4j.dom.address.MailboxList;
|
|||
import org.apache.james.mime4j.field.address.DefaultAddressParser;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.VisibleForTesting;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class Address implements Serializable {
|
||||
private static final Pattern ATOM = Pattern.compile("^(?:[a-zA-Z0-9!#$%&'*+\\-/=?^_`{|}~]|\\s)+$");
|
||||
|
|
|
@ -7,8 +7,6 @@ import java.security.cert.X509Certificate;
|
|||
|
||||
import javax.net.ssl.SSLHandshakeException;
|
||||
|
||||
import android.security.KeyChainException;
|
||||
|
||||
public class CertificateValidationException extends MessagingException {
|
||||
public static final long serialVersionUID = -1;
|
||||
private final Reason mReason;
|
||||
|
@ -90,7 +88,7 @@ public class CertificateValidationException extends MessagingException {
|
|||
while (throwable != null
|
||||
&& !(throwable instanceof CertPathValidatorException)
|
||||
&& !(throwable instanceof CertificateException)
|
||||
&& !(throwable instanceof KeyChainException)
|
||||
&& !("android.security.KeyChainException".equals(throwable.getClass().getCanonicalName()))
|
||||
&& !(throwable instanceof SSLHandshakeException)) {
|
||||
throwable = throwable.getCause();
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.filter.CountingOutputStream;
|
||||
import com.fsck.k9.mail.filter.EOLConvertingOutputStream;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
public abstract class Message implements Part, Body {
|
||||
|
|
|
@ -9,12 +9,12 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.MessagingException;
|
||||
import com.fsck.k9.mail.filter.Base64OutputStream;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.james.mime4j.codec.QuotedPrintableOutputStream;
|
||||
import org.apache.james.mime4j.util.MimeUtil;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -146,4 +146,4 @@ public class BinaryTempFileBody implements RawDataBody, SizeAware {
|
|||
super.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package com.fsck.k9.mail.internet;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.Message;
|
||||
import com.fsck.k9.mail.MessagingException;
|
||||
import com.fsck.k9.mail.Part;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import timber.log.Timber;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.fsck.k9.mail.internet
|
||||
|
||||
import com.fsck.k9.logging.Timber
|
||||
import com.fsck.k9.mail.Message
|
||||
import com.fsck.k9.mail.MessagingException
|
||||
import java.io.ByteArrayInputStream
|
||||
|
@ -11,7 +12,6 @@ import okio.buffer
|
|||
import okio.source
|
||||
import org.apache.james.mime4j.codec.QuotedPrintableInputStream
|
||||
import org.apache.james.mime4j.util.CharsetUtil
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
* Decoder for encoded words (RFC 2047).
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Set;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.Body;
|
||||
import com.fsck.k9.mail.BodyPart;
|
||||
import com.fsck.k9.mail.Message;
|
||||
|
@ -19,7 +20,6 @@ import com.fsck.k9.mail.Part;
|
|||
import org.apache.commons.io.input.BoundedInputStream;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.mail.internet.CharsetSupport.fixupCharset;
|
||||
import static com.fsck.k9.mail.internet.MimeUtility.isSameMimeType;
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.Address;
|
||||
import com.fsck.k9.mail.Body;
|
||||
import com.fsck.k9.mail.BodyFactory;
|
||||
|
@ -37,7 +38,6 @@ import org.apache.james.mime4j.stream.BodyDescriptor;
|
|||
import org.apache.james.mime4j.stream.Field;
|
||||
import org.apache.james.mime4j.stream.MimeConfig;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Locale;
|
|||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.Body;
|
||||
import com.fsck.k9.mail.BodyPart;
|
||||
import com.fsck.k9.mail.Message;
|
||||
|
@ -20,7 +21,6 @@ import org.apache.james.mime4j.codec.QuotedPrintableInputStream;
|
|||
import org.apache.james.mime4j.util.MimeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.VisibleForTesting;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
public class MimeUtility {
|
||||
|
|
|
@ -3,12 +3,12 @@ package com.fsck.k9.mail.oauth;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.K9MailLib;
|
||||
import com.fsck.k9.mail.filter.Base64;
|
||||
import com.squareup.moshi.JsonAdapter;
|
||||
import com.squareup.moshi.JsonDataException;
|
||||
import com.squareup.moshi.Moshi;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.fsck.k9.mail.ssl
|
||||
|
||||
import com.fsck.k9.logging.Timber
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.io.FileNotFoundException
|
||||
|
@ -11,7 +12,6 @@ import java.security.NoSuchAlgorithmException
|
|||
import java.security.cert.Certificate
|
||||
import java.security.cert.CertificateException
|
||||
import java.security.cert.X509Certificate
|
||||
import timber.log.Timber
|
||||
|
||||
private const val KEY_STORE_FILE_VERSION = 1
|
||||
private val PASSWORD = charArrayOf()
|
||||
|
|
|
@ -10,12 +10,12 @@ import java.security.cert.X509Certificate;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.CertificateChainException;
|
||||
import javax.net.ssl.SSLException;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import org.apache.http.conn.ssl.StrictHostnameVerifier;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class TrustManagerFactory {
|
||||
public static TrustManagerFactory createInstance(LocalKeyStore localKeyStore) {
|
||||
|
|
|
@ -11,7 +11,6 @@ dependencies {
|
|||
implementation "com.jcraft:jzlib:1.0.7"
|
||||
implementation "com.beetstra.jutf7:jutf7:1.0.0"
|
||||
implementation "commons-io:commons-io:${versions.commonsIo}"
|
||||
implementation "com.jakewharton.timber:timber:${versions.timber}"
|
||||
|
||||
testImplementation project(":mail:testing")
|
||||
testImplementation "org.robolectric:robolectric:${versions.robolectric}"
|
||||
|
|
|
@ -6,10 +6,10 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.K9MailLib;
|
||||
import com.fsck.k9.mail.filter.FixedLengthInputStream;
|
||||
import com.fsck.k9.mail.filter.PeekableInputStream;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.mail.K9MailLib.DEBUG_PROTOCOL_IMAP;
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.Flag;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.regex.Pattern;
|
|||
import java.util.zip.Inflater;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.Authentication;
|
||||
import com.fsck.k9.mail.AuthenticationFailedException;
|
||||
import com.fsck.k9.mail.CertificateValidationException;
|
||||
|
@ -45,7 +46,6 @@ import javax.net.ssl.SSLException;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.mail.ConnectionSecurity.STARTTLS_REQUIRED;
|
||||
import static com.fsck.k9.mail.K9MailLib.DEBUG_PROTOCOL_IMAP;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.fsck.k9.mail.store.imap
|
||||
|
||||
import com.fsck.k9.logging.Timber
|
||||
import com.fsck.k9.mail.Body
|
||||
import com.fsck.k9.mail.BodyFactory
|
||||
import com.fsck.k9.mail.FetchProfile
|
||||
|
@ -24,7 +25,6 @@ import java.util.LinkedHashSet
|
|||
import java.util.Locale
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import timber.log.Timber
|
||||
|
||||
internal class RealImapFolder(
|
||||
private val internalImapStore: InternalImapStore,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.fsck.k9.mail.store.imap
|
||||
|
||||
import com.fsck.k9.logging.Timber
|
||||
import com.fsck.k9.mail.MessagingException
|
||||
import com.fsck.k9.mail.power.WakeLock
|
||||
import java.io.IOException
|
||||
import timber.log.Timber
|
||||
|
||||
private const val SOCKET_EXTRA_TIMEOUT_MS = 2 * 60 * 1000L
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.AuthType;
|
||||
import com.fsck.k9.mail.ConnectionSecurity;
|
||||
import com.fsck.k9.mail.Flag;
|
||||
|
@ -23,7 +24,6 @@ import com.fsck.k9.mail.oauth.OAuth2TokenProvider;
|
|||
import com.fsck.k9.mail.ssl.TrustedSocketFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,8 +7,6 @@ if (rootProject.testCoverage) {
|
|||
dependencies {
|
||||
api project(":mail:common")
|
||||
|
||||
implementation "com.jakewharton.timber:timber:${versions.timber}"
|
||||
|
||||
testImplementation project(":mail:testing")
|
||||
testImplementation "org.robolectric:robolectric:${versions.robolectric}"
|
||||
testImplementation "junit:junit:${versions.junit}"
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.AuthType;
|
||||
import com.fsck.k9.mail.Authentication;
|
||||
import com.fsck.k9.mail.AuthenticationFailedException;
|
||||
|
@ -28,7 +29,6 @@ import com.fsck.k9.mail.filter.Base64;
|
|||
import com.fsck.k9.mail.filter.Hex;
|
||||
import com.fsck.k9.mail.ssl.TrustedSocketFactory;
|
||||
import javax.net.ssl.SSLException;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.mail.CertificateValidationException.Reason.MissingCapability;
|
||||
import static com.fsck.k9.mail.K9MailLib.DEBUG_PROTOCOL_POP3;
|
||||
|
|
|
@ -10,12 +10,12 @@ import java.util.Locale;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.FetchProfile;
|
||||
import com.fsck.k9.mail.Flag;
|
||||
import com.fsck.k9.mail.K9MailLib;
|
||||
import com.fsck.k9.mail.MessageRetrievalListener;
|
||||
import com.fsck.k9.mail.MessagingException;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.mail.K9MailLib.DEBUG_PROTOCOL_POP3;
|
||||
import static com.fsck.k9.mail.store.pop3.Pop3Commands.*;
|
||||
|
|
|
@ -10,7 +10,6 @@ dependencies {
|
|||
|
||||
implementation "commons-io:commons-io:${versions.commonsIo}"
|
||||
implementation "com.squareup.okio:okio:${versions.okio}"
|
||||
implementation "com.jakewharton.timber:timber:${versions.timber}"
|
||||
|
||||
testImplementation project(":mail:testing")
|
||||
testImplementation "org.robolectric:robolectric:${versions.robolectric}"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.fsck.k9.mail.transport.smtp
|
||||
|
||||
import com.fsck.k9.logging.Timber
|
||||
import com.fsck.k9.mail.Address
|
||||
import com.fsck.k9.mail.AuthType
|
||||
import com.fsck.k9.mail.Authentication
|
||||
|
@ -36,7 +37,6 @@ import java.security.GeneralSecurityException
|
|||
import java.util.Locale
|
||||
import javax.net.ssl.SSLException
|
||||
import org.apache.commons.io.IOUtils
|
||||
import timber.log.Timber
|
||||
|
||||
private const val SMTP_CONTINUE_REQUEST = 334
|
||||
private const val SMTP_AUTHENTICATION_FAILURE_ERROR_CODE = 535
|
||||
|
|
|
@ -8,7 +8,6 @@ dependencies {
|
|||
api project(":mail:common")
|
||||
|
||||
implementation "commons-io:commons-io:${versions.commonsIo}"
|
||||
implementation "com.jakewharton.timber:timber:${versions.timber}"
|
||||
|
||||
testImplementation project(":mail:testing")
|
||||
testImplementation "org.robolectric:robolectric:${versions.robolectric}"
|
||||
|
|
|
@ -10,7 +10,8 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import timber.log.Timber;
|
||||
import com.fsck.k9.logging.Timber;
|
||||
|
||||
|
||||
/**
|
||||
* Maintains WebDAV data
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.fsck.k9.mail.store.webdav;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.K9MailLib;
|
||||
|
||||
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
|
||||
import timber.log.Timber;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
|
@ -80,4 +80,4 @@ public class HttpGeneric extends HttpEntityEnclosingRequestBase {
|
|||
METHOD_NAME = method;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.fsck.k9.mail.store.webdav;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.FetchProfile;
|
||||
import com.fsck.k9.mail.Flag;
|
||||
import com.fsck.k9.mail.FolderType;
|
||||
|
@ -14,7 +15,6 @@ import org.apache.http.HttpEntity;
|
|||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import timber.log.Timber;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.fsck.k9.mail.store.webdav;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpRequest;
|
||||
|
@ -7,7 +8,6 @@ import org.apache.http.HttpResponse;
|
|||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
import timber.log.Timber;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package com.fsck.k9.mail.store.webdav;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.MessagingException;
|
||||
import com.fsck.k9.mail.internet.MimeMessage;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.mail.helper.UrlEncodingHelper.decodeUtf8;
|
||||
import static com.fsck.k9.mail.helper.UrlEncodingHelper.encodeUtf8;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.CertificateValidationException;
|
||||
import com.fsck.k9.mail.ConnectionSecurity;
|
||||
import com.fsck.k9.mail.FolderType;
|
||||
|
@ -46,7 +47,6 @@ import org.apache.http.protocol.HttpContext;
|
|||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.fsck.k9.mail.K9MailLib.DEBUG_PROTOCOL_WEBDAV;
|
||||
import static com.fsck.k9.mail.helper.UrlEncodingHelper.decodeUtf8;
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.fsck.k9.mail.transport;
|
|||
|
||||
import java.util.Collections;
|
||||
|
||||
import com.fsck.k9.logging.Timber;
|
||||
import com.fsck.k9.mail.K9MailLib;
|
||||
import com.fsck.k9.mail.Message;
|
||||
import com.fsck.k9.mail.MessagingException;
|
||||
|
@ -12,7 +13,6 @@ import com.fsck.k9.mail.ssl.TrustManagerFactory;
|
|||
import com.fsck.k9.mail.store.webdav.DraftsFolderProvider;
|
||||
import com.fsck.k9.mail.store.webdav.SniHostSetter;
|
||||
import com.fsck.k9.mail.store.webdav.WebDavStore;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class WebDavTransport extends Transport {
|
||||
private WebDavStore store;
|
||||
|
|
Loading…
Reference in a new issue