From 9d9a0ec2180e7b461684adbd8ab9753068aa5868 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 18 Feb 2014 16:28:54 -0800 Subject: [PATCH] collection of fixes based on comments/small aesthetic stuff // FREEBIE --- src/org/thoughtcrime/securesms/ConversationActivity.java | 5 ++--- src/org/thoughtcrime/securesms/GroupCreateActivity.java | 2 +- .../securesms/SingleContactSelectionActivity.java | 4 +++- .../securesms/SingleContactSelectionListFragment.java | 3 ++- .../securesms/components/PushRecipientsPanel.java | 2 +- .../securesms/components/SingleRecipientPanel.java | 2 +- .../securesms/crypto/DecryptingPartInputStream.java | 8 +++----- src/org/thoughtcrime/securesms/recipients/Recipient.java | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index af1125bab5..adb19a88eb 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -114,7 +114,7 @@ import ws.com.google.android.mms.MmsException; public class ConversationActivity extends PassphraseRequiredSherlockFragmentActivity implements ConversationFragment.ConversationFragmentListener { - private static final String TAG = "ConversationActivity"; + private static final String TAG = ConversationActivity.class.getSimpleName(); public static final String RECIPIENTS_EXTRA = "recipients"; public static final String THREAD_ID_EXTRA = "thread_id"; @@ -498,8 +498,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi if (avatar != null) { getSupportActionBar().setIcon(new BitmapDrawable(getResources(), BitmapUtil.getCroppedBitmap(avatar))); } - } - else { + } else { title = getString(R.string.ConversationActivity_group_conversation); } int size = getRecipients().getRecipientsList().size(); diff --git a/src/org/thoughtcrime/securesms/GroupCreateActivity.java b/src/org/thoughtcrime/securesms/GroupCreateActivity.java index d09de3e76e..5322da3c47 100644 --- a/src/org/thoughtcrime/securesms/GroupCreateActivity.java +++ b/src/org/thoughtcrime/securesms/GroupCreateActivity.java @@ -65,7 +65,7 @@ import static org.whispersystems.textsecure.push.PushMessageProtos.PushMessageCo public class GroupCreateActivity extends PassphraseRequiredSherlockFragmentActivity { - private final static String TAG = "GroupCreateActivity"; + private final static String TAG = GroupCreateActivity.class.getSimpleName(); public static final String MASTER_SECRET_EXTRA = "master_secret"; diff --git a/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java b/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java index 7cbe64593a..18dfecd152 100644 --- a/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java +++ b/src/org/thoughtcrime/securesms/SingleContactSelectionActivity.java @@ -102,7 +102,9 @@ public class SingleContactSelectionActivity extends PassphraseRequiredSherlockFr numberData.number, false); recipients.getRecipientsList().addAll(recipientsForNumber.getRecipientsList()); - } catch (RecipientFormattingException rfe) { } + } catch (RecipientFormattingException rfe) { + Log.w(TAG, "Caught RecipientFormattingException when trying to convert a selected number to a Recipient.", rfe); + } } } return recipients; diff --git a/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java b/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java index 765b71e9cd..aa62c6f650 100644 --- a/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java +++ b/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java @@ -54,7 +54,8 @@ import java.util.HashMap; public class SingleContactSelectionListFragment extends SherlockListFragment implements LoaderManager.LoaderCallbacks { - private final String TAG = "SingleContactSelectionListFragment"; + private final String TAG = SingleContactSelectionListFragment.class.getSimpleName(); + private final HashMap selectedContacts = new HashMap(); private static LayoutInflater li; private OnContactSelectedListener onContactSelectedListener; diff --git a/src/org/thoughtcrime/securesms/components/PushRecipientsPanel.java b/src/org/thoughtcrime/securesms/components/PushRecipientsPanel.java index af3ac2cf18..acea06733a 100644 --- a/src/org/thoughtcrime/securesms/components/PushRecipientsPanel.java +++ b/src/org/thoughtcrime/securesms/components/PushRecipientsPanel.java @@ -50,7 +50,7 @@ import java.util.Set; * @author Moxie Marlinspike */ public class PushRecipientsPanel extends RelativeLayout { - private final String TAG = "PushRecipientsPanel"; + private final String TAG = PushRecipientsPanel.class.getSimpleName(); private RecipientsPanelChangedListener panelChangeListener; private RecipientsEditor recipientsText; diff --git a/src/org/thoughtcrime/securesms/components/SingleRecipientPanel.java b/src/org/thoughtcrime/securesms/components/SingleRecipientPanel.java index 2208dc79b9..0a42832145 100644 --- a/src/org/thoughtcrime/securesms/components/SingleRecipientPanel.java +++ b/src/org/thoughtcrime/securesms/components/SingleRecipientPanel.java @@ -45,7 +45,7 @@ import java.util.List; * @author Moxie Marlinspike */ public class SingleRecipientPanel extends RelativeLayout { - private final String TAG = "SingleRecipientsPanel"; + private final String TAG = SingleRecipientPanel.class.getSimpleName(); private RecipientsPanelChangedListener panelChangeListener; private RecipientsEditor recipientsText; diff --git a/src/org/thoughtcrime/securesms/crypto/DecryptingPartInputStream.java b/src/org/thoughtcrime/securesms/crypto/DecryptingPartInputStream.java index dc23d84f26..b81ffe23e3 100644 --- a/src/org/thoughtcrime/securesms/crypto/DecryptingPartInputStream.java +++ b/src/org/thoughtcrime/securesms/crypto/DecryptingPartInputStream.java @@ -103,11 +103,11 @@ public class DecryptingPartInputStream extends FileInputStream { try { int flourish = cipher.doFinal(buffer, offset); // mac.update(buffer, offset, flourish); - + byte[] ourMac = mac.doFinal(); byte[] theirMac = new byte[mac.getMacLength()]; readFully(theirMac); - + if (!Arrays.equals(ourMac, theirMac)) throw new IOException("MAC doesn't match! Potential tampering?"); @@ -175,7 +175,7 @@ public class DecryptingPartInputStream extends FileInputStream { return readLength; } catch (ShortBufferException e) { throw new AssertionError(e); - } + } } private Mac initializeMac(SecretKeySpec key) throws NoSuchAlgorithmException, InvalidKeyException { @@ -214,6 +214,4 @@ public class DecryptingPartInputStream extends FileInputStream { else return; } } - - } diff --git a/src/org/thoughtcrime/securesms/recipients/Recipient.java b/src/org/thoughtcrime/securesms/recipients/Recipient.java index a63aa235d3..4b521b5d76 100644 --- a/src/org/thoughtcrime/securesms/recipients/Recipient.java +++ b/src/org/thoughtcrime/securesms/recipients/Recipient.java @@ -34,7 +34,7 @@ import java.util.HashSet; public class Recipient implements Parcelable, CanonicalRecipient { - private final static String TAG = "Recipient"; + private final static String TAG = Recipient.class.getSimpleName(); public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public Recipient createFromParcel(Parcel in) {