diff --git a/app/src/main/java/com/keepassdroid/settings/LongEditTextPreference.java b/app/src/main/java/com/keepassdroid/settings/LongEditTextPreference.java
deleted file mode 100644
index c35020a85..000000000
--- a/app/src/main/java/com/keepassdroid/settings/LongEditTextPreference.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2017 Brian Pellin.
- *
- * This file is part of KeePassDroid.
- *
- * KeePassDroid 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 2 of the License, or
- * (at your option) any later version.
- *
- * KeePassDroid 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 KeePassDroid. If not, see .
- *
- */
-package com.keepassdroid.settings;
-
-
-import android.content.Context;
-import android.support.v7.preference.EditTextPreference;
-import android.util.AttributeSet;
-import android.widget.Toast;
-
-import com.kunzisoft.keepass.R;
-
-public class LongEditTextPreference extends EditTextPreference {
-
- public LongEditTextPreference(Context context) {
- super(context);
- }
-
- public LongEditTextPreference(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public LongEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- @Override
- protected String getPersistedString(String defaultReturnValue) {
- return String.valueOf(getPersistedLong(-1));
- }
-
- @Override
- protected boolean persistString(String value) {
- try {
- return persistLong(Long.valueOf(value));
- } catch (NumberFormatException e) {
- Toast.makeText(getContext(), R.string.error_rounds_not_number, Toast.LENGTH_LONG).show();
- }
-
- return false;
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/keepassdroid/settings/MainPreferenceFragment.java b/app/src/main/java/com/keepassdroid/settings/MainPreferenceFragment.java
index f60f3ca4d..d62037d09 100644
--- a/app/src/main/java/com/keepassdroid/settings/MainPreferenceFragment.java
+++ b/app/src/main/java/com/keepassdroid/settings/MainPreferenceFragment.java
@@ -2,12 +2,14 @@ package com.keepassdroid.settings;
import android.content.Context;
import android.os.Bundle;
+import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
+import android.widget.Toast;
-import com.kunzisoft.keepass.R;
import com.keepassdroid.Database;
import com.keepassdroid.app.App;
+import com.kunzisoft.keepass.R;
public class MainPreferenceFragment extends PreferenceFragmentCompat implements Preference.OnPreferenceClickListener {
@@ -40,6 +42,21 @@ public class MainPreferenceFragment extends PreferenceFragmentCompat implements
} else {
preference.setOnPreferenceClickListener(this);
}
+
+ EditTextPreference fixDatabaseRoundPref = (EditTextPreference)
+ getPreferenceScreen().findPreference(getString(R.string.roundsFix_key));
+ fixDatabaseRoundPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ try {
+ Long.valueOf(newValue.toString());
+ return true;
+ } catch (NumberFormatException e) {
+ Toast.makeText(getContext(), R.string.error_rounds_not_number, Toast.LENGTH_LONG).show();
+ }
+ return false;
+ }
+ });
}
@Override
diff --git a/app/src/main/res/drawable/ic_filter_tilt_shift_pref_24dp.xml b/app/src/main/res/drawable/ic_filter_tilt_shift_pref_24dp.xml
new file mode 100644
index 000000000..7910fb778
--- /dev/null
+++ b/app/src/main/res/drawable/ic_filter_tilt_shift_pref_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index aeadbeb9d..940d826cf 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -171,6 +171,7 @@
Root
Encryption Rounds
Higher encryption rounds provide additional protection against brute force attacks, but can really slow down loading and saving.
+ Fix of database encryption rounds
Key encryption rounds before corruption
If your database was corrupted by KeePassDroid version 2.2.0.0 to 2.2.0.6, enter the number of rounds used previously and this will allow you to open your database.
rounds
diff --git a/app/src/main/res/xml/app_preferences.xml b/app/src/main/res/xml/app_preferences.xml
index d10314e14..e641a8e75 100644
--- a/app/src/main/res/xml/app_preferences.xml
+++ b/app/src/main/res/xml/app_preferences.xml
@@ -54,13 +54,6 @@
android:defaultValue="@bool/saf_default"
android:title="@string/use_saf_title"
android:key="@string/saf_key"/>
-
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index f842499be..721a4ae36 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -36,6 +36,16 @@
android:title="@string/menu_db_settings"
android:icon="@drawable/ic_data_usage_white_24dp"
android:persistent="false" />
+
+