mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Choose kdf and encapsulate code
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.crypto.keyDerivation;
|
||||
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
import com.kunzisoft.keepass.crypto.CryptoUtil;
|
||||
import com.kunzisoft.keepass.crypto.finalkey.FinalKey;
|
||||
import com.kunzisoft.keepass.crypto.finalkey.FinalKeyFactory;
|
||||
@@ -45,8 +48,11 @@ public class AesKdf extends KdfEngine {
|
||||
uuid = CIPHER_UUID;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@Override
|
||||
public String getName(Resources resources) {
|
||||
if (resources == null)
|
||||
return DEFAULT_NAME;
|
||||
return resources.getString(R.string.kdf_AES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,4 +99,9 @@ public class AesKdf extends KdfEngine {
|
||||
public void setKeyRounds(KdfParameters p, long keyRounds) {
|
||||
p.setUInt64(ParamRounds, keyRounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDefaultKeyRounds() {
|
||||
return DEFAULT_ROUNDS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.crypto.keyDerivation;
|
||||
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
import com.kunzisoft.keepass.utils.Types;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -26,6 +29,7 @@ import java.security.SecureRandom;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Argon2Kdf extends KdfEngine {
|
||||
|
||||
public static final UUID CIPHER_UUID = Types.bytestoUUID(
|
||||
new byte[]{(byte) 0xEF, (byte) 0x63, (byte) 0x6D, (byte) 0xDF, (byte) 0x8C, (byte) 0x29, (byte) 0x44, (byte) 0x4B,
|
||||
(byte) 0x91, (byte) 0xF7, (byte) 0xA9, (byte) 0xA4, (byte)0x03, (byte) 0xE3, (byte) 0x0A, (byte) 0x0C
|
||||
@@ -58,13 +62,17 @@ public class Argon2Kdf extends KdfEngine {
|
||||
private static final long DefaultMemory = 1024 * 1024;
|
||||
private static final long DefaultParallelism = 2;
|
||||
|
||||
private static final String DEFAULT_NAME = "Argon2";
|
||||
|
||||
public Argon2Kdf() {
|
||||
uuid = CIPHER_UUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Argon2";
|
||||
public String getName(Resources resources) {
|
||||
if (resources == null)
|
||||
return DEFAULT_NAME;
|
||||
return resources.getString(R.string.kdf_Argon2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,4 +121,9 @@ public class Argon2Kdf extends KdfEngine {
|
||||
p.setUInt64(ParamIterations, keyRounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDefaultKeyRounds() {
|
||||
return DefaultIterations;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.crypto.keyDerivation;
|
||||
|
||||
import com.kunzisoft.keepass.database.ObjectNameResource;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class KdfEngine {
|
||||
public abstract class KdfEngine implements ObjectNameResource{
|
||||
public UUID uuid;
|
||||
|
||||
public KdfParameters getDefaultParameters() {
|
||||
@@ -33,10 +35,10 @@ public abstract class KdfEngine {
|
||||
|
||||
public abstract void randomize(KdfParameters p);
|
||||
|
||||
public abstract String getName();
|
||||
|
||||
public abstract long getKeyRounds(KdfParameters p);
|
||||
|
||||
public abstract void setKeyRounds(KdfParameters p, long keyRounds);
|
||||
|
||||
public abstract long getDefaultKeyRounds();
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
import com.kunzisoft.keepass.crypto.keyDerivation.KdfEngine;
|
||||
import com.kunzisoft.keepass.database.exception.ContentFileNotFoundException;
|
||||
import com.kunzisoft.keepass.database.exception.InvalidDBException;
|
||||
import com.kunzisoft.keepass.database.exception.InvalidPasswordException;
|
||||
@@ -354,7 +355,7 @@ public class Database {
|
||||
return getPwDatabase().getEncryptionAlgorithm();
|
||||
}
|
||||
|
||||
public List<PwEncryptionAlgorithm> getAvailableEncryptionAlgorithm() {
|
||||
public List<PwEncryptionAlgorithm> getAvailableEncryptionAlgorithms() {
|
||||
switch (getPwDatabase().getVersion()) {
|
||||
case V4:
|
||||
return ((PwDatabaseV4) getPwDatabase()).getAvailableEncryptionAlgorithms();
|
||||
@@ -378,8 +379,31 @@ public class Database {
|
||||
return getPwDatabase().getEncryptionAlgorithm().getName(resources);
|
||||
}
|
||||
|
||||
public String getKeyDerivationName() {
|
||||
return getPwDatabase().getKeyDerivationName();
|
||||
public List<KdfEngine> getAvailableKdfEngines() {
|
||||
switch (getPwDatabase().getVersion()) {
|
||||
case V4:
|
||||
return ((PwDatabaseV4) getPwDatabase()).getAvailableKdfEngines();
|
||||
case V3:
|
||||
return ((PwDatabaseV3) getPwDatabase()).getAvailableKdfEngines();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public KdfEngine getKdfEngine() {
|
||||
return getPwDatabase().getKdfEngine();
|
||||
}
|
||||
|
||||
public void assignKdfEngine(KdfEngine kdfEngine) {
|
||||
switch (getPwDatabase().getVersion()) {
|
||||
case V4:
|
||||
((PwDatabaseV4) getPwDatabase()).setKdfEngine(kdfEngine);
|
||||
((PwDatabaseV4) getPwDatabase()).setKdfParameters(kdfEngine.getDefaultParameters());
|
||||
((PwDatabaseV4) getPwDatabase()).setNumberKeyEncryptionRounds(kdfEngine.getDefaultKeyRounds());
|
||||
}
|
||||
}
|
||||
|
||||
public String getKeyDerivationName(Resources resources) {
|
||||
return getPwDatabase().getKeyDerivationName(resources);
|
||||
}
|
||||
|
||||
public String getNumberKeyEncryptionRoundsAsString() {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.database;
|
||||
|
||||
import android.content.res.Resources;
|
||||
|
||||
/**
|
||||
* Interface to generify items with a name resource, that can be (for example) visible in a list
|
||||
*/
|
||||
public interface ObjectNameResource {
|
||||
String getName(Resources resources);
|
||||
}
|
||||
@@ -19,8 +19,11 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.database;
|
||||
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.kunzisoft.keepass.crypto.finalkey.FinalKey;
|
||||
import com.kunzisoft.keepass.crypto.finalkey.FinalKeyFactory;
|
||||
import com.kunzisoft.keepass.crypto.keyDerivation.KdfEngine;
|
||||
import com.kunzisoft.keepass.database.exception.InvalidKeyFileException;
|
||||
import com.kunzisoft.keepass.database.exception.KeyFileEmptyException;
|
||||
import com.kunzisoft.keepass.stream.NullOutputStream;
|
||||
@@ -34,7 +37,6 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.security.DigestOutputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -283,7 +285,11 @@ public abstract class PwDatabase<PwGroupDB extends PwGroup<PwGroupDB, PwGroupDB,
|
||||
|
||||
public abstract List<PwEncryptionAlgorithm> getAvailableEncryptionAlgorithms();
|
||||
|
||||
public abstract String getKeyDerivationName();
|
||||
public abstract List<KdfEngine> getAvailableKdfEngines();
|
||||
|
||||
public abstract KdfEngine getKdfEngine();
|
||||
|
||||
public abstract String getKeyDerivationName(Resources resources);
|
||||
|
||||
public abstract List<PwGroupDB> getGrpRoots();
|
||||
|
||||
|
||||
@@ -45,7 +45,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
package com.kunzisoft.keepass.database;
|
||||
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.kunzisoft.keepass.crypto.keyDerivation.AesKdf;
|
||||
import com.kunzisoft.keepass.crypto.keyDerivation.KdfEngine;
|
||||
import com.kunzisoft.keepass.database.exception.InvalidKeyFileException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -62,6 +65,7 @@ import java.util.Random;
|
||||
public class PwDatabaseV3 extends PwDatabase<PwGroupV3, PwEntryV3> {
|
||||
|
||||
private static final int DEFAULT_ENCRYPTION_ROUNDS = 300;
|
||||
private KdfEngine kdfEngine = new AesKdf(); // Always the same
|
||||
|
||||
// all entries
|
||||
private List<PwEntryV3> entries = new ArrayList<>();
|
||||
@@ -96,8 +100,20 @@ public class PwDatabaseV3 extends PwDatabase<PwGroupV3, PwEntryV3> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKeyDerivationName() {
|
||||
return AesKdf.DEFAULT_NAME;
|
||||
public KdfEngine getKdfEngine() {
|
||||
return kdfEngine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KdfEngine> getAvailableKdfEngines() {
|
||||
List<KdfEngine> list = new ArrayList<>();
|
||||
list.add(kdfEngine);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKeyDerivationName(Resources resources) {
|
||||
return kdfEngine.getName(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package com.kunzisoft.keepass.database;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.webkit.URLUtil;
|
||||
|
||||
import com.kunzisoft.keepass.collections.VariantDictionary;
|
||||
@@ -150,6 +151,33 @@ public class PwDatabaseV4 extends PwDatabase<PwGroupV4, PwEntryV4> {
|
||||
this.compressionAlgorithm = compressionAlgorithm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public KdfEngine getKdfEngine() {
|
||||
return kdfEngine;
|
||||
}
|
||||
|
||||
public void setKdfEngine(KdfEngine kdfEngine) {
|
||||
this.kdfEngine = kdfEngine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKeyDerivationName(Resources resources) {
|
||||
return kdfEngine.getName(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KdfEngine> getAvailableKdfEngines() {
|
||||
return KdfFactory.kdfList;
|
||||
}
|
||||
|
||||
public KdfParameters getKdfParameters() {
|
||||
return kdfParameters;
|
||||
}
|
||||
|
||||
public void setKdfParameters(KdfParameters kdfParameters) {
|
||||
this.kdfParameters = kdfParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNumberKeyEncryptionRounds() {
|
||||
if (getKdfEngine() != null && getKdfParameters() != null)
|
||||
@@ -334,15 +362,6 @@ public class PwDatabaseV4 extends PwDatabase<PwGroupV4, PwEntryV4> {
|
||||
this.customData.put(label, value);
|
||||
}
|
||||
|
||||
public KdfEngine getKdfEngine() {
|
||||
return kdfEngine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKeyDerivationName() {
|
||||
return kdfEngine.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getMasterKey(String key, InputStream keyInputStream)
|
||||
throws InvalidKeyFileException, IOException {
|
||||
@@ -703,14 +722,6 @@ public class PwDatabaseV4 extends PwDatabase<PwGroupV4, PwEntryV4> {
|
||||
return groups.get(recycleId);
|
||||
}
|
||||
|
||||
public KdfParameters getKdfParameters() {
|
||||
return kdfParameters;
|
||||
}
|
||||
|
||||
public void setKdfParameters(KdfParameters kdfParameters) {
|
||||
this.kdfParameters = kdfParameters;
|
||||
}
|
||||
|
||||
public VariantDictionary getPublicCustomData() {
|
||||
return publicCustomData;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.kunzisoft.keepass.crypto.engine.TwofishEngine;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public enum PwEncryptionAlgorithm {
|
||||
public enum PwEncryptionAlgorithm implements ObjectNameResource {
|
||||
|
||||
AES_Rijndael,
|
||||
Twofish,
|
||||
@@ -39,11 +39,11 @@ public enum PwEncryptionAlgorithm {
|
||||
switch (this) {
|
||||
default:
|
||||
case AES_Rijndael:
|
||||
return resources.getString(R.string.rijndael);
|
||||
return resources.getString(R.string.encryption_rijndael);
|
||||
case Twofish:
|
||||
return resources.getString(R.string.twofish);
|
||||
return resources.getString(R.string.encryption_twofish);
|
||||
case ChaCha20:
|
||||
return resources.getString(R.string.chacha20);
|
||||
return resources.getString(R.string.encryption_chacha20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,9 @@ import com.kunzisoft.keepass.dialogs.UnavailableFeatureDialogFragment;
|
||||
import com.kunzisoft.keepass.dialogs.UnderDevelopmentFeatureDialogFragment;
|
||||
import com.kunzisoft.keepass.fingerprint.FingerPrintHelper;
|
||||
import com.kunzisoft.keepass.icons.IconPackChooser;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.DatabaseAlgorithmPreferenceDialogFragmentCompat;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.DatabaseDescriptionPreferenceDialogFragmentCompat;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.DatabaseKeyDerivationPreferenceDialogFragmentCompat;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.DatabaseNamePreferenceDialogFragmentCompat;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.RoundsPreferenceDialogFragmentCompat;
|
||||
import com.kunzisoft.keepass.stylish.Stylish;
|
||||
@@ -70,6 +71,8 @@ public class NestedSettingsFragment extends PreferenceFragmentCompat
|
||||
|
||||
private int count = 0;
|
||||
|
||||
private Preference roundPref;
|
||||
|
||||
public static NestedSettingsFragment newInstance(Screen key) {
|
||||
NestedSettingsFragment fragment = new NestedSettingsFragment();
|
||||
// supply arguments to bundle.
|
||||
@@ -321,11 +324,10 @@ public class NestedSettingsFragment extends PreferenceFragmentCompat
|
||||
|
||||
// Key derivation function
|
||||
Preference kdfPref = findPreference(getString(R.string.key_derivation_function_key));
|
||||
kdfPref.setSummary(db.getKeyDerivationName());
|
||||
preferenceInDevelopment(kdfPref);
|
||||
kdfPref.setSummary(db.getKeyDerivationName(getResources()));
|
||||
|
||||
// Round encryption
|
||||
Preference roundPref = findPreference(getString(R.string.transform_rounds_key));
|
||||
roundPref = findPreference(getString(R.string.transform_rounds_key));
|
||||
roundPref.setSummary(db.getNumberKeyEncryptionRoundsAsString());
|
||||
|
||||
} else {
|
||||
@@ -432,7 +434,13 @@ public class NestedSettingsFragment extends PreferenceFragmentCompat
|
||||
dialogFragment = DatabaseDescriptionPreferenceDialogFragmentCompat.newInstance(preference.getKey());
|
||||
}
|
||||
else if (preference.getKey().equals(getString(R.string.encryption_algorithm_key))) {
|
||||
dialogFragment = DatabaseAlgorithmPreferenceDialogFragmentCompat.newInstance(preference.getKey());
|
||||
dialogFragment = DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat.newInstance(preference.getKey());
|
||||
}
|
||||
else if (preference.getKey().equals(getString(R.string.key_derivation_function_key))) {
|
||||
DatabaseKeyDerivationPreferenceDialogFragmentCompat keyDerivationDialogFragment = DatabaseKeyDerivationPreferenceDialogFragmentCompat.newInstance(preference.getKey());
|
||||
if (roundPref != null)
|
||||
keyDerivationDialogFragment.setRoundPreference(roundPref);
|
||||
dialogFragment = keyDerivationDialogFragment;
|
||||
}
|
||||
else if (preference.getKey().equals(getString(R.string.transform_rounds_key))) {
|
||||
dialogFragment = RoundsPreferenceDialogFragmentCompat.newInstance(preference.getKey());
|
||||
|
||||
@@ -6,21 +6,21 @@ import android.util.AttributeSet;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
|
||||
public class AlgorithmListPreference extends DialogPreference {
|
||||
public class DialogListExplanationPreference extends DialogPreference {
|
||||
|
||||
public AlgorithmListPreference(Context context) {
|
||||
public DialogListExplanationPreference(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public AlgorithmListPreference(Context context, AttributeSet attrs) {
|
||||
public DialogListExplanationPreference(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, R.attr.dialogPreferenceStyle);
|
||||
}
|
||||
|
||||
public AlgorithmListPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
public DialogListExplanationPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
this(context, attrs, defStyleAttr, defStyleAttr);
|
||||
}
|
||||
|
||||
public AlgorithmListPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
public DialogListExplanationPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
import com.kunzisoft.keepass.database.PwEncryptionAlgorithm;
|
||||
import com.kunzisoft.keepass.database.edit.OnFinish;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DatabaseAlgorithmPreferenceDialogFragmentCompat extends DatabaseSavePreferenceDialogFragmentCompat {
|
||||
|
||||
private AlgorithmAdapter algorithmAdapter;
|
||||
private PwEncryptionAlgorithm algorithmSelected;
|
||||
|
||||
public static DatabaseAlgorithmPreferenceDialogFragmentCompat newInstance(
|
||||
String key) {
|
||||
final DatabaseAlgorithmPreferenceDialogFragmentCompat
|
||||
fragment = new DatabaseAlgorithmPreferenceDialogFragmentCompat();
|
||||
final Bundle b = new Bundle(1);
|
||||
b.putString(ARG_KEY, key);
|
||||
fragment.setArguments(b);
|
||||
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(View view) {
|
||||
super.onBindDialogView(view);
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.pref_dialog_list);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
algorithmAdapter = new AlgorithmAdapter();
|
||||
recyclerView.setAdapter(algorithmAdapter);
|
||||
|
||||
setAlgorithm(database.getAvailableEncryptionAlgorithm(), database.getEncryptionAlgorithm());
|
||||
}
|
||||
|
||||
public void setAlgorithm(List<PwEncryptionAlgorithm> algorithmList, PwEncryptionAlgorithm algorithm) {
|
||||
if (algorithmAdapter != null)
|
||||
algorithmAdapter.setAlgorithms(algorithmList, algorithm);
|
||||
algorithmSelected = algorithm;
|
||||
}
|
||||
|
||||
private class AlgorithmAdapter extends RecyclerView.Adapter<AlgorithmViewHolder> {
|
||||
|
||||
private LayoutInflater inflater;
|
||||
|
||||
private List<PwEncryptionAlgorithm> algorithms;
|
||||
private PwEncryptionAlgorithm algorithmUsed;
|
||||
|
||||
AlgorithmAdapter() {
|
||||
this.inflater = LayoutInflater.from(getContext());
|
||||
this.algorithms = new ArrayList<>();
|
||||
this.algorithmUsed = null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AlgorithmViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = inflater.inflate(R.layout.pref_dialog_list_radio_item, parent, false);
|
||||
return new AlgorithmViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AlgorithmViewHolder holder, int position) {
|
||||
PwEncryptionAlgorithm algorithm = this.algorithms.get(position);
|
||||
holder.radioButton.setText(algorithm.getName(getResources()));
|
||||
if (algorithmUsed != null && algorithmUsed.equals(algorithm))
|
||||
holder.radioButton.setChecked(true);
|
||||
else
|
||||
holder.radioButton.setChecked(false);
|
||||
holder.radioButton.setOnClickListener(new OnAlgorithmClickListener(algorithm));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return algorithms.size();
|
||||
}
|
||||
|
||||
public void setAlgorithms(List<PwEncryptionAlgorithm> algorithms, PwEncryptionAlgorithm algorithmUsed) {
|
||||
this.algorithms.clear();
|
||||
this.algorithms.addAll(algorithms);
|
||||
this.algorithmUsed = algorithmUsed;
|
||||
}
|
||||
|
||||
void setAlgorithmUsed(PwEncryptionAlgorithm algorithmUsed) {
|
||||
this.algorithmUsed = algorithmUsed;
|
||||
}
|
||||
}
|
||||
|
||||
private class AlgorithmViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
RadioButton radioButton;
|
||||
|
||||
public AlgorithmViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
radioButton = itemView.findViewById(R.id.pref_dialog_list_radio);
|
||||
}
|
||||
}
|
||||
|
||||
private class OnAlgorithmClickListener implements View.OnClickListener {
|
||||
|
||||
private PwEncryptionAlgorithm algorithmClicked;
|
||||
|
||||
public OnAlgorithmClickListener(PwEncryptionAlgorithm algorithm) {
|
||||
this.algorithmClicked = algorithm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
algorithmSelected = algorithmClicked;
|
||||
algorithmAdapter.setAlgorithmUsed(algorithmSelected);
|
||||
algorithmAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public PwEncryptionAlgorithm getAlgorithmSelected() {
|
||||
return algorithmSelected;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDialogClosed(boolean positiveResult) {
|
||||
if ( positiveResult ) {
|
||||
assert getContext() != null;
|
||||
|
||||
if (getAlgorithmSelected() != null) {
|
||||
PwEncryptionAlgorithm newAlgorithm = getAlgorithmSelected();
|
||||
PwEncryptionAlgorithm oldAlgorithm = database.getEncryptionAlgorithm();
|
||||
database.assignEncryptionAlgorithm(newAlgorithm);
|
||||
|
||||
Handler handler = new Handler();
|
||||
setAfterSaveDatabase(new AfterDescriptionSave(getContext(), handler, newAlgorithm, oldAlgorithm));
|
||||
}
|
||||
}
|
||||
|
||||
super.onDialogClosed(positiveResult);
|
||||
}
|
||||
|
||||
private class AfterDescriptionSave extends OnFinish {
|
||||
|
||||
private PwEncryptionAlgorithm mNewAlgorithm;
|
||||
private PwEncryptionAlgorithm mOldAlgorithm;
|
||||
private Context mCtx;
|
||||
|
||||
AfterDescriptionSave(Context ctx, Handler handler, PwEncryptionAlgorithm newAlgorithm, PwEncryptionAlgorithm oldAlgorithm) {
|
||||
super(handler);
|
||||
|
||||
mCtx = ctx;
|
||||
mNewAlgorithm = newAlgorithm;
|
||||
mOldAlgorithm = oldAlgorithm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PwEncryptionAlgorithm algorithmToShow = mNewAlgorithm;
|
||||
|
||||
if (!mSuccess) {
|
||||
displayMessage(mCtx);
|
||||
database.assignEncryptionAlgorithm(mOldAlgorithm);
|
||||
}
|
||||
|
||||
getPreference().setSummary(algorithmToShow.getName(mCtx.getResources()));
|
||||
|
||||
super.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
import com.kunzisoft.keepass.database.PwEncryptionAlgorithm;
|
||||
import com.kunzisoft.keepass.database.edit.OnFinish;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.adapter.ListRadioItemAdapter;
|
||||
|
||||
public class DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat extends DatabaseSavePreferenceDialogFragmentCompat
|
||||
implements ListRadioItemAdapter.RadioItemSelectedCallback<PwEncryptionAlgorithm> {
|
||||
|
||||
private PwEncryptionAlgorithm algorithmSelected;
|
||||
|
||||
public static DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat newInstance(
|
||||
String key) {
|
||||
final DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat
|
||||
fragment = new DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat();
|
||||
final Bundle b = new Bundle(1);
|
||||
b.putString(ARG_KEY, key);
|
||||
fragment.setArguments(b);
|
||||
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(View view) {
|
||||
super.onBindDialogView(view);
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.pref_dialog_list);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
ListRadioItemAdapter<PwEncryptionAlgorithm> encryptionAlgorithmAdapter = new ListRadioItemAdapter<>(getActivity());
|
||||
encryptionAlgorithmAdapter.setRadioItemSelectedCallback(this);
|
||||
recyclerView.setAdapter(encryptionAlgorithmAdapter);
|
||||
|
||||
algorithmSelected = database.getEncryptionAlgorithm();
|
||||
encryptionAlgorithmAdapter.setItems(database.getAvailableEncryptionAlgorithms(), algorithmSelected);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDialogClosed(boolean positiveResult) {
|
||||
if ( positiveResult ) {
|
||||
assert getContext() != null;
|
||||
|
||||
if (algorithmSelected != null) {
|
||||
PwEncryptionAlgorithm newAlgorithm = algorithmSelected;
|
||||
PwEncryptionAlgorithm oldAlgorithm = database.getEncryptionAlgorithm();
|
||||
database.assignEncryptionAlgorithm(newAlgorithm);
|
||||
|
||||
Handler handler = new Handler();
|
||||
setAfterSaveDatabase(new AfterDescriptionSave(getContext(), handler, newAlgorithm, oldAlgorithm));
|
||||
}
|
||||
}
|
||||
|
||||
super.onDialogClosed(positiveResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelected(PwEncryptionAlgorithm item) {
|
||||
this.algorithmSelected = item;
|
||||
}
|
||||
|
||||
private class AfterDescriptionSave extends OnFinish {
|
||||
|
||||
private PwEncryptionAlgorithm mNewAlgorithm;
|
||||
private PwEncryptionAlgorithm mOldAlgorithm;
|
||||
private Context mCtx;
|
||||
|
||||
AfterDescriptionSave(Context ctx, Handler handler, PwEncryptionAlgorithm newAlgorithm, PwEncryptionAlgorithm oldAlgorithm) {
|
||||
super(handler);
|
||||
|
||||
mCtx = ctx;
|
||||
mNewAlgorithm = newAlgorithm;
|
||||
mOldAlgorithm = oldAlgorithm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PwEncryptionAlgorithm algorithmToShow = mNewAlgorithm;
|
||||
|
||||
if (!mSuccess) {
|
||||
displayMessage(mCtx);
|
||||
database.assignEncryptionAlgorithm(mOldAlgorithm);
|
||||
}
|
||||
|
||||
getPreference().setSummary(algorithmToShow.getName(mCtx.getResources()));
|
||||
|
||||
super.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
import com.kunzisoft.keepass.crypto.keyDerivation.KdfEngine;
|
||||
import com.kunzisoft.keepass.database.edit.OnFinish;
|
||||
import com.kunzisoft.keepass.settings.preferenceDialogFragment.adapter.ListRadioItemAdapter;
|
||||
|
||||
public class DatabaseKeyDerivationPreferenceDialogFragmentCompat extends DatabaseSavePreferenceDialogFragmentCompat
|
||||
implements ListRadioItemAdapter.RadioItemSelectedCallback<KdfEngine> {
|
||||
|
||||
private KdfEngine kdfEngineSelected;
|
||||
private Preference roundPreference;
|
||||
|
||||
public static DatabaseKeyDerivationPreferenceDialogFragmentCompat newInstance(
|
||||
String key) {
|
||||
final DatabaseKeyDerivationPreferenceDialogFragmentCompat
|
||||
fragment = new DatabaseKeyDerivationPreferenceDialogFragmentCompat();
|
||||
final Bundle b = new Bundle(1);
|
||||
b.putString(ARG_KEY, key);
|
||||
fragment.setArguments(b);
|
||||
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(View view) {
|
||||
super.onBindDialogView(view);
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.pref_dialog_list);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
ListRadioItemAdapter<KdfEngine> kdfAdapter = new ListRadioItemAdapter<>(getActivity());
|
||||
kdfAdapter.setRadioItemSelectedCallback(this);
|
||||
recyclerView.setAdapter(kdfAdapter);
|
||||
|
||||
kdfEngineSelected = database.getKdfEngine();
|
||||
kdfAdapter.setItems(database.getAvailableKdfEngines(), kdfEngineSelected);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDialogClosed(boolean positiveResult) {
|
||||
if ( positiveResult ) {
|
||||
assert getContext() != null;
|
||||
|
||||
if (kdfEngineSelected != null) {
|
||||
KdfEngine newKdfEngine = kdfEngineSelected;
|
||||
KdfEngine oldKdfEngine = database.getKdfEngine();
|
||||
database.assignKdfEngine(newKdfEngine);
|
||||
|
||||
Handler handler = new Handler();
|
||||
setAfterSaveDatabase(new AfterDescriptionSave(getContext(), handler, newKdfEngine, oldKdfEngine));
|
||||
}
|
||||
}
|
||||
|
||||
super.onDialogClosed(positiveResult);
|
||||
}
|
||||
|
||||
public void setRoundPreference(Preference preference) {
|
||||
this.roundPreference = preference;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelected(KdfEngine item) {
|
||||
kdfEngineSelected = item;
|
||||
}
|
||||
|
||||
private class AfterDescriptionSave extends OnFinish {
|
||||
|
||||
private KdfEngine mNewKdfEngine;
|
||||
private KdfEngine mOldKdfEngine;
|
||||
private Context mCtx;
|
||||
|
||||
AfterDescriptionSave(Context ctx, Handler handler, KdfEngine newKdfEngine, KdfEngine oldKdfEngine) {
|
||||
super(handler);
|
||||
|
||||
this.mCtx = ctx;
|
||||
this.mNewKdfEngine = newKdfEngine;
|
||||
this.mOldKdfEngine = oldKdfEngine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
KdfEngine kdfEngineToShow = mNewKdfEngine;
|
||||
|
||||
if (!mSuccess) {
|
||||
displayMessage(mCtx);
|
||||
database.assignKdfEngine(mOldKdfEngine);
|
||||
}
|
||||
|
||||
getPreference().setSummary(kdfEngineToShow.getName(mCtx.getResources()));
|
||||
roundPreference.setSummary(String.valueOf(kdfEngineToShow.getDefaultKeyRounds()));
|
||||
|
||||
super.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment;
|
||||
|
||||
import android.support.v7.preference.PreferenceDialogFragmentCompat;
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
import com.kunzisoft.keepass.database.ObjectNameResource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ListRadioItemAdapter<T extends ObjectNameResource> extends RecyclerView.Adapter<ListRadioViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
|
||||
private List<T> radioItemList;
|
||||
private T radioItemUsed;
|
||||
|
||||
private RadioItemSelectedCallback<T> radioItemSelectedCallback;
|
||||
|
||||
public ListRadioItemAdapter(Context context) {
|
||||
this.context = context;
|
||||
this.inflater = LayoutInflater.from(context);
|
||||
this.radioItemList = new ArrayList<>();
|
||||
this.radioItemUsed = null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ListRadioViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = inflater.inflate(R.layout.pref_dialog_list_radio_item, parent, false);
|
||||
return new ListRadioViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ListRadioViewHolder holder, int position) {
|
||||
T item = this.radioItemList.get(position);
|
||||
holder.radioButton.setText(item.getName(context.getResources()));
|
||||
if (radioItemUsed != null && radioItemUsed.equals(item))
|
||||
holder.radioButton.setChecked(true);
|
||||
else
|
||||
holder.radioButton.setChecked(false);
|
||||
holder.radioButton.setOnClickListener(new OnItemClickListener(item));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return radioItemList.size();
|
||||
}
|
||||
|
||||
public void setItems(List<T> algorithms, T algorithmUsed) {
|
||||
this.radioItemList.clear();
|
||||
this.radioItemList.addAll(algorithms);
|
||||
this.radioItemUsed = algorithmUsed;
|
||||
}
|
||||
|
||||
private void setRadioItemUsed(T radioItemUsed) {
|
||||
this.radioItemUsed = radioItemUsed;
|
||||
}
|
||||
|
||||
private class OnItemClickListener implements View.OnClickListener {
|
||||
|
||||
private T itemClicked;
|
||||
|
||||
OnItemClickListener(T item) {
|
||||
this.itemClicked = item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (radioItemSelectedCallback != null)
|
||||
radioItemSelectedCallback.onItemSelected(itemClicked);
|
||||
setRadioItemUsed(itemClicked);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void setRadioItemSelectedCallback(RadioItemSelectedCallback<T> radioItemSelectedCallback) {
|
||||
this.radioItemSelectedCallback = radioItemSelectedCallback;
|
||||
}
|
||||
|
||||
public interface RadioItemSelectedCallback<T> {
|
||||
void onItemSelected(T item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePass DX.
|
||||
*
|
||||
* KeePass DX 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePass DX 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 KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings.preferenceDialogFragment.adapter;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
import com.kunzisoft.keepass.R;
|
||||
|
||||
public class ListRadioViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public RadioButton radioButton;
|
||||
|
||||
public ListRadioViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
radioButton = itemView.findViewById(R.id.pref_dialog_list_radio);
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@
|
||||
<string name="remember_keyfile_summary">Recorda la localització d\'arxius clau</string>
|
||||
<string name="remember_keyfile_title">Guarda arxiu clau</string>
|
||||
<string name="remove_from_filelist">Elimina</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Arrel</string>
|
||||
<string name="rounds">Passades d\'encriptació</string>
|
||||
<string name="rounds_explanation">Més passades d\'encriptació dónen protecció adicional contra atacs de força bruta, però poden alentir molt carregar i guardar la base de dades.</string>
|
||||
@@ -135,7 +135,7 @@
|
||||
<string name="special">Especial</string>
|
||||
<string name="search">Títol/descripció d\'entrada</string>
|
||||
<string name="search_results">Resultats de cerca</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Subratllat</string>
|
||||
<string name="unsupported_db_version">Versió de la base de dades no suportada.</string>
|
||||
<string name="uppercase">Majúscules</string>
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
<string name="remember_keyfile_summary">Pamatovat si umístění klíčového souboru</string>
|
||||
<string name="remember_keyfile_title">Uložit klíčový soubor</string>
|
||||
<string name="remove_from_filelist">Odstranit</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Kořen</string>
|
||||
<string name="rounds">Počet zašifrování</string>
|
||||
<string name="rounds_explanation">Vyšší počet opakování šifrování zvýší bezpečnost proti hrubému útoku, ale může výrazně zpomalit načítání a ukládání.</string>
|
||||
@@ -151,7 +151,7 @@
|
||||
<string name="special">Speciální</string>
|
||||
<string name="search">Zadejte název/popis</string>
|
||||
<string name="search_results">Výsledky hledání</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Podtrženo</string>
|
||||
<string name="unsupported_db_version">Nepodporovaná verze databáze.</string>
|
||||
<string name="uppercase">Velká písmena</string>
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
<string name="remember_keyfile_summary">Husker placeringen af nøglefiler</string>
|
||||
<string name="remember_keyfile_title">Gem nøglefil</string>
|
||||
<string name="remove_from_filelist">Fjern</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">Krypterings-gentagelser</string>
|
||||
<string name="rounds_explanation">Højere krypterings-gentagelser giver øget beskyttelse imod brute-force angreb, men kan påvirke læsnings- og skrivehastigheden betydentligt.</string>
|
||||
@@ -150,7 +150,7 @@
|
||||
<string name="special">Speciel</string>
|
||||
<string name="search">Post titel/beskrivelse</string>
|
||||
<string name="search_results">Søgeresultater</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Understreget</string>
|
||||
<string name="unsupported_db_version">Database-versionen er ikke understøttet.</string>
|
||||
<string name="uppercase">Store bogstaver</string>
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
<string name="remember_keyfile_summary">Den Pfad der Schlüsseldatei merken.</string>
|
||||
<string name="remember_keyfile_title">Schlüsselquelle merken</string>
|
||||
<string name="remove_from_filelist">Löschen</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Start</string>
|
||||
<string name="rounds">Schlüsseltransformationen</string>
|
||||
<string name="rounds_explanation">Je höher die Anzahl der Schlüsseltransformationen, desto besser ist der Schutz gegen Wörterbuch- oder Brute-Force-Angriffe. Allerdings dauert dann auch das Laden und Speichern der Datenbank entsprechend länger.</string>
|
||||
@@ -159,7 +159,7 @@
|
||||
<string name="special">Spezialsymbole</string>
|
||||
<string name="search">Titel/Beschreibung des Eintrags</string>
|
||||
<string name="search_results">Suchergebnisse</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Unterstrichen</string>
|
||||
<string name="unsupported_db_version">Datenbankversion wird nicht unterstützt.</string>
|
||||
<string name="uppercase">Großbuchstaben</string>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<string name="remember_keyfile_summary">Να θυμάσαι την τοποθεσία των αρχείων κλειδιών</string>
|
||||
<string name="remember_keyfile_title">Αποθήκευση αρχείου κλειδιού</string>
|
||||
<string name="remove_from_filelist">Απομάκρυνση</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Ριζικός Κατάλογος</string>
|
||||
<string name="rounds">Κύκλοι Κρυπτογράφησης</string>
|
||||
<string name="rounds_explanation">Μεγαλύτεροι κύκλοι κρυπτογράφησης παρέχουν πρόσθετη προστασία ενάντια σε επιθέσεις brute force, αλλά μπορεί να επιβραδύνει πολύ την φόρτωση και την αποθήκευση.</string>
|
||||
@@ -148,7 +148,7 @@
|
||||
<string name="special">Ειδικοί</string>
|
||||
<string name="search">Τίτλος/περιγραφή εγγραφής</string>
|
||||
<string name="search_results">Αποτελέσματα αναζήτησης</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Υπογράμμιση</string>
|
||||
<string name="unsupported_db_version">Μη υποστηριζόμενη έκδοση βάσης δεδομένων.</string>
|
||||
<string name="uppercase">Κεφαλαία</string>
|
||||
|
||||
@@ -124,7 +124,7 @@ Spanish translation by José I. Paños. Updated by David García-Abad (23-09-201
|
||||
<string name="remember_keyfile_summary">Recordar la ubicación de archivos de clave</string>
|
||||
<string name="remember_keyfile_title">Guardando archivo de clave</string>
|
||||
<string name="remove_from_filelist">Borrar</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Raíz</string>
|
||||
<string name="rounds">Pasadas de Cifrado</string>
|
||||
<string name="rounds_explanation">Un alto número de pasadas de cifrado proporciona protección adicional contra ataques de fuerza bruta, pero puede ralentizar mucho el cargado y el guardado.</string>
|
||||
@@ -135,7 +135,7 @@ Spanish translation by José I. Paños. Updated by David García-Abad (23-09-201
|
||||
<string name="sort_db">Orden de BD</string>
|
||||
<string name="special">Especial</string>
|
||||
<string name="search">Título/descripción de entrada</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Subrayado</string>
|
||||
<string name="unsupported_db_version">Versión de base de datos no soportada.</string>
|
||||
<string name="uppercase">Mayúsculas</string>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<string name="remember_keyfile_summary">Gogoratu gako fitxategien kokapenak</string>
|
||||
<string name="remember_keyfile_title">Gako fitxategia gorde</string>
|
||||
<string name="remove_from_filelist">Ezabatu</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">Enkriptatzeko Rondak</string>
|
||||
<string name="rounds_explanation">Enkriptatzeko ronda gehiago indar gordineko atakeen kontrako babes gehiago ematen dute, baina kargatzea eta gordetzea moteldu dezakete modu nabarmenean.</string>
|
||||
@@ -148,7 +148,7 @@
|
||||
<string name="special">Berezia</string>
|
||||
<string name="search">Sarreraren Izena / Deskribapena</string>
|
||||
<string name="search_results">Bilaketaren emaitzak</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Azpimarratu</string>
|
||||
<string name="unsupported_db_version">Euskarririk gabeko datubase bertsioa.</string>
|
||||
<string name="uppercase">Maiuskulak</string>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
<string name="remember_keyfile_summary">Muista avaintiedostojen sijainti</string>
|
||||
<string name="remember_keyfile_title">Tallenna avaintiedosto</string>
|
||||
<string name="remove_from_filelist">Poista</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Juuri</string>
|
||||
<string name="rounds">Salauskierroksia</string>
|
||||
<string name="rounds_explanation">Suurempi kierrosten määrä parantaa suojausta raa\'alla voimalla tehdyiltä murtoyrityksiltä, mutta voi todella hidastaa lataamista ja tallentamista.</string>
|
||||
@@ -146,7 +146,7 @@
|
||||
<string name="special">Erityistä</string>
|
||||
<string name="search">Tietueen otsikko/kuvaus</string>
|
||||
<string name="search_results">Hakutulokset</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Alleviivattu</string>
|
||||
<string name="unsupported_db_version">Ei-tuettu salasanatietokannan versio.</string>
|
||||
<string name="uppercase">Isot kirjaimet</string>
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<string name="remember_keyfile_summary">Mémoriser le répertoire de stockage des fichiers de clés</string>
|
||||
<string name="remember_keyfile_title">Mémoriser le fichier de clé</string>
|
||||
<string name="remove_from_filelist">Effacer</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Racine</string>
|
||||
<string name="rounds">Tours de transformation</string>
|
||||
<string name="rounds_explanation">Un niveau de chiffrement supérieur assure une protection supplémentaire contre les attaques de force brute, mais peut considérablement ralentir l\'ouverture et l\'enregistrement.</string>
|
||||
@@ -172,7 +172,7 @@
|
||||
<string name="special">Spécial</string>
|
||||
<string name="search">Nom/description</string>
|
||||
<string name="search_results">Résultats</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Souligné</string>
|
||||
<string name="unsupported_db_version">Version de la base de données non supportée.</string>
|
||||
<string name="uppercase">Majuscule</string>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
<string name="remember_keyfile_summary">Jegyezze meg a kulcsfájlok helyét</string>
|
||||
<string name="remember_keyfile_title">Kulcsfájl mentése</string>
|
||||
<string name="remove_from_filelist">Eltávolítás</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Gyökérkönyvár</string>
|
||||
<string name="rounds">Titkosítási menetek száma</string>
|
||||
<string name="rounds_explanation">A titkosítási menetek számának növelésével extra védelemet kaphat a brute force támadások ellen, ugyanakkor jelentősen lassíthatja az adatbázis betöltését vagy mentését.</string>
|
||||
@@ -146,7 +146,7 @@
|
||||
<string name="special">Speciális</string>
|
||||
<string name="search">Bejegyzés név/leírás</string>
|
||||
<string name="search_results">Keresés eredménye</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Aláhúzás</string>
|
||||
<string name="unsupported_db_version">Nem támogatott adatbázis.</string>
|
||||
<string name="uppercase">Nagybetűk</string>
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<string name="remember_keyfile_summary">Ricorda la posizione dei file chiave</string>
|
||||
<string name="remember_keyfile_title">Salva il file chiave</string>
|
||||
<string name="remove_from_filelist">Elimina</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Principale</string>
|
||||
<string name="rounds">Livello cifratura</string>
|
||||
<string name="rounds_explanation">Un livello di cifratura elevato fornisce una protezione maggiore contro attacchi di tipo "forza brutta", ma può veramente rallentare il caricamento e il salvataggio.</string>
|
||||
@@ -134,7 +134,7 @@
|
||||
<string name="sort_db">Ordinamento DB</string>
|
||||
<string name="special">Speciale</string>
|
||||
<string name="search">Titolo/descrizione voce</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Sottolinea</string>
|
||||
<string name="unsupported_db_version">Versione database non supportata.</string>
|
||||
<string name="uppercase">Maiuscolo</string>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<string name="remember_keyfile_summary">前回使用したキーファイルを次回も表示します</string>
|
||||
<string name="remember_keyfile_title">キーファイルを記憶</string>
|
||||
<string name="remove_from_filelist">消去</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">暗号化レベル</string>
|
||||
<string name="rounds_explanation">暗号化レベルを高く設定するとブルートフォース(総当り)攻撃に強くなりますが、保存や読込に時間が掛かります。</string>
|
||||
@@ -131,7 +131,7 @@
|
||||
<string name="sort_db">並べ替え</string>
|
||||
<string name="special">記号</string>
|
||||
<string name="search">キーワードを入力</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">アンダーライン (_)</string>
|
||||
<string name="unsupported_db_version">このバージョンのデータベースはサポートされていません。</string>
|
||||
<string name="uppercase">英数大文字</string>
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<string name="remember_keyfile_summary">Atcerēties šo atslēgas faila vietu</string>
|
||||
<string name="remember_keyfile_title">Saglabāt atslēgas failu</string>
|
||||
<string name="remove_from_filelist">Noņemt</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">Šifrēšanas līmeņi</string>
|
||||
<string name="rounds_explanation">Augstākā līmeņa šifrēšana sniedz lielāku aizsardzību, bet palēnina darbības ar datu bāzēm.</string>
|
||||
@@ -126,7 +126,7 @@
|
||||
<string name="special">Speciālie</string>
|
||||
<string name="search">Ieraksta nosaukums/apraksts</string>
|
||||
<string name="search_results">Meklēšanas rezultāti</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Pasvītrojums</string>
|
||||
<string name="unsupported_db_version">Neatbalstīta datu bāzes versija.</string>
|
||||
<string name="uppercase">Lielie burti</string>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
<string name="remember_keyfile_summary">Onthoudt de locatie van de sleutelbestanden</string>
|
||||
<string name="remember_keyfile_title">Sleutelbestand opslaan</string>
|
||||
<string name="remove_from_filelist">Verwijder</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Top</string>
|
||||
<string name="rounds">Encryptie-cycli</string>
|
||||
<string name="rounds_explanation">Een hoger aantal encryptie-cycli geeft bijkomende bescherming tegen brute-force aanvallen, maar kan het laden en opslaan sterk vertragen.</string>
|
||||
@@ -133,7 +133,7 @@
|
||||
<string name="sort_db">Sorteringsvolgorde DB</string>
|
||||
<string name="special">Speciaal</string>
|
||||
<string name="search">Record titel/beschrijving</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Onderlijnen</string>
|
||||
<string name="unsupported_db_version">Niet-ondersteunde databaseversie.</string>
|
||||
<string name="uppercase">Hoofdletters</string>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<string name="remember_keyfile_summary">Hugsar staden til nøkkelfilene</string>
|
||||
<string name="remember_keyfile_title">Lagra nøkkelfila</string>
|
||||
<string name="remove_from_filelist">Ta vekk</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Rot</string>
|
||||
<string name="rounds">Krypteringsomgangar</string>
|
||||
<string name="rounds_explanation">Fleire krypteringsomgangar gjev tilleggsvern mot rå makt-åtak, men kan òg gjera lasting og lagring mykje tregare.</string>
|
||||
@@ -131,7 +131,7 @@
|
||||
<string name="sort_db">DB-sortering</string>
|
||||
<string name="special">Spesial</string>
|
||||
<string name="search">Oppføringa sin tittel/skildring</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Understreking</string>
|
||||
<string name="unsupported_db_version">Kan ikkje bruka databaseutgåva.</string>
|
||||
<string name="uppercase">Store bokstavar</string>
|
||||
|
||||
@@ -120,7 +120,7 @@ along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
<string name="remember_keyfile_summary">Zapamiętaj lokację plików kluczy</string>
|
||||
<string name="remember_keyfile_title">Zapisz plik klucza</string>
|
||||
<string name="remove_from_filelist">Usuń</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">Złożoność szyfrowania</string>
|
||||
<string name="rounds_explanation">Większa złożoność szyfrowania zapewnia dodatkowe zabezpieczenie przed atakiem brute force, ale może spowolnić wczytywanie i zapisywanie bazy danych.</string>
|
||||
@@ -133,7 +133,7 @@ along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
|
||||
<string name="sort_db">Sortuj wg daty</string>
|
||||
<string name="special">Znaki specjalne</string>
|
||||
<string name="search">Tytuł/opis wpisu</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Podkreślenie</string>
|
||||
<string name="unsupported_db_version">Nieobsługiwana wersja bazy danych.</string>
|
||||
<string name="uppercase">Wielkie litery</string>
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<string name="remember_keyfile_summary">Lembrar o local dos arquivos de chave</string>
|
||||
<string name="remember_keyfile_title">Salvar arquivo de chave</string>
|
||||
<string name="remove_from_filelist">Remover</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Raiz</string>
|
||||
<string name="rounds">Rodadas de criptografia</string>
|
||||
<string name="rounds_explanation">Maior número de rodadas de criptografia adiciona mais proteção contra ataques de força bruta, porém pode tornar o processo de carregar e salvar mais lentos.</string>
|
||||
@@ -134,7 +134,7 @@
|
||||
<string name="sort_db">Ordenação do banco de dados</string>
|
||||
<string name="special">Caracteres Especiais</string>
|
||||
<string name="search">Título/Descrição da entrada</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Underline</string>
|
||||
<string name="unsupported_db_version">Versão de banco de dados não suportada.</string>
|
||||
<string name="uppercase">Letras maiúsculas</string>
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
<string name="remember_keyfile_summary">Relembra a localização dos ficheiros chave</string>
|
||||
<string name="remember_keyfile_title">Guardar ficheiro chave</string>
|
||||
<string name="remove_from_filelist">Remover</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Raiz</string>
|
||||
<string name="rounds">Rondas de encriptação</string>
|
||||
<string name="rounds_explanation">Rondas de encriptação altas providenciam proteção adicional contra ataques de força bruta, mas podem atrasar o tempo de carregamento e armazenamento.</string>
|
||||
@@ -153,7 +153,7 @@
|
||||
<string name="special">Especiais</string>
|
||||
<string name="search">Título/descrição da entrada</string>
|
||||
<string name="search_results">Resultados da pesquisa</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Sublinhado</string>
|
||||
<string name="unsupported_db_version">Versão da base de dados não suportada.</string>
|
||||
<string name="uppercase">Maiúsculas</string>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<string name="remember_keyfile_summary">Хранить пути к файлам-ключам</string>
|
||||
<string name="remember_keyfile_title">Предлагать ключи</string>
|
||||
<string name="remove_from_filelist">Убрать из списка</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">База</string>
|
||||
<string name="rounds">Проходы шифрования</string>
|
||||
<string name="rounds_explanation">Больше проходов – выше стойкость базы к подбору пароля, но медленнее открытие и сохранение</string>
|
||||
@@ -150,7 +150,7 @@
|
||||
<string name="special">$пеци@льные</string>
|
||||
<string name="search">название, комментарий</string>
|
||||
<string name="search_results">Результаты поиска</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">_Подчёркивание_</string>
|
||||
<string name="unsupported_db_version">Неподдерживаемая версия базы</string>
|
||||
<string name="uppercase">ЗАГЛАВНЫЕ</string>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<string name="remember_keyfile_summary">Zapamätať si umiestnenie keyfile</string>
|
||||
<string name="remember_keyfile_title">Uložiť keyfile</string>
|
||||
<string name="remove_from_filelist">Odstrániť</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">Šifrovacie opakovania</string>
|
||||
<string name="rounds_explanation">Vyššie opakovania šifrovania dávajú vyššiu ochranu proti útokom hrubou silou, ale môžu spomaliť načítavanie a ukladanie.</string>
|
||||
@@ -131,7 +131,7 @@
|
||||
<string name="sort_db">DB zoradenie poradia</string>
|
||||
<string name="special">Špeciálne</string>
|
||||
<string name="search">Záznam názov/popis</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Podčiarknuté</string>
|
||||
<string name="unsupported_db_version">Nepodporovaná verzia databázy.</string>
|
||||
<string name="uppercase">Veľké písmená</string>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<string name="remember_keyfile_summary">Sparar sökvägar till nyckelfiler</string>
|
||||
<string name="remember_keyfile_title">Spara nyckelfil</string>
|
||||
<string name="remove_from_filelist">Ta bort</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">Krypteringsrundor</string>
|
||||
<string name="rounds_explanation">Högre antal krypteringsrundor ger ytterligare skydd mot "brute force"-attacker, men kan göra att ladda och spara går betydligt långsammare.</string>
|
||||
@@ -145,7 +145,7 @@
|
||||
<string name="special">Specialtecken</string>
|
||||
<string name="search">Postens titel/beskrivning</string>
|
||||
<string name="search_results">Sökresultat</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Understreck</string>
|
||||
<string name="unsupported_db_version">Databasversionen stöds ej.</string>
|
||||
<string name="uppercase">Versaler</string>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<string name="remember_keyfile_summary">Запам’ятати розташування файла ключа</string>
|
||||
<string name="remember_keyfile_title">Збережіть файл ключа</string>
|
||||
<string name="remove_from_filelist">Вилучити</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Корінь</string>
|
||||
<string name="rounds">Циклів шифрування</string>
|
||||
<string name="rounds_explanation">Велика кількість циклів шифрування забезпечує додатковий захист від грубих атак, але може дійсно уповільнити завантаження та захист.</string>
|
||||
@@ -131,7 +131,7 @@
|
||||
<string name="sort_db">Упорядкування БД</string>
|
||||
<string name="special">Спеціальний</string>
|
||||
<string name="search">Введіть заголовок/опис</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="underline">Підкреслення</string>
|
||||
<string name="unsupported_db_version">Непідтримувана версія бази даних.</string>
|
||||
<string name="uppercase">Верхній регістр</string>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<string name="remember_keyfile_summary">记住密钥文件的位置</string>
|
||||
<string name="remember_keyfile_title">保存密钥文件</string>
|
||||
<string name="remove_from_filelist">移除</string>
|
||||
<string name="rijndael">Rijndael加密(AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael加密(AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">加密次数</string>
|
||||
<string name="rounds_explanation">更高级的加密次数对暴力攻击能提供额外保护,但也会增加加载和保存的时间。</string>
|
||||
@@ -128,7 +128,7 @@
|
||||
<string name="sort_db">数据库的排序顺序</string>
|
||||
<string name="special">特别</string>
|
||||
<string name="search">条目名称/说明</string>
|
||||
<string name="twofish">Twofish算法</string>
|
||||
<string name="encryption_twofish">Twofish算法</string>
|
||||
<string name="underline">强调</string>
|
||||
<string name="unsupported_db_version">不支持的数据库版本。</string>
|
||||
<string name="uppercase">大写</string>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<string name="remember_keyfile_summary">記住密鑰檔的位置</string>
|
||||
<string name="remember_keyfile_title">保存密鑰檔</string>
|
||||
<string name="remove_from_filelist">移除</string>
|
||||
<string name="rijndael">Rijndael加密(AES)</string>
|
||||
<string name="encryption_rijndael">Rijndael加密(AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">加密次數</string>
|
||||
<string name="rounds_explanation">更高級的加密次數對暴力攻擊能提供額外保護,但也會增加載入和保存的時間。</string>
|
||||
@@ -128,7 +128,7 @@
|
||||
<string name="sort_db">資料庫的排序順序</string>
|
||||
<string name="special">特別</string>
|
||||
<string name="search">條目名稱/說明</string>
|
||||
<string name="twofish">Twofish演算法</string>
|
||||
<string name="encryption_twofish">Twofish演算法</string>
|
||||
<string name="underline">強調</string>
|
||||
<string name="unsupported_db_version">不支援的資料庫版本。</string>
|
||||
<string name="uppercase">大寫</string>
|
||||
|
||||
@@ -150,7 +150,6 @@
|
||||
<string name="remember_keyfile_summary">Remember the location of keyfiles</string>
|
||||
<string name="remember_keyfile_title">Save keyfile</string>
|
||||
<string name="remove_from_filelist">Remove</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="rounds">Transform Rounds</string>
|
||||
<string name="rounds_explanation">Higher encryption rounds provide additional protection against brute force attacks, but can really slow down loading and saving.</string>
|
||||
@@ -174,8 +173,6 @@
|
||||
<string name="special">Special</string>
|
||||
<string name="search">Search</string>
|
||||
<string name="search_results">Search results</string>
|
||||
<string name="twofish">Twofish</string>
|
||||
<string name="chacha20">ChaCha20</string>
|
||||
<string name="underline">Underline</string>
|
||||
<string name="unsupported_db_version">Unsupported database version.</string>
|
||||
<string name="uppercase">Upper-case</string>
|
||||
@@ -309,6 +306,15 @@
|
||||
<string name="download">Download</string>
|
||||
<string name="contribute">Contribute</string>
|
||||
|
||||
<!-- Algorithms -->
|
||||
<string name="encryption_rijndael">Rijndael (AES)</string>
|
||||
<string name="encryption_twofish">Twofish</string>
|
||||
<string name="encryption_chacha20">ChaCha20</string>
|
||||
|
||||
<!-- Key Derivation Functions -->
|
||||
<string name="kdf_AES">AES-KDF</string>
|
||||
<string name="kdf_Argon2">Argon2</string>
|
||||
|
||||
<string-array name="timeout_options">
|
||||
<item>5 seconds</item>
|
||||
<item>10 seconds</item>
|
||||
|
||||
@@ -52,11 +52,11 @@
|
||||
<PreferenceCategory
|
||||
android:title="@string/encryption">
|
||||
|
||||
<com.kunzisoft.keepass.settings.preference.AlgorithmListPreference
|
||||
<com.kunzisoft.keepass.settings.preference.DialogListExplanationPreference
|
||||
android:key="@string/encryption_algorithm_key"
|
||||
android:persistent="false"
|
||||
android:title="@string/encryption_algorithm"/>
|
||||
<Preference
|
||||
<com.kunzisoft.keepass.settings.preference.DialogListExplanationPreference
|
||||
android:key="@string/key_derivation_function_key"
|
||||
android:persistent="false"
|
||||
android:title="@string/key_derivation_function"/>
|
||||
|
||||
Reference in New Issue
Block a user