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

Commit db9f4b55 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Revert "Merge branch '5445-Enable_openPGP_support_by_default' into 'main'"

This reverts commit 1a4af6f6, reversing
changes made to f51ce9ea.
parent 5d008d5a
Loading
Loading
Loading
Loading
+11 −27
Original line number Diff line number Diff line
/*
 * Copyright ECORP SAS 2022
 *
 * this program is free software: you can redistribute it and/or modify
 * it under the terms of the gnu general public license as published by
 * the free software foundation, either version 3 of the license, or
 * (at your option) any later version.
 *
 * this program is distributed in the hope that it will be useful,
 * but without any warranty; without even the implied warranty of
 * merchantability or fitness for a particular purpose.  see the
 * gnu general public license for more details.
 *
 * you should have received a copy of the gnu general public license
 * along with this program.  if not, see <https://www.gnu.org/licenses/>.
 */

package com.fsck.k9.activity;


@@ -42,6 +25,9 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBar;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.TypedValue;
@@ -60,9 +46,6 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBar;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.fsck.k9.Account;
@@ -132,6 +115,7 @@ import com.fsck.k9.ui.messagelist.DefaultFolderProvider;
import com.fsck.k9.ui.permissions.K9PermissionUiHelper;
import com.fsck.k9.ui.permissions.Permission;
import com.fsck.k9.ui.permissions.PermissionUiHelper;

import org.jetbrains.annotations.NotNull;
import org.openintents.openpgp.OpenPgpApiManager;
import org.openintents.openpgp.util.OpenPgpApi;
@@ -718,7 +702,11 @@ public class MessageCompose extends K9Activity implements OnClickListener,
        boolean shouldUsePgpMessageBuilder = cryptoStatus.isOpenPgpConfigured();
        if (shouldUsePgpMessageBuilder) {
            SendErrorState maybeSendErrorState = cryptoStatus.getSendErrorStateOrNull();
            if (maybeSendErrorState == null) {
            if (maybeSendErrorState != null) {
                recipientPresenter.showPgpSendError(maybeSendErrorState);
                return null;
            }

            PgpMessageBuilder pgpBuilder = PgpMessageBuilder.newInstance();
            recipientPresenter.builderSetProperties(pgpBuilder, cryptoStatus);
            builder = pgpBuilder;
@@ -726,10 +714,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
            builder = SimpleMessageBuilder.newInstance();
            recipientPresenter.builderSetProperties(builder);
        }
        } else {
            builder = SimpleMessageBuilder.newInstance();
            recipientPresenter.builderSetProperties(builder);
        }

        builder.setSubject(Utility.stripNewLines(subjectView.getText().toString()))
                .setSentDate(new Date())
+2 −7
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

import androidx.annotation.Nullable;
import androidx.lifecycle.LifecycleOwner;
import com.fsck.k9.Account;
import com.fsck.k9.Core;
import com.fsck.k9.DI;
@@ -56,7 +58,6 @@ import com.fsck.k9.view.ClientCertificateSpinner.OnClientCertificateChangedListe
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import com.lamonjush.fullscreenloadingdialog.FullScreenLoadingDialog;
import org.openintents.openpgp.util.OpenPgpProviderUtil;
import timber.log.Timber;

/**
@@ -266,7 +267,6 @@ public class AccountSetupBasics extends K9Activity
        if (mAccount == null) {
            mAccount = Preferences.getPreferences(this).newAccount();
            mAccount.setChipColor(accountCreator.pickColor());
            setOpenPgpProvider();
        }

        mAccount.setSenderName(getOwnerName());
@@ -405,7 +405,6 @@ public class AccountSetupBasics extends K9Activity
        if (mAccount == null) {
            mAccount = Preferences.getPreferences(this).newAccount();
            mAccount.setChipColor(accountCreator.pickColor());
            setOpenPgpProvider();
        }
        mAccount.setSenderName(getOwnerName());
        mAccount.setEmail(email);
@@ -416,10 +415,6 @@ public class AccountSetupBasics extends K9Activity
        AccountSetupAccountType.actionSelectAccountType(this, mAccount, false, initialAccountSettings);
    }

    private void setOpenPgpProvider() {
        mAccount.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(getApplicationContext()));
    }

    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.next) {
+9 −12
Original line number Diff line number Diff line
/*
 * Copyright ECORP SAS 2022
 *
 * this program is free software: you can redistribute it and/or modify
 * it under the terms of the gnu general public license as published by
 * the free software foundation, either version 3 of the license, or
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * this program is distributed in the hope that it will be useful,
 * but without any warranty; without even the implied warranty of
 * merchantability or fitness for a particular purpose.  see the
 * gnu general public license for more details.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * you should have received a copy of the gnu general public license
 * along with this program.  if not, see <https://www.gnu.org/licenses/>.
 * You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package com.fsck.k9.activity.setup.accountmanager;
@@ -35,7 +34,6 @@ import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mailstore.SpecialLocalFoldersCreator;
import com.fsck.k9.preferences.Protocols;
import com.fsck.k9.ui.ConnectionSettings;
import org.openintents.openpgp.util.OpenPgpProviderUtil;
import timber.log.Timber;


@@ -51,7 +49,6 @@ public class EeloAccountCreator {
        account.setChipColor(accountCreator.pickColor());
        account.setEmail(emailId);
        account.setName(emailId);
        account.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(context.getApplicationContext()));

        ConnectionSettings connectionSettings = providersXmlDiscoveryDiscover(emailId);
        if (connectionSettings == null) {
+0 −28
Original line number Diff line number Diff line
/*
 * Copyright ECORP SAS 2022
 *
 * this program is free software: you can redistribute it and/or modify
 * it under the terms of the gnu general public license as published by
 * the free software foundation, either version 3 of the license, or
 * (at your option) any later version.
 *
 * this program is distributed in the hope that it will be useful,
 * but without any warranty; without even the implied warranty of
 * merchantability or fitness for a particular purpose.  see the
 * gnu general public license for more details.
 *
 * you should have received a copy of the gnu general public license
 * along with this program.  if not, see <https://www.gnu.org/licenses/>.
 */

package org.openintents.openpgp.util;


@@ -26,8 +9,6 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;

import androidx.annotation.Nullable;


public class OpenPgpProviderUtil {
    private static final String PACKAGE_NAME_APG = "org.thialfihar.android.apg";
@@ -36,15 +17,6 @@ public class OpenPgpProviderUtil {
        DISALLOWED_PROVIDERS.add(PACKAGE_NAME_APG);
    }

    @Nullable
    public static String getOpenPgpProviderPackage(Context context) {
        List<String> openPgpProviderPackages = getOpenPgpProviderPackages(context);
        if (openPgpProviderPackages.size() > 0) {
            return openPgpProviderPackages.get(0);
        }
        return null;
    }

    public static List<String> getOpenPgpProviderPackages(Context context) {
        ArrayList<String> result = new ArrayList<>();