From 220b3d1441fb317581e0918e59a6f59730f7fee2 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 31 Jan 2014 20:47:57 -0500 Subject: [PATCH] ensure repo fingerprints are always stored in all upper case this makes sure that the repo fingerprints are always going to have the same case, no matter how they were added. Repo.fingerprint probably should be converted to a BigInteger so that the comparison can be numeric rather than String. Then when the fingerprint needs to be displayed, it can be formatted appropriately. --- src/org/fdroid/fdroid/ManageRepo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index 519ef2b80..d46d2b093 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -423,6 +423,7 @@ class RepoListFragment extends ListFragment final Button addButton = alrt.getButton(DialogInterface.BUTTON_POSITIVE); alrt.setTitle(R.string.repo_exists); overwriteMessage.setVisibility(View.VISIBLE); + newFingerprint = newFingerprint.toUpperCase(Locale.ENGLISH); if (repo.fingerprint == null && newFingerprint != null) { // we're upgrading from unsigned to signed repo overwriteMessage.setText(R.string.repo_exists_add_fingerprint); @@ -469,7 +470,7 @@ class RepoListFragment extends ListFragment private void createNewRepo(String address, String fingerprint) { ContentValues values = new ContentValues(2); values.put(RepoProvider.DataColumns.ADDRESS, address); - values.put(RepoProvider.DataColumns.FINGERPRINT, fingerprint); + values.put(RepoProvider.DataColumns.FINGERPRINT, fingerprint.toUpperCase(Locale.ENGLISH)); RepoProvider.Helper.insert(getActivity().getContentResolver(), values); finishedAddingRepo(); }