From c31b8e9c862627d504c6770884164a779ce35d21 Mon Sep 17 00:00:00 2001 From: Jakob Nixdorf Date: Thu, 6 Jul 2017 08:54:38 +0200 Subject: [PATCH] Rename SettingsHelper to DatabaseHelper --- .../shadowice/flocke/andotp/ApplicationTest.java | 14 +++++++------- .../{SettingsHelper.java => DatabaseHelper.java} | 2 +- .../flocke/andotp/EntriesCardAdapter.java | 6 +++--- .../org/shadowice/flocke/andotp/MainActivity.java | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) rename app/src/main/java/org/shadowice/flocke/andotp/{SettingsHelper.java => DatabaseHelper.java} (99%) diff --git a/app/src/androidTest/java/org/shadowice/flocke/andotp/ApplicationTest.java b/app/src/androidTest/java/org/shadowice/flocke/andotp/ApplicationTest.java index 6ad6de98..0ddab29a 100644 --- a/app/src/androidTest/java/org/shadowice/flocke/andotp/ApplicationTest.java +++ b/app/src/androidTest/java/org/shadowice/flocke/andotp/ApplicationTest.java @@ -128,10 +128,10 @@ public class ApplicationTest extends ApplicationTestCase { keyStore.deleteEntry("settings"); } - new File(context.getFilesDir() + "/" + SettingsHelper.SETTINGS_FILE).delete(); - new File(context.getFilesDir() + "/" + SettingsHelper.KEY_FILE).delete(); + new File(context.getFilesDir() + "/" + DatabaseHelper.SETTINGS_FILE).delete(); + new File(context.getFilesDir() + "/" + DatabaseHelper.KEY_FILE).delete(); - ArrayList b = SettingsHelper.load(context); + ArrayList b = DatabaseHelper.load(context); assertEquals(0, b.size()); @@ -146,13 +146,13 @@ public class ApplicationTest extends ApplicationTestCase { e.setSecret("secret2".getBytes()); a.add(e); - SettingsHelper.store(context, a); - b = SettingsHelper.load(context); + DatabaseHelper.store(context, a); + b = DatabaseHelper.load(context); assertEquals(a, b); - new File(context.getFilesDir() + "/" + SettingsHelper.SETTINGS_FILE).delete(); - new File(context.getFilesDir() + "/" + SettingsHelper.KEY_FILE).delete(); + new File(context.getFilesDir() + "/" + DatabaseHelper.SETTINGS_FILE).delete(); + new File(context.getFilesDir() + "/" + DatabaseHelper.KEY_FILE).delete(); } public void testEncryptionHelper() throws NoSuchPaddingException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmException, IllegalBlockSizeException, UnsupportedEncodingException, InvalidAlgorithmParameterException, DecoderException { diff --git a/app/src/main/java/org/shadowice/flocke/andotp/SettingsHelper.java b/app/src/main/java/org/shadowice/flocke/andotp/DatabaseHelper.java similarity index 99% rename from app/src/main/java/org/shadowice/flocke/andotp/SettingsHelper.java rename to app/src/main/java/org/shadowice/flocke/andotp/DatabaseHelper.java index b1c3c344..c1277896 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/SettingsHelper.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/DatabaseHelper.java @@ -42,7 +42,7 @@ import javax.crypto.SecretKey; import static org.shadowice.flocke.andotp.Utils.readFully; import static org.shadowice.flocke.andotp.Utils.writeFully; -public class SettingsHelper { +public class DatabaseHelper { public static final String KEY_FILE = "otp.key"; public static final String SETTINGS_FILE = "secrets.dat"; diff --git a/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java b/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java index 67f82685..effd8030 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java @@ -158,7 +158,7 @@ public class EntriesCardAdapter extends RecyclerView.Adapter