diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/dialog/ApgDeprecationWarningDialog.java b/app/ui/legacy/src/main/java/com/fsck/k9/ui/dialog/ApgDeprecationWarningDialog.java deleted file mode 100644 index 093cff920..000000000 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/dialog/ApgDeprecationWarningDialog.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.fsck.k9.ui.dialog; - - -import android.annotation.SuppressLint; -import android.app.AlertDialog; -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.text.method.LinkMovementMethod; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.TextView; - -import com.fsck.k9.ui.R; - - -public class ApgDeprecationWarningDialog extends AlertDialog { - public ApgDeprecationWarningDialog(Context context) { - super(context); - - LayoutInflater inflater = LayoutInflater.from(context); - - @SuppressLint("InflateParams") - View contentView = inflater.inflate(R.layout.dialog_apg_deprecated, null); - - TextView textViewLearnMore = contentView.findViewById(R.id.apg_learn_more); - makeTextViewLinksClickable(textViewLearnMore); - - setIcon(R.drawable.ic_apg_small); - setTitle(R.string.apg_deprecated_title); - setView(contentView); - setButton(Dialog.BUTTON_POSITIVE, context.getString(R.string.apg_deprecated_ok), new OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - cancel(); - } - }); - } - - private void makeTextViewLinksClickable(TextView textView) { - textView.setMovementMethod(LinkMovementMethod.getInstance()); - } -} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java index ec01b6ece..d9045bc4f 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/OpenPgpAppSelectDialog.java @@ -30,7 +30,6 @@ import com.fsck.k9.Preferences; import com.fsck.k9.ui.R; import com.fsck.k9.ui.base.K9Activity; import com.fsck.k9.ui.base.ThemeType; -import com.fsck.k9.ui.dialog.ApgDeprecationWarningDialog; import org.openintents.openpgp.util.OpenPgpApi; import org.openintents.openpgp.util.OpenPgpProviderUtil; import timber.log.Timber; @@ -40,11 +39,8 @@ public class OpenPgpAppSelectDialog extends K9Activity { private static final String EXTRA_ACCOUNT = "account"; private static final String OPENKEYCHAIN_PACKAGE = "org.sufficientlysecure.keychain"; - private static final String PACKAGE_NAME_APG = "org.thialfihar.android.apg"; - private static final String APG_PROVIDER_PLACEHOLDER = "apg-placeholder"; public static final String FRAG_OPENPGP_SELECT = "openpgp_select"; - public static final String FRAG_APG_DEPRECATE = "apg_deprecate"; public static final String FRAG_OPENKEYCHAIN_INFO = "openkeychain_info"; private static final Intent MARKET_INTENT = new Intent(Intent.ACTION_VIEW, Uri.parse( @@ -53,7 +49,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { String.format("https://play.google.com/store/apps/details?id=%s", OPENKEYCHAIN_PACKAGE))); - private boolean isStopped; private Account account; public static void startOpenPgpChooserActivity(Context context, Account account) { @@ -76,7 +71,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { @Override protected void onStart() { - isStopped = false; super.onStart(); List openPgpProviderPackages = OpenPgpProviderUtil.getOpenPgpProviderPackages(this); @@ -93,7 +87,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { @Override protected void onStop() { - isStopped = true; super.onStop(); } @@ -102,11 +95,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { fragment.show(getSupportFragmentManager(), FRAG_OPENPGP_SELECT); } - private void showApgDeprecationDialogFragment() { - ApgDeprecationDialogFragment fragment = new ApgDeprecationDialogFragment(); - fragment.show(getSupportFragmentManager(), FRAG_APG_DEPRECATE); - } - private void showOpenKeychainInfoFragment() { OpenKeychainInfoFragment fragment = new OpenKeychainInfoFragment(); fragment.show(getSupportFragmentManager(), FRAG_OPENKEYCHAIN_INFO); @@ -126,12 +114,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { getResources().getDrawable(R.drawable.ic_action_cancel_launchersize_light)); openPgpProviderList.add(noneEntry); - if (isApgInstalled(getActivity())) { - Drawable icon = getResources().getDrawable(R.drawable.ic_apg_small); - openPgpProviderList.add(new OpenPgpProviderEntry( - APG_PROVIDER_PLACEHOLDER, getString(R.string.apg), icon)); - } - // search for OpenPGP providers... Intent intent = new Intent(OpenPgpApi.SERVICE_INTENT_2); List resInfo = getActivity().getPackageManager().queryIntentServices(intent, 0); @@ -170,13 +152,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { } } - private boolean isApgInstalled(Context context) { - Intent intent = new Intent("org.openintents.openpgp.IOpenPgpService"); - intent.setPackage(PACKAGE_NAME_APG); - List resInfo = context.getPackageManager().queryIntentServices(intent, 0); - return resInfo != null && !resInfo.isEmpty(); - } - @Override public void onStop() { super.onStop(); @@ -251,27 +226,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { } } - public static class ApgDeprecationDialogFragment extends DialogFragment { - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - return new ApgDeprecationWarningDialog(getActivity()); - } - - @Override - public void onStop() { - super.onStop(); - - dismiss(); - } - - @Override - public void onDismiss(DialogInterface dialog) { - super.onDismiss(dialog); - - ((OpenPgpAppSelectDialog) getActivity()).onDismissApgDialog(); - } - } - public static class OpenKeychainInfoFragment extends DialogFragment { @NonNull @Override @@ -323,11 +277,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { } public void onSelectProvider(String selectedPackage) { - if (APG_PROVIDER_PLACEHOLDER.equals(selectedPackage)) { - showApgDeprecationDialogFragment(); - return; - } - persistOpenPgpProviderSetting(selectedPackage); finish(); } @@ -337,12 +286,6 @@ public class OpenPgpAppSelectDialog extends K9Activity { Preferences.getPreferences(getApplicationContext()).saveAccount(account); } - public void onDismissApgDialog() { - if (!isStopped) { - showOpenPgpSelectDialogFragment(); - } - } - private static class OpenPgpProviderEntry { private String packageName; private String simpleName; diff --git a/app/ui/legacy/src/main/res/drawable-hdpi/ic_apg_small.png b/app/ui/legacy/src/main/res/drawable-hdpi/ic_apg_small.png deleted file mode 100644 index 29b41d89d..000000000 Binary files a/app/ui/legacy/src/main/res/drawable-hdpi/ic_apg_small.png and /dev/null differ diff --git a/app/ui/legacy/src/main/res/drawable-mdpi/ic_apg_small.png b/app/ui/legacy/src/main/res/drawable-mdpi/ic_apg_small.png deleted file mode 100644 index eec5d0ae1..000000000 Binary files a/app/ui/legacy/src/main/res/drawable-mdpi/ic_apg_small.png and /dev/null differ diff --git a/app/ui/legacy/src/main/res/drawable-xhdpi/ic_apg_small.png b/app/ui/legacy/src/main/res/drawable-xhdpi/ic_apg_small.png deleted file mode 100644 index 7ca53f0ec..000000000 Binary files a/app/ui/legacy/src/main/res/drawable-xhdpi/ic_apg_small.png and /dev/null differ diff --git a/app/ui/legacy/src/main/res/drawable-xxhdpi/ic_apg_small.png b/app/ui/legacy/src/main/res/drawable-xxhdpi/ic_apg_small.png deleted file mode 100644 index 68df5fb58..000000000 Binary files a/app/ui/legacy/src/main/res/drawable-xxhdpi/ic_apg_small.png and /dev/null differ diff --git a/app/ui/legacy/src/main/res/drawable-xxxhdpi/ic_apg_small.png b/app/ui/legacy/src/main/res/drawable-xxxhdpi/ic_apg_small.png deleted file mode 100644 index de98c497b..000000000 Binary files a/app/ui/legacy/src/main/res/drawable-xxxhdpi/ic_apg_small.png and /dev/null differ diff --git a/app/ui/legacy/src/main/res/layout/dialog_apg_deprecated.xml b/app/ui/legacy/src/main/res/layout/dialog_apg_deprecated.xml deleted file mode 100644 index 4a3769372..000000000 --- a/app/ui/legacy/src/main/res/layout/dialog_apg_deprecated.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/ui/legacy/src/main/res/values/strings.xml b/app/ui/legacy/src/main/res/values/strings.xml index bdef9991f..54d46ca26 100644 --- a/app/ui/legacy/src/main/res/values/strings.xml +++ b/app/ui/legacy/src/main/res/values/strings.xml @@ -1148,14 +1148,6 @@ Please submit bug reports, contribute new features and ask questions at All signatures will be displayed Encryption unavailable in sign-only mode! Unsigned Text - APG Deprecation Warning - APG is no longer maintained! - Because of this, support for APG has been removed from K-9 Mail. - Development stopped in early 2014 - Contains unfixed security issues - You can click here to learn more. - Got it! - APG This email is encrypted This email has been encrypted with OpenPGP.\nTo read it, you need to install and configure a compatible OpenPGP App. Go to Settings