Permalink
Browse files

Move directory and push service socket into library.

  • Loading branch information...
1 parent 182d62e commit 29b095b07d2fcc7c773c7b1916a2deb729e6aa82 @moxie0 moxie0 committed Jul 10, 2013
Showing with 49 additions and 51 deletions.
  1. BIN { → library}/assets/whisper.store
  2. +9 −0 library/library.iml
  3. BIN library/libs/thoughtcrimegson-2.1.jar
  4. +1 −1 {src/org/thoughtcrime/securesms → library/src/org/whispersystems/textsecure}/Release.java
  5. +2 −2 ...rg/thoughtcrime/securesms → library/src/org/whispersystems/textsecure}/directory/BloomFilter.java
  6. +1 −1 ...htcrime/securesms → library/src/org/whispersystems/textsecure}/directory/DirectoryDescriptor.java
  7. +2 −5 ...g/thoughtcrime/securesms → library/src/org/whispersystems/textsecure}/directory/NumberFilter.java
  8. +1 −1 ...ughtcrime/securesms/gcm → library/src/org/whispersystems/textsecure/push}/GcmMessageResponse.java
  9. +1 −2 ...ughtcrime/securesms/gcm → library/src/org/whispersystems/textsecure/push}/IncomingGcmMessage.java
  10. +1 −1 ...ughtcrime/securesms/gcm → library/src/org/whispersystems/textsecure/push}/OutgoingGcmMessage.java
  11. +4 −16 ...oughtcrime/securesms/gcm → library/src/org/whispersystems/textsecure/push}/PushServiceSocket.java
  12. +1 −1 ...ughtcrime/securesms/gcm → library/src/org/whispersystems/textsecure/push}/RateLimitException.java
  13. +1 −1 {src/org/thoughtcrime/securesms → library/src/org/whispersystems/textsecure}/util/Conversions.java
  14. +2 −2 src/org/thoughtcrime/securesms/RegistrationProgressActivity.java
  15. +1 −1 src/org/thoughtcrime/securesms/crypto/AsymmetricMasterCipher.java
  16. +1 −1 src/org/thoughtcrime/securesms/crypto/IdentityKeyUtil.java
  17. +1 −1 src/org/thoughtcrime/securesms/crypto/KeyExchangeMessage.java
  18. +1 −1 src/org/thoughtcrime/securesms/crypto/KeyExchangeProcessor.java
  19. +1 −1 src/org/thoughtcrime/securesms/crypto/PublicKey.java
  20. +1 −1 src/org/thoughtcrime/securesms/crypto/SessionCipher.java
  21. +1 −1 src/org/thoughtcrime/securesms/database/keys/Record.java
  22. +1 −1 src/org/thoughtcrime/securesms/database/keys/SessionKey.java
  23. +3 −0 src/org/thoughtcrime/securesms/gcm/GcmIntentService.java
  24. +3 −1 src/org/thoughtcrime/securesms/gcm/OptimizingTransport.java
  25. +1 −1 src/org/thoughtcrime/securesms/mms/MmsCommunication.java
  26. +1 −1 src/org/thoughtcrime/securesms/mms/PngTransport.java
  27. +1 −1 src/org/thoughtcrime/securesms/protocol/Message.java
  28. +4 −4 src/org/thoughtcrime/securesms/service/RegistrationService.java
  29. +1 −1 src/org/thoughtcrime/securesms/sms/IncomingTextMessage.java
  30. +1 −1 src/org/thoughtcrime/securesms/sms/MultipartSmsTransportMessage.java
File renamed without changes.
View
@@ -25,6 +25,15 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/libs/thoughtcrimegson-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
</component>
</module>
Binary file not shown.
@@ -1,4 +1,4 @@
-package org.thoughtcrime.securesms;
+package org.whispersystems.textsecure;
public class Release {
public static final String PUSH_SERVICE_URL = "https://gcm.textsecure.whispersystems.org";
@@ -15,9 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package org.thoughtcrime.securesms.directory;
+package org.whispersystems.textsecure.directory;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
@@ -1,4 +1,4 @@
-package org.thoughtcrime.securesms.directory;
+package org.whispersystems.textsecure.directory;
public class DirectoryDescriptor {
private String version;
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package org.thoughtcrime.securesms.directory;
+package org.whispersystems.textsecure.directory;
import android.content.Context;
import android.util.Log;
@@ -24,7 +24,6 @@
import com.google.thoughtcrimegson.JsonParseException;
import com.google.thoughtcrimegson.annotations.SerializedName;
-import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.textsecure.util.PhoneNumberFormatter;
import java.io.BufferedReader;
@@ -72,13 +71,11 @@ private NumberFilter(Context context, File bloomFilter, long capacity,
this.version = version;
}
- public synchronized boolean containsNumber(String number) {
+ public synchronized boolean containsNumber(String number, String localNumber) {
try {
if (bloomFilter == null) return false;
else if (number == null || number.length() == 0) return false;
- String localNumber = TextSecurePreferences.getLocalNumber(context);
-
return new BloomFilter(bloomFilter, hashCount)
.contains(PhoneNumberFormatter.formatNumber(number, localNumber));
} catch (IOException ioe) {
@@ -1,4 +1,4 @@
-package org.thoughtcrime.securesms.gcm;
+package org.whispersystems.textsecure.push;
import java.util.List;
@@ -1,6 +1,5 @@
-package org.thoughtcrime.securesms.gcm;
+package org.whispersystems.textsecure.push;
-import java.util.LinkedList;
import java.util.List;
public class IncomingGcmMessage {
@@ -1,4 +1,4 @@
-package org.thoughtcrime.securesms.gcm;
+package org.whispersystems.textsecure.push;
import java.util.LinkedList;
import java.util.List;
@@ -1,14 +1,14 @@
-package org.thoughtcrime.securesms.gcm;
+package org.whispersystems.textsecure.push;
import android.content.Context;
import android.content.res.AssetManager;
import android.util.Base64;
import android.util.Log;
import com.google.thoughtcrimegson.Gson;
-import org.thoughtcrime.securesms.Release;
-import org.thoughtcrime.securesms.directory.DirectoryDescriptor;
-import org.thoughtcrime.securesms.directory.NumberFilter;
+import org.whispersystems.textsecure.Release;
+import org.whispersystems.textsecure.directory.DirectoryDescriptor;
+import org.whispersystems.textsecure.directory.NumberFilter;
import org.whispersystems.textsecure.util.Util;
import javax.net.ssl.HttpsURLConnection;
@@ -212,18 +212,6 @@ private TrustManagerFactory initializeTrustManagerFactory(Context context) {
}
}
-
-// private class Verification {
-//
-// private String verificationCode;
-//
-// public Verification() {}
-//
-// public Verification(String verificationCode) {
-// this.verificationCode = verificationCode;
-// }
-// }
-
private class GcmRegistrationId {
private String gcmRegistrationId;
@@ -1,4 +1,4 @@
-package org.thoughtcrime.securesms.gcm;
+package org.whispersystems.textsecure.push;
public class RateLimitException extends Exception {
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package org.thoughtcrime.securesms.util;
+package org.whispersystems.textsecure.util;
public class Conversions {
@@ -29,8 +29,8 @@
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockActivity;
-import org.thoughtcrime.securesms.gcm.PushServiceSocket;
-import org.thoughtcrime.securesms.gcm.RateLimitException;
+import org.whispersystems.textsecure.push.PushServiceSocket;
+import org.whispersystems.textsecure.push.RateLimitException;
import org.thoughtcrime.securesms.service.RegistrationService;
import org.whispersystems.textsecure.util.PhoneNumberFormatter;
import org.whispersystems.textsecure.util.Util;
@@ -27,7 +27,7 @@
import org.bouncycastle.crypto.agreement.ECDHBasicAgreement;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.whispersystems.textsecure.util.Base64;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import org.thoughtcrime.securesms.util.InvalidMessageException;
/**
@@ -32,7 +32,7 @@
import org.thoughtcrime.bouncycastle.asn1.DERSequence;
import org.whispersystems.textsecure.util.Base64;
import org.thoughtcrime.securesms.util.Combiner;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import android.content.Context;
import android.content.SharedPreferences;
@@ -22,7 +22,7 @@
import org.thoughtcrime.securesms.database.keys.LocalKeyRecord;
import org.thoughtcrime.securesms.protocol.Message;
import org.whispersystems.textsecure.util.Base64;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import java.io.IOException;
@@ -30,7 +30,7 @@
import org.thoughtcrime.securesms.service.KeyCachingService;
import org.thoughtcrime.securesms.sms.MessageSender;
import org.thoughtcrime.securesms.sms.OutgoingKeyExchangeMessage;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
/**
* This class processes key exchange interactions.
@@ -21,7 +21,7 @@
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.math.ec.ECPoint;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import org.thoughtcrime.securesms.util.Hex;
import android.util.Log;
@@ -40,7 +40,7 @@
import org.thoughtcrime.securesms.database.keys.SessionRecord;
import org.thoughtcrime.securesms.protocol.Message;
import org.thoughtcrime.securesms.recipients.Recipient;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import android.content.Context;
import android.util.Log;
@@ -18,7 +18,7 @@
import android.content.Context;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import java.io.File;
import java.io.FileInputStream;
@@ -19,7 +19,7 @@
import org.thoughtcrime.securesms.crypto.MasterCipher;
import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.SessionCipher;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import org.thoughtcrime.securesms.util.Util;
import javax.crypto.spec.SecretKeySpec;
@@ -13,6 +13,9 @@
import org.thoughtcrime.securesms.service.SendReceiveService;
import org.thoughtcrime.securesms.sms.IncomingTextMessage;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
+import org.whispersystems.textsecure.push.IncomingGcmMessage;
+import org.whispersystems.textsecure.push.PushServiceSocket;
+import org.whispersystems.textsecure.push.RateLimitException;
import org.whispersystems.textsecure.util.Util;
import java.io.IOException;
@@ -6,8 +6,10 @@
import android.telephony.SmsManager;
import android.util.Log;
-import org.thoughtcrime.securesms.directory.NumberFilter;
+import org.whispersystems.textsecure.directory.NumberFilter;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
+import org.whispersystems.textsecure.push.PushServiceSocket;
+import org.whispersystems.textsecure.push.RateLimitException;
import org.whispersystems.textsecure.util.PhoneNumberFormatter;
import java.io.IOException;
@@ -32,7 +32,7 @@
import org.apache.http.params.HttpProtocolParams;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.service.MmsDownloader;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.textsecure.util.Util;
@@ -26,7 +26,7 @@
import org.thoughtcrime.securesms.crypto.SessionCipher;
import org.thoughtcrime.securesms.crypto.TransportDetails;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import android.util.Log;
@@ -21,7 +21,7 @@
import org.thoughtcrime.securesms.crypto.InvalidKeyException;
import org.thoughtcrime.securesms.crypto.InvalidMessageException;
import org.thoughtcrime.securesms.crypto.PublicKey;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import java.nio.ByteBuffer;
@@ -15,10 +15,10 @@
import com.google.android.gcm.GCMRegistrar;
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
-import org.thoughtcrime.securesms.gcm.GcmIntentService;
-import org.thoughtcrime.securesms.gcm.GcmRegistrationTimeoutException;
-import org.thoughtcrime.securesms.gcm.PushServiceSocket;
-import org.thoughtcrime.securesms.gcm.RateLimitException;
+import org.whispersystems.textsecure.push.GcmIntentService;
+import org.whispersystems.textsecure.push.GcmRegistrationTimeoutException;
+import org.whispersystems.textsecure.push.PushServiceSocket;
+import org.whispersystems.textsecure.push.RateLimitException;
import org.whispersystems.textsecure.util.Util;
import java.io.IOException;
@@ -4,7 +4,7 @@
import android.os.Parcelable;
import android.telephony.SmsMessage;
-import org.thoughtcrime.securesms.gcm.IncomingGcmMessage;
+import org.whispersystems.textsecure.push.IncomingGcmMessage;
import java.util.List;
@@ -6,7 +6,7 @@
import org.thoughtcrime.securesms.protocol.SecureMessageWirePrefix;
import org.thoughtcrime.securesms.protocol.WirePrefix;
import org.whispersystems.textsecure.util.Base64;
-import org.thoughtcrime.securesms.util.Conversions;
+import org.whispersystems.textsecure.util.Conversions;
import java.io.IOException;
import java.util.ArrayList;

0 comments on commit 29b095b

Please sign in to comment.