Put everything under either internal or api.

This commit is contained in:
Moxie Marlinspike
2014-11-12 11:35:54 -08:00
parent 08ed90c5ec
commit fb31319e52
77 changed files with 377 additions and 384 deletions

View File

@@ -1,6 +1,6 @@
package textsecure;
option java_package = "org.whispersystems.textsecure.push";
option java_package = "org.whispersystems.textsecure.internal.push";
option java_outer_classname = "PushMessageProtos";
message IncomingPushMessageSignal {

View File

@@ -1,3 +1,3 @@
all:
protoc --java_out=../src/ IncomingPushMessageSignal.proto
protoc --java_out=../src/main/java/ IncomingPushMessageSignal.proto

View File

@@ -1,7 +1,8 @@
package org.whispersystems.textsecure.push;
import android.test.AndroidTestCase;
import android.util.Base64;
import org.whispersystems.textsecure.internal.push.PushTransportDetails;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

View File

@@ -20,9 +20,9 @@ import org.whispersystems.libaxolotl.IdentityKey;
import org.whispersystems.libaxolotl.state.PreKeyRecord;
import org.whispersystems.libaxolotl.state.SignedPreKeyRecord;
import org.whispersystems.libaxolotl.util.guava.Optional;
import org.whispersystems.textsecure.push.ContactTokenDetails;
import org.whispersystems.textsecure.push.PushServiceSocket;
import org.whispersystems.textsecure.push.SignedPreKeyEntity;
import org.whispersystems.textsecure.api.push.ContactTokenDetails;
import org.whispersystems.textsecure.internal.push.PushServiceSocket;
import org.whispersystems.textsecure.api.push.SignedPreKeyEntity;
import java.io.IOException;
import java.util.List;

View File

@@ -19,7 +19,7 @@ package org.whispersystems.textsecure.api;
import org.whispersystems.libaxolotl.InvalidMessageException;
import org.whispersystems.textsecure.api.crypto.AttachmentCipherInputStream;
import org.whispersystems.textsecure.api.messages.TextSecureAttachmentPointer;
import org.whispersystems.textsecure.push.PushServiceSocket;
import org.whispersystems.textsecure.internal.push.PushServiceSocket;
import java.io.File;
import java.io.IOException;

View File

@@ -32,28 +32,28 @@ import org.whispersystems.textsecure.api.messages.TextSecureAttachment;
import org.whispersystems.textsecure.api.messages.TextSecureAttachmentStream;
import org.whispersystems.textsecure.api.messages.TextSecureGroup;
import org.whispersystems.textsecure.api.messages.TextSecureMessage;
import org.whispersystems.textsecure.push.MismatchedDevices;
import org.whispersystems.textsecure.push.OutgoingPushMessage;
import org.whispersystems.textsecure.push.OutgoingPushMessageList;
import org.whispersystems.textsecure.push.PushAddress;
import org.whispersystems.textsecure.push.PushAttachmentData;
import org.whispersystems.textsecure.push.PushBody;
import org.whispersystems.textsecure.push.PushServiceSocket;
import org.whispersystems.textsecure.push.StaleDevices;
import org.whispersystems.textsecure.push.UnregisteredUserException;
import org.whispersystems.textsecure.push.exceptions.EncapsulatedExceptions;
import org.whispersystems.textsecure.push.exceptions.MismatchedDevicesException;
import org.whispersystems.textsecure.push.exceptions.StaleDevicesException;
import org.whispersystems.textsecure.api.push.PushAddress;
import org.whispersystems.textsecure.internal.push.MismatchedDevices;
import org.whispersystems.textsecure.internal.push.OutgoingPushMessage;
import org.whispersystems.textsecure.internal.push.OutgoingPushMessageList;
import org.whispersystems.textsecure.internal.push.PushAttachmentData;
import org.whispersystems.textsecure.internal.push.PushBody;
import org.whispersystems.textsecure.internal.push.PushServiceSocket;
import org.whispersystems.textsecure.internal.push.StaleDevices;
import org.whispersystems.textsecure.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.textsecure.api.push.exceptions.EncapsulatedExceptions;
import org.whispersystems.textsecure.internal.push.exceptions.MismatchedDevicesException;
import org.whispersystems.textsecure.internal.push.exceptions.StaleDevicesException;
import org.whispersystems.textsecure.internal.util.Util;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import static org.whispersystems.textsecure.push.PushMessageProtos.IncomingPushMessageSignal.Type;
import static org.whispersystems.textsecure.push.PushMessageProtos.PushMessageContent;
import static org.whispersystems.textsecure.push.PushMessageProtos.PushMessageContent.AttachmentPointer;
import static org.whispersystems.textsecure.push.PushMessageProtos.PushMessageContent.GroupContext;
import static org.whispersystems.textsecure.internal.push.PushMessageProtos.IncomingPushMessageSignal.Type;
import static org.whispersystems.textsecure.internal.push.PushMessageProtos.PushMessageContent;
import static org.whispersystems.textsecure.internal.push.PushMessageProtos.PushMessageContent.AttachmentPointer;
import static org.whispersystems.textsecure.internal.push.PushMessageProtos.PushMessageContent.GroupContext;
public class TextSecureMessageSender {

View File

@@ -36,13 +36,13 @@ import org.whispersystems.textsecure.api.messages.TextSecureAttachmentPointer;
import org.whispersystems.textsecure.api.messages.TextSecureEnvelope;
import org.whispersystems.textsecure.api.messages.TextSecureGroup;
import org.whispersystems.textsecure.api.messages.TextSecureMessage;
import org.whispersystems.textsecure.push.PushTransportDetails;
import org.whispersystems.textsecure.internal.push.PushTransportDetails;
import java.util.LinkedList;
import java.util.List;
import static org.whispersystems.textsecure.push.PushMessageProtos.PushMessageContent;
import static org.whispersystems.textsecure.push.PushMessageProtos.PushMessageContent.GroupContext.Type.DELIVER;
import static org.whispersystems.textsecure.internal.push.PushMessageProtos.PushMessageContent;
import static org.whispersystems.textsecure.internal.push.PushMessageProtos.PushMessageContent.GroupContext.Type.DELIVER;
public class TextSecureCipher {

View File

@@ -21,7 +21,7 @@ import android.util.Log;
import com.google.protobuf.ByteString;
import org.whispersystems.libaxolotl.InvalidVersionException;
import org.whispersystems.textsecure.push.PushMessageProtos.IncomingPushMessageSignal;
import org.whispersystems.textsecure.internal.push.PushMessageProtos.IncomingPushMessageSignal;
import org.whispersystems.textsecure.internal.util.Base64;
import org.whispersystems.textsecure.internal.util.Hex;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.api.push;
import com.google.thoughtcrimegson.Gson;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.api.push;
public class PushAddress {

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.api.push;
import com.google.thoughtcrimegson.GsonBuilder;
import com.google.thoughtcrimegson.JsonDeserializationContext;
@@ -11,6 +11,7 @@ import com.google.thoughtcrimegson.JsonSerializer;
import org.whispersystems.libaxolotl.ecc.ECPublicKey;
import org.whispersystems.textsecure.internal.util.Base64;
import org.whispersystems.textsecure.internal.push.PreKeyEntity;
import java.io.IOException;
import java.lang.reflect.Type;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push.exceptions;
package org.whispersystems.textsecure.api.push.exceptions;
public class AuthorizationFailedException extends NonSuccessfulResponseCodeException {
public AuthorizationFailedException(String s) {

View File

@@ -1,7 +1,6 @@
package org.whispersystems.textsecure.push.exceptions;
package org.whispersystems.textsecure.api.push.exceptions;
import org.whispersystems.textsecure.api.crypto.UntrustedIdentityException;
import org.whispersystems.textsecure.push.UnregisteredUserException;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push.exceptions;
package org.whispersystems.textsecure.api.push.exceptions;
public class ExpectationFailedException extends NonSuccessfulResponseCodeException {
}

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push.exceptions;
package org.whispersystems.textsecure.api.push.exceptions;
import java.io.IOException;

View File

@@ -0,0 +1,7 @@
package org.whispersystems.textsecure.api.push.exceptions;
public class NotFoundException extends NonSuccessfulResponseCodeException {
public NotFoundException(String s) {
super(s);
}
}

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push.exceptions;
package org.whispersystems.textsecure.api.push.exceptions;
import java.io.IOException;

View File

@@ -0,0 +1,8 @@
package org.whispersystems.textsecure.api.push.exceptions;
public class RateLimitException extends NonSuccessfulResponseCodeException {
public RateLimitException(String s) {
super(s);
}
}

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.api.push.exceptions;
import java.io.IOException;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
public class AccountAttributes {

View File

@@ -1,4 +1,6 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import org.whispersystems.textsecure.api.push.ContactTokenDetails;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import java.util.List;

View File

@@ -14,9 +14,10 @@
* 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.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import org.whispersystems.textsecure.api.push.PushAddress;
import org.whispersystems.textsecure.internal.util.Base64;
public class OutgoingPushMessage {

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import com.google.thoughtcrimegson.GsonBuilder;
import com.google.thoughtcrimegson.JsonDeserializationContext;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import com.google.thoughtcrimegson.GsonBuilder;
import com.google.thoughtcrimegson.JsonDeserializationContext;

View File

@@ -1,7 +1,9 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import com.google.thoughtcrimegson.GsonBuilder;
import org.whispersystems.textsecure.api.push.SignedPreKeyEntity;
public class PreKeyResponseItem {
private int deviceId;

View File

@@ -1,8 +1,9 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import com.google.thoughtcrimegson.GsonBuilder;
import org.whispersystems.libaxolotl.IdentityKey;
import org.whispersystems.textsecure.api.push.SignedPreKeyEntity;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
public class PreKeyStatus {

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import java.io.InputStream;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import android.os.Parcel;
import android.os.Parcelable;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
public class PushBody {

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import java.util.List;

View File

@@ -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.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import android.util.Log;
@@ -27,17 +27,21 @@ import org.whispersystems.libaxolotl.ecc.ECPublicKey;
import org.whispersystems.libaxolotl.state.PreKeyBundle;
import org.whispersystems.libaxolotl.state.PreKeyRecord;
import org.whispersystems.libaxolotl.state.SignedPreKeyRecord;
import org.whispersystems.textsecure.api.push.PushAddress;
import org.whispersystems.textsecure.api.crypto.AttachmentCipherOutputStream;
import org.whispersystems.textsecure.api.push.ContactTokenDetails;
import org.whispersystems.textsecure.api.push.SignedPreKeyEntity;
import org.whispersystems.textsecure.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.textsecure.internal.push.exceptions.MismatchedDevicesException;
import org.whispersystems.textsecure.internal.push.exceptions.StaleDevicesException;
import org.whispersystems.textsecure.internal.util.Base64;
import org.whispersystems.textsecure.internal.util.Util;
import org.whispersystems.textsecure.push.exceptions.AuthorizationFailedException;
import org.whispersystems.textsecure.push.exceptions.ExpectationFailedException;
import org.whispersystems.textsecure.push.exceptions.MismatchedDevicesException;
import org.whispersystems.textsecure.push.exceptions.NonSuccessfulResponseCodeException;
import org.whispersystems.textsecure.push.exceptions.NotFoundException;
import org.whispersystems.textsecure.push.exceptions.PushNetworkException;
import org.whispersystems.textsecure.push.exceptions.RateLimitException;
import org.whispersystems.textsecure.push.exceptions.StaleDevicesException;
import org.whispersystems.textsecure.api.push.exceptions.AuthorizationFailedException;
import org.whispersystems.textsecure.api.push.exceptions.ExpectationFailedException;
import org.whispersystems.textsecure.api.push.exceptions.NonSuccessfulResponseCodeException;
import org.whispersystems.textsecure.api.push.exceptions.NotFoundException;
import org.whispersystems.textsecure.api.push.exceptions.PushNetworkException;
import org.whispersystems.textsecure.api.push.exceptions.RateLimitException;
import org.whispersystems.textsecure.internal.util.BlacklistingTrustManager;
import java.io.File;

View File

@@ -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.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import android.util.Log;

View File

@@ -1,4 +1,4 @@
package org.whispersystems.textsecure.push;
package org.whispersystems.textsecure.internal.push;
import java.util.List;

View File

@@ -1,6 +1,7 @@
package org.whispersystems.textsecure.push.exceptions;
package org.whispersystems.textsecure.internal.push.exceptions;
import org.whispersystems.textsecure.push.MismatchedDevices;
import org.whispersystems.textsecure.api.push.exceptions.NonSuccessfulResponseCodeException;
import org.whispersystems.textsecure.internal.push.MismatchedDevices;
public class MismatchedDevicesException extends NonSuccessfulResponseCodeException {

View File

@@ -1,7 +1,7 @@
package org.whispersystems.textsecure.push.exceptions;
package org.whispersystems.textsecure.internal.push.exceptions;
import org.whispersystems.textsecure.push.StaleDevices;
import org.whispersystems.textsecure.push.exceptions.NonSuccessfulResponseCodeException;
import org.whispersystems.textsecure.api.push.exceptions.NonSuccessfulResponseCodeException;
import org.whispersystems.textsecure.internal.push.StaleDevices;
public class StaleDevicesException extends NonSuccessfulResponseCodeException {

View File

@@ -1,9 +0,0 @@
package org.whispersystems.textsecure.push.exceptions;
import org.whispersystems.textsecure.push.exceptions.NonSuccessfulResponseCodeException;
public class NotFoundException extends NonSuccessfulResponseCodeException {
public NotFoundException(String s) {
super(s);
}
}

View File

@@ -1,10 +0,0 @@
package org.whispersystems.textsecure.push.exceptions;
import org.whispersystems.textsecure.push.exceptions.NonSuccessfulResponseCodeException;
public class RateLimitException extends NonSuccessfulResponseCodeException {
public RateLimitException(String s) {
super(s);
}
}