diff --git a/library/assets/whisper.store b/library/res/raw/whisper.store similarity index 100% rename from library/assets/whisper.store rename to library/res/raw/whisper.store diff --git a/library/src/org/whispersystems/textsecure/directory/NumberFilter.java b/library/src/org/whispersystems/textsecure/directory/NumberFilter.java index 0435b34d9d..f59828302f 100644 --- a/library/src/org/whispersystems/textsecure/directory/NumberFilter.java +++ b/library/src/org/whispersystems/textsecure/directory/NumberFilter.java @@ -24,8 +24,6 @@ import com.google.thoughtcrimegson.Gson; import com.google.thoughtcrimegson.JsonParseException; import com.google.thoughtcrimegson.annotations.SerializedName; -import org.whispersystems.textsecure.util.PhoneNumberFormatter; - import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -71,13 +69,12 @@ public class NumberFilter { this.version = version; } - public synchronized boolean containsNumber(String number, String localNumber) { + public synchronized boolean containsNumber(String number) { try { if (bloomFilter == null) return false; else if (number == null || number.length() == 0) return false; - return new BloomFilter(bloomFilter, hashCount) - .contains(PhoneNumberFormatter.formatNumber(number, localNumber)); + return new BloomFilter(bloomFilter, hashCount).contains(number); } catch (IOException ioe) { Log.w("NumberFilter", ioe); return false; diff --git a/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java b/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java index db0abb7dd1..0ad2001d7a 100644 --- a/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java +++ b/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java @@ -6,6 +6,7 @@ import android.util.Base64; import android.util.Log; import com.google.thoughtcrimegson.Gson; +import org.whispersystems.textsecure.R; import org.whispersystems.textsecure.Release; import org.whispersystems.textsecure.directory.DirectoryDescriptor; import org.whispersystems.textsecure.directory.NumberFilter; @@ -191,8 +192,7 @@ public class PushServiceSocket { private TrustManagerFactory initializeTrustManagerFactory(Context context) { try { - AssetManager assetManager = context.getAssets(); - InputStream keyStoreInputStream = assetManager.open("whisper.store"); + InputStream keyStoreInputStream = context.getResources().openRawResource(R.raw.whisper); KeyStore trustStore = KeyStore.getInstance("BKS"); trustStore.load(keyStoreInputStream, "whisper".toCharArray()); diff --git a/src/org/thoughtcrime/securesms/service/RegistrationService.java b/src/org/thoughtcrime/securesms/service/RegistrationService.java index 504be9bfe6..2486f1082e 100644 --- a/src/org/thoughtcrime/securesms/service/RegistrationService.java +++ b/src/org/thoughtcrime/securesms/service/RegistrationService.java @@ -15,8 +15,8 @@ import android.util.Log; import com.google.android.gcm.GCMRegistrar; import org.thoughtcrime.securesms.ApplicationPreferencesActivity; -import org.whispersystems.textsecure.push.GcmIntentService; -import org.whispersystems.textsecure.push.GcmRegistrationTimeoutException; +import org.thoughtcrime.securesms.gcm.GcmIntentService; +import org.thoughtcrime.securesms.gcm.GcmRegistrationTimeoutException; import org.whispersystems.textsecure.push.PushServiceSocket; import org.whispersystems.textsecure.push.RateLimitException; import org.whispersystems.textsecure.util.Util;