diff --git a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java index 07c59c33..43706f74 100644 --- a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java +++ b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/EmergencyActivity.java @@ -272,7 +272,7 @@ public class EmergencyActivity extends Activity { try { return MasterKey.create( version, fullName, masterPassword ); } - catch (RuntimeException e) { + catch (Exception e) { sitePasswordField.setText( "" ); progressView.setVisibility( View.INVISIBLE ); logger.err( e, "While generating master key." ); diff --git a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/Preferences.java b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/Preferences.java index 10c31dea..cd6e18a6 100644 --- a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/Preferences.java +++ b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/masterpassword/Preferences.java @@ -21,6 +21,7 @@ public class Preferences { private static final String PREF_MASK_PASSWORD = "maskPassword"; private static final String PREF_FULL_NAME = "fullName"; private static final String PREF_SITE_TYPE = "siteType"; + private static final String PREF_ALGORITHM_VERSION = "algorithmVersion"; private static Preferences instance; private Context context; @@ -136,12 +137,12 @@ public class Preferences { if (getDefaultVersion().equals( value )) return false; - prefs().edit().putInt( PREF_SITE_TYPE, value.ordinal() ).apply(); + prefs().edit().putInt( PREF_ALGORITHM_VERSION, value.ordinal() ).apply(); return true; } @Nonnull public MasterKey.Version getDefaultVersion() { - return MasterKey.Version.values()[prefs().getInt( PREF_SITE_TYPE, MasterKey.Version.CURRENT.ordinal() )]; + return MasterKey.Version.values()[prefs().getInt( PREF_ALGORITHM_VERSION, MasterKey.Version.CURRENT.ordinal() )]; } }