Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1400a42 authored by cketti's avatar cketti
Browse files

Merge branch 'main' into message-view-redesign

parents 32f4b34e 243fbcfd
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -11,26 +11,23 @@ import java.util.List;

import android.content.Context;
import android.net.SSLCertificateSocketFactory;
import android.os.Build;
import android.text.TextUtils;

import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.ssl.TrustManagerFactory;
import com.fsck.k9.mail.ssl.TrustedSocketFactory;
import javax.net.ssl.KeyManager;
import javax.net.ssl.SNIHostName;
import javax.net.ssl.SNIServerName;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import timber.log.Timber;


/**
 * Prior to API 21 (and notably from API 10 - 2.3.4) Android weakened it's cipher list
 * by ordering them badly such that RC4-MD5 was preferred. To work around this we 
 * remove the insecure ciphers and reorder them so the latest more secure ciphers are at the top.
 *
 * On more modern versions of Android we keep the system configuration.
 */
public class DefaultTrustedSocketFactory implements TrustedSocketFactory {
    private static final String[] ENABLED_CIPHERS;
    private static final String[] ENABLED_PROTOCOLS;
@@ -150,6 +147,11 @@ public class DefaultTrustedSocketFactory implements TrustedSocketFactory {
        if (factory instanceof android.net.SSLCertificateSocketFactory) {
            SSLCertificateSocketFactory sslCertificateSocketFactory = (SSLCertificateSocketFactory) factory;
            sslCertificateSocketFactory.setHostname(socket, hostname);
        } else if (Build.VERSION.SDK_INT >= 24) {
            SSLParameters sslParameters = socket.getSSLParameters();
            List<SNIServerName> sniServerNames = Collections.singletonList(new SNIHostName(hostname));
            sslParameters.setServerNames(sniServerNames);
            socket.setSSLParameters(sslParameters);
        } else {
            setHostnameViaReflection(socket, hostname);
        }
+1 −2
Original line number Diff line number Diff line
@@ -188,8 +188,7 @@ class TextBodyBuilder {
    private String getSignatureHtml() {
        String signature = "";
        if (!isEmpty(mSignature)) {
            signature = "<div style='white-space: pre-wrap'>" +
                    HtmlConverter.textToHtmlFragmentWithOriginalWhitespace(mSignature) + "</div>";
            signature = HtmlConverter.textToHtmlFragment(mSignature);
        }
        return signature;
    }
+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ class TextBodyBuilderTest(val testData: TestData) {
        private const val QUOTED_HTML_TAGS_END = "</body>\n</html>"
        private const val QUOTED_HTML_TAGS_START = "<!DOCTYPE html><html><head></head><body>"
        private const val SIGNATURE_TEXT = "-- \r\n\r\nsignature\r\n  indented second line"
        private const val SIGNATURE_TEXT_HTML = "<div style='white-space: pre-wrap'>" +
            "<div class='k9mail-signature'>-- <br><br>signature<br>  indented second line</div></div>"
        private const val SIGNATURE_TEXT_HTML =
            "<div class='k9mail-signature'>-- <br><br>signature<br>\u00A0 indented second line</div>"

        @JvmStatic
        @Parameterized.Parameters(name = "{index}: {0}")
+2 −2
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@ android {
        applicationId "com.fsck.k9"
        testApplicationId "com.fsck.k9.tests"

        versionCode 33008
        versionName '6.309-SNAPSHOT'
        versionCode 33009
        versionName '6.310-SNAPSHOT'

        // Keep in sync with the resource string array 'supported_languages'
        resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl",
+1 −3
Original line number Diff line number Diff line
@@ -8,7 +8,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 com.fsck.k9.mail.transport.WebDavTransport
import com.fsck.k9.mailstore.FolderRepository
import com.fsck.k9.mailstore.K9BackendStorageFactory

@@ -24,8 +23,7 @@ class WebDavBackendFactory(
        val serverSettings = account.incomingServerSettings
        val draftsFolderProvider = createDraftsFolderProvider(account)
        val webDavStore = WebDavStore(trustManagerFactory, sniHostSetter, serverSettings, draftsFolderProvider)
        val webDavTransport = WebDavTransport(trustManagerFactory, sniHostSetter, serverSettings, draftsFolderProvider)
        return WebDavBackend(accountName, backendStorage, webDavStore, webDavTransport)
        return WebDavBackend(accountName, backendStorage, webDavStore)
    }

    private fun createDraftsFolderProvider(account: Account): DraftsFolderProvider {
Loading