From 5aebd115d4a7a8ba7d538621bbf9e88ef941f48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 15 Sep 2013 16:42:08 +0200 Subject: Put PgpMain methods in separate opbject classes, handle passphrase dialog in EditKey not in SecretKeyList --- .../keychain/ui/EncryptActivity.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 3e4b2bcfb..b9a58a210 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -31,8 +31,8 @@ import org.sufficientlysecure.keychain.compatibility.ClipboardReflection; import org.sufficientlysecure.keychain.helper.ActionBarHelper; import org.sufficientlysecure.keychain.helper.FileHelper; import org.sufficientlysecure.keychain.helper.Preferences; -import org.sufficientlysecure.keychain.pgp.PgpHelper; -import org.sufficientlysecure.keychain.pgp.PgpMain; +import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; +import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; @@ -302,9 +302,9 @@ public class EncryptActivity extends SherlockFragmentActivity { preselectedSignatureKeyId); PGPSecretKey masterKey = null; if (keyRing != null) { - masterKey = PgpHelper.getMasterKey(keyRing); + masterKey = PgpKeyHelper.getMasterKey(keyRing); if (masterKey != null) { - Vector signKeys = PgpHelper.getUsableSigningKeys(keyRing); + Vector signKeys = PgpKeyHelper.getUsableSigningKeys(keyRing); if (signKeys.size() > 0) { mSecretKeyId = masterKey.getKeyID(); } @@ -321,11 +321,11 @@ public class EncryptActivity extends SherlockFragmentActivity { if (keyRing == null) { continue; } - masterKey = PgpHelper.getMasterKey(keyRing); + masterKey = PgpKeyHelper.getMasterKey(keyRing); if (masterKey == null) { continue; } - Vector encryptKeys = PgpHelper.getUsableEncryptKeys(keyRing); + Vector encryptKeys = PgpKeyHelper.getUsableEncryptKeys(keyRing); if (encryptKeys.size() == 0) { continue; } @@ -570,7 +570,7 @@ public class EncryptActivity extends SherlockFragmentActivity { EncryptActivity.this, messenger, mSecretKeyId); passphraseDialog.show(getSupportFragmentManager(), "passphraseDialog"); - } catch (PgpMain.PgpGeneralException e) { + } catch (PgpGeneralException e) { Log.d(Constants.TAG, "No passphrase for this secret key, encrypt directly!"); // send message to handler to start encryption directly returnHandler.sendEmptyMessage(PassphraseDialogFragment.MESSAGE_OKAY); @@ -914,9 +914,9 @@ public class EncryptActivity extends SherlockFragmentActivity { PGPSecretKeyRing keyRing = ProviderHelper.getPGPSecretKeyRingByMasterKeyId(this, mSecretKeyId); if (keyRing != null) { - PGPSecretKey key = PgpHelper.getMasterKey(keyRing); + PGPSecretKey key = PgpKeyHelper.getMasterKey(keyRing); if (key != null) { - String userId = PgpHelper.getMainUserIdSafe(this, key); + String userId = PgpKeyHelper.getMainUserIdSafe(this, key); String chunks[] = userId.split(" <", 2); uid = chunks[0]; if (chunks.length > 1) { -- cgit v1.2.3