From 28cb1ed85b955679a9acc8f14031e70b88fff4a7 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Wed, 12 Nov 2014 09:17:08 -0800 Subject: [PATCH] Move DirectoryUtil up to parent. --- .../securesms/sms/MessageSender.java | 2 +- .../securesms/util/DirectoryHelper.java | 1 - .../securesms}/util/DirectoryUtil.java | 23 +++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) rename {libtextsecure/src/main/java/org/whispersystems/textsecure => src/org/thoughtcrime/securesms}/util/DirectoryUtil.java (51%) diff --git a/src/org/thoughtcrime/securesms/sms/MessageSender.java b/src/org/thoughtcrime/securesms/sms/MessageSender.java index adb4fdc08a..5d46259a09 100644 --- a/src/org/thoughtcrime/securesms/sms/MessageSender.java +++ b/src/org/thoughtcrime/securesms/sms/MessageSender.java @@ -45,7 +45,7 @@ import org.whispersystems.jobqueue.JobManager; import org.whispersystems.libaxolotl.util.guava.Optional; import org.whispersystems.textsecure.api.TextSecureAccountManager; import org.whispersystems.textsecure.push.ContactTokenDetails; -import org.whispersystems.textsecure.util.DirectoryUtil; +import org.thoughtcrime.securesms.util.DirectoryUtil; import org.whispersystems.textsecure.util.InvalidNumberException; import java.io.IOException; diff --git a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java index e8b2004f66..9d54c64b52 100644 --- a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java +++ b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java @@ -11,7 +11,6 @@ import org.thoughtcrime.securesms.push.TextSecureCommunicationFactory; import org.thoughtcrime.securesms.recipients.Recipients; import org.whispersystems.textsecure.api.TextSecureAccountManager; import org.whispersystems.textsecure.push.ContactTokenDetails; -import org.whispersystems.textsecure.util.DirectoryUtil; import org.whispersystems.textsecure.util.InvalidNumberException; import java.util.List; diff --git a/libtextsecure/src/main/java/org/whispersystems/textsecure/util/DirectoryUtil.java b/src/org/thoughtcrime/securesms/util/DirectoryUtil.java similarity index 51% rename from libtextsecure/src/main/java/org/whispersystems/textsecure/util/DirectoryUtil.java rename to src/org/thoughtcrime/securesms/util/DirectoryUtil.java index f5f59330f7..f96e68d147 100644 --- a/libtextsecure/src/main/java/org/whispersystems/textsecure/util/DirectoryUtil.java +++ b/src/org/thoughtcrime/securesms/util/DirectoryUtil.java @@ -1,4 +1,23 @@ -package org.whispersystems.textsecure.util; +/** + * Copyright (C) 2014 Open Whisper Systems + * + * This program 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. + * + * This program 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 this program. If not, see . + */ +package org.thoughtcrime.securesms.util; + + +import org.whispersystems.textsecure.util.Base64; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -11,7 +30,7 @@ public class DirectoryUtil { public static String getDirectoryServerToken(String e164number) { try { MessageDigest digest = MessageDigest.getInstance("SHA1"); - byte[] token = Util.trim(digest.digest(e164number.getBytes()), 10); + byte[] token = org.whispersystems.textsecure.util.Util.trim(digest.digest(e164number.getBytes()), 10); return Base64.encodeBytesWithoutPadding(token); } catch (NoSuchAlgorithmException e) { throw new AssertionError(e);