Loading src/com/fsck/k9/Account.java +10 −7 Original line number Diff line number Diff line Loading @@ -1873,15 +1873,16 @@ public class Account implements BaseAccount { /** * Add a new certificate for the incoming or outgoing server to the local key store. */ public void addCertificate(CheckDirection direction, X509Certificate certificate) throws CertificateException { public void addCertificate(Context context, CheckDirection direction, X509Certificate certificate) throws CertificateException { Uri uri; if (direction.equals(CheckDirection.INCOMING)) { uri = Uri.parse(getStoreUri()); } else { uri = Uri.parse(getTransportUri()); } LocalKeyStore.getInstance().addCertificate(uri.getHost(), uri.getPort(), certificate); LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context); localKeyStore.addCertificate(uri.getHost(), uri.getPort(), certificate); } /** Loading @@ -1889,7 +1890,8 @@ public class Account implements BaseAccount { * new host/port, then try and delete any (possibly non-existent) certificate stored for the * old host/port. */ public void deleteCertificate(String newHost, int newPort, CheckDirection direction) { public void deleteCertificate(Context context, String newHost, int newPort, CheckDirection direction) { Uri uri; if (direction.equals(CheckDirection.INCOMING)) { uri = Uri.parse(getStoreUri()); Loading @@ -1899,7 +1901,8 @@ public class Account implements BaseAccount { String oldHost = uri.getHost(); int oldPort = uri.getPort(); if (!newHost.equals(oldHost) || newPort != oldPort) { LocalKeyStore.getInstance().deleteCertificate(oldHost, oldPort); LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context); localKeyStore.deleteCertificate(oldHost, oldPort); } } Loading @@ -1907,8 +1910,8 @@ public class Account implements BaseAccount { * Examine the settings for the account and attempt to delete (possibly non-existent) * certificates for the incoming and outgoing servers. */ public void deleteCertificates() { LocalKeyStore localKeyStore = LocalKeyStore.getInstance(); public void deleteCertificates(Context context) { LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context); Uri uri = Uri.parse(getStoreUri()); localKeyStore.deleteCertificate(uri.getHost(), uri.getPort()); Loading src/com/fsck/k9/Preferences.java +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ public class Preferences { Store.removeAccount(account); account.deleteCertificates(); account.deleteCertificates(mContext); account.delete(this); if (newAccount == account) { Loading src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -363,7 +363,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { try { mAccount.addCertificate(mDirection, chain[0]); mAccount.addCertificate(getApplicationContext(), mDirection, chain[0]); } catch (CertificateException e) { showErrorDialog( R.string.account_setup_failed_dlg_certificate_message_fmt, Loading src/com/fsck/k9/activity/setup/AccountSetupIncoming.java +1 −1 Original line number Diff line number Diff line Loading @@ -428,7 +428,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener mWebdavMailboxPathView.getText().toString()); } mAccount.deleteCertificate(host, port, CheckDirection.INCOMING); mAccount.deleteCertificate(this, host, port, CheckDirection.INCOMING); ServerSettings settings = new ServerSettings(mStoreType, host, port, connectionSecurity, authType, username, password, extra); Loading src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, String newHost = mServerView.getText().toString(); int newPort = Integer.parseInt(mPortView.getText().toString()); uri = new URI(smtpSchemes[securityType], userInfo, newHost, newPort, null, null, null); mAccount.deleteCertificate(newHost, newPort, CheckDirection.OUTGOING); mAccount.deleteCertificate(this, newHost, newPort, CheckDirection.OUTGOING); mAccount.setTransportUri(uri.toString()); AccountSetupCheckSettings.actionCheckSettings(this, mAccount, CheckDirection.OUTGOING); } catch (UnsupportedEncodingException enc) { Loading Loading
src/com/fsck/k9/Account.java +10 −7 Original line number Diff line number Diff line Loading @@ -1873,15 +1873,16 @@ public class Account implements BaseAccount { /** * Add a new certificate for the incoming or outgoing server to the local key store. */ public void addCertificate(CheckDirection direction, X509Certificate certificate) throws CertificateException { public void addCertificate(Context context, CheckDirection direction, X509Certificate certificate) throws CertificateException { Uri uri; if (direction.equals(CheckDirection.INCOMING)) { uri = Uri.parse(getStoreUri()); } else { uri = Uri.parse(getTransportUri()); } LocalKeyStore.getInstance().addCertificate(uri.getHost(), uri.getPort(), certificate); LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context); localKeyStore.addCertificate(uri.getHost(), uri.getPort(), certificate); } /** Loading @@ -1889,7 +1890,8 @@ public class Account implements BaseAccount { * new host/port, then try and delete any (possibly non-existent) certificate stored for the * old host/port. */ public void deleteCertificate(String newHost, int newPort, CheckDirection direction) { public void deleteCertificate(Context context, String newHost, int newPort, CheckDirection direction) { Uri uri; if (direction.equals(CheckDirection.INCOMING)) { uri = Uri.parse(getStoreUri()); Loading @@ -1899,7 +1901,8 @@ public class Account implements BaseAccount { String oldHost = uri.getHost(); int oldPort = uri.getPort(); if (!newHost.equals(oldHost) || newPort != oldPort) { LocalKeyStore.getInstance().deleteCertificate(oldHost, oldPort); LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context); localKeyStore.deleteCertificate(oldHost, oldPort); } } Loading @@ -1907,8 +1910,8 @@ public class Account implements BaseAccount { * Examine the settings for the account and attempt to delete (possibly non-existent) * certificates for the incoming and outgoing servers. */ public void deleteCertificates() { LocalKeyStore localKeyStore = LocalKeyStore.getInstance(); public void deleteCertificates(Context context) { LocalKeyStore localKeyStore = LocalKeyStore.getInstance(context); Uri uri = Uri.parse(getStoreUri()); localKeyStore.deleteCertificate(uri.getHost(), uri.getPort()); Loading
src/com/fsck/k9/Preferences.java +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ public class Preferences { Store.removeAccount(account); account.deleteCertificates(); account.deleteCertificates(mContext); account.delete(this); if (newAccount == account) { Loading
src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -363,7 +363,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { try { mAccount.addCertificate(mDirection, chain[0]); mAccount.addCertificate(getApplicationContext(), mDirection, chain[0]); } catch (CertificateException e) { showErrorDialog( R.string.account_setup_failed_dlg_certificate_message_fmt, Loading
src/com/fsck/k9/activity/setup/AccountSetupIncoming.java +1 −1 Original line number Diff line number Diff line Loading @@ -428,7 +428,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener mWebdavMailboxPathView.getText().toString()); } mAccount.deleteCertificate(host, port, CheckDirection.INCOMING); mAccount.deleteCertificate(this, host, port, CheckDirection.INCOMING); ServerSettings settings = new ServerSettings(mStoreType, host, port, connectionSecurity, authType, username, password, extra); Loading
src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, String newHost = mServerView.getText().toString(); int newPort = Integer.parseInt(mPortView.getText().toString()); uri = new URI(smtpSchemes[securityType], userInfo, newHost, newPort, null, null, null); mAccount.deleteCertificate(newHost, newPort, CheckDirection.OUTGOING); mAccount.deleteCertificate(this, newHost, newPort, CheckDirection.OUTGOING); mAccount.setTransportUri(uri.toString()); AccountSetupCheckSettings.actionCheckSettings(this, mAccount, CheckDirection.OUTGOING); } catch (UnsupportedEncodingException enc) { Loading