Move protos

This commit is contained in:
Niels Andriesse 2021-05-18 09:44:06 +10:00
parent c124f86f6b
commit dc8938c269
52 changed files with 1261 additions and 1279 deletions

View File

@ -12,7 +12,7 @@ import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper;
import org.session.libsignal.utilities.Base64;
import org.session.libsignal.utilities.guava.Optional;
import org.session.libsignal.service.api.messages.SignalServiceEnvelope;
import org.session.libsignal.service.internal.util.Util;
import org.session.libsignal.utilities.Util;
import java.io.IOException;

View File

@ -8,8 +8,8 @@ import org.session.libsignal.crypto.ecc.DjbECPrivateKey
import org.session.libsignal.crypto.ecc.DjbECPublicKey
import org.session.libsignal.crypto.ecc.ECKeyPair
import org.session.libsignal.service.api.messages.SignalServiceGroup
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos.DataMessage
import org.session.libsignal.utilities.removing05PrefixIfNeeded
import org.session.libsignal.utilities.toHexString
import org.thoughtcrime.securesms.database.DatabaseFactory

View File

@ -44,7 +44,7 @@ import org.session.libsession.messaging.sending_receiving.sharecontacts.Contact;
import org.session.libsession.messaging.threads.recipients.Recipient;
import org.session.libsession.utilities.ServiceUtil;
import org.session.libsession.utilities.TextSecurePreferences;
import org.session.libsignal.service.internal.util.Util;
import org.session.libsignal.utilities.Util;
import org.session.libsignal.utilities.Log;
import org.thoughtcrime.securesms.ApplicationContext;
import org.thoughtcrime.securesms.contactshare.ContactUtil;

View File

@ -17,9 +17,9 @@ import org.session.libsignal.streams.AttachmentCipherOutputStream
import org.session.libsignal.service.api.messages.SignalServiceAttachmentStream
import org.session.libsignal.streams.PaddingInputStream
import org.session.libsignal.service.internal.push.PushAttachmentData
import org.session.libsignal.service.internal.push.http.AttachmentCipherOutputStreamFactory
import org.session.libsignal.service.internal.push.http.DigestingRequestBody
import org.session.libsignal.service.internal.util.Util
import org.session.libsignal.streams.AttachmentCipherOutputStreamFactory
import org.session.libsignal.streams.DigestingRequestBody
import org.session.libsignal.utilities.Util
import org.session.libsignal.streams.PlaintextOutputStreamFactory
import org.session.libsignal.utilities.Log

View File

@ -2,7 +2,7 @@ package org.session.libsession.messaging.messages
import com.google.protobuf.ByteString
import org.session.libsession.utilities.GroupUtil
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
abstract class Message {
var id: Long? = null

View File

@ -8,8 +8,8 @@ import org.session.libsession.utilities.GroupUtil
import org.session.libsignal.crypto.ecc.DjbECPrivateKey
import org.session.libsignal.crypto.ecc.DjbECPublicKey
import org.session.libsignal.crypto.ecc.ECKeyPair
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos.DataMessage
import org.session.libsignal.utilities.removing05PrefixIfNeeded
import org.session.libsignal.utilities.toHexString
import org.session.libsignal.utilities.Hex

View File

@ -9,7 +9,7 @@ import org.session.libsession.utilities.preferences.ProfileKeyUtil
import org.session.libsignal.crypto.ecc.DjbECPrivateKey
import org.session.libsignal.crypto.ecc.DjbECPublicKey
import org.session.libsignal.crypto.ecc.ECKeyPair
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.removing05PrefixIfNeeded
import org.session.libsignal.utilities.toHexString
import org.session.libsignal.utilities.Hex

View File

@ -1,6 +1,6 @@
package org.session.libsession.messaging.messages.control
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.Log
class DataExtractionNotification() : ControlMessage() {

View File

@ -3,7 +3,7 @@ package org.session.libsession.messaging.messages.control
import org.session.libsession.messaging.MessagingModuleConfiguration
import org.session.libsession.messaging.messages.visible.VisibleMessage
import org.session.libsignal.utilities.Log
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
class ExpirationTimerUpdate() : ControlMessage() {
/** In the case of a sync message, the public key of the person the message was targeted at.

View File

@ -1,6 +1,6 @@
package org.session.libsession.messaging.messages.control
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.Log
class ReadReceipt() : ControlMessage() {

View File

@ -1,6 +1,6 @@
package org.session.libsession.messaging.messages.control
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.Log
class TypingIndicator() : ControlMessage() {

View File

@ -7,7 +7,7 @@ import org.session.libsession.messaging.sending_receiving.attachments.Attachment
import org.session.libsession.messaging.sending_receiving.attachments.PointerAttachment
import org.session.libsignal.utilities.guava.Optional
import org.session.libsignal.service.api.messages.SignalServiceAttachmentPointer
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import java.io.File
class Attachment {

View File

@ -3,7 +3,7 @@ package org.session.libsession.messaging.messages.visible
import org.session.libsession.messaging.MessagingModuleConfiguration
import org.session.libsession.messaging.sending_receiving.link_preview.LinkPreview as SignalLinkPreiview
import org.session.libsignal.utilities.Log
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
class LinkPreview() {
var title: String? = null

View File

@ -1,6 +1,6 @@
package org.session.libsession.messaging.messages.visible
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.Log
class OpenGroupInvitation() {

View File

@ -2,7 +2,7 @@ package org.session.libsession.messaging.messages.visible
import com.google.protobuf.ByteString
import org.session.libsignal.utilities.Log
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
class Profile() {
var displayName: String? = null

View File

@ -5,7 +5,7 @@ import org.session.libsession.messaging.MessagingModuleConfiguration
import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAttachment
import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel as SignalQuote
import org.session.libsignal.utilities.Log
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
class Quote() {
var timestamp: Long? = 0

View File

@ -7,7 +7,7 @@ import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAt
import org.session.libsession.messaging.threads.Address
import org.session.libsession.messaging.threads.recipients.Recipient
import org.session.libsession.utilities.GroupUtil
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.Log
import org.session.libsession.messaging.sending_receiving.attachments.Attachment as SignalAttachment

View File

@ -2,7 +2,7 @@ package org.session.libsession.messaging.open_groups
import org.session.libsession.messaging.MessagingModuleConfiguration
import org.session.libsignal.service.internal.push.PushTransportDetails
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.Base64
import org.session.libsignal.utilities.Base64.decode
import org.session.libsignal.utilities.Log

View File

@ -6,7 +6,7 @@ import org.session.libsession.messaging.messages.control.*
import org.session.libsession.messaging.messages.visible.VisibleMessage
import org.session.libsession.utilities.GroupUtil
import org.session.libsignal.service.internal.push.PushTransportDetails
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
object MessageReceiver {

View File

@ -22,7 +22,7 @@ import org.session.libsession.snode.SnodeMessage
import org.session.libsession.utilities.GroupUtil
import org.session.libsession.utilities.SSKEnvironment
import org.session.libsignal.service.internal.push.PushTransportDetails
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.hexEncodedPublicKey
import org.session.libsignal.utilities.Base64
import org.session.libsignal.utilities.Log

View File

@ -16,7 +16,7 @@ import org.session.libsignal.crypto.ecc.Curve
import org.session.libsignal.crypto.ecc.ECKeyPair
import org.session.libsignal.utilities.guava.Optional
import org.session.libsignal.service.api.messages.SignalServiceGroup
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.hexEncodedPublicKey
import org.session.libsignal.utilities.removing05PrefixIfNeeded
import org.session.libsignal.utilities.Hex

View File

@ -25,7 +25,7 @@ import org.session.libsignal.crypto.ecc.DjbECPublicKey
import org.session.libsignal.crypto.ecc.ECKeyPair
import org.session.libsignal.utilities.guava.Optional
import org.session.libsignal.service.api.messages.SignalServiceGroup
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.removing05PrefixIfNeeded
import org.session.libsignal.utilities.toHexString
import org.session.libsignal.utilities.Base64

View File

@ -9,7 +9,7 @@ import org.session.libsignal.utilities.guava.Optional;
import org.session.libsignal.service.api.messages.SignalServiceAttachment;
import org.session.libsignal.service.api.messages.SignalServiceDataMessage;
import org.session.libsignal.utilities.Base64;
import org.session.libsignal.service.internal.push.SignalServiceProtos;
import org.session.libsignal.protos.SignalServiceProtos;
import java.util.LinkedList;
import java.util.List;

View File

@ -8,7 +8,7 @@ package org.session.libsession.messaging.sending_receiving.attachments
import android.util.Size
import com.google.protobuf.ByteString
import org.session.libsignal.utilities.guava.Optional
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.service.api.messages.SignalServiceAttachment as SAttachment
import java.io.InputStream
import kotlin.math.round

View File

@ -2,8 +2,6 @@ package org.session.libsession.messaging.sending_receiving.notifications
import android.content.Context
import org.session.libsession.messaging.threads.recipients.Recipient
import org.session.libsignal.service.api.messages.SignalServiceGroup
import org.session.libsignal.service.internal.push.SignalServiceProtos
interface MessageNotifier {
fun setVisibleThread(threadId: Long)

View File

@ -11,7 +11,7 @@ import org.session.libsession.messaging.open_groups.OpenGroupAPI
import org.session.libsession.messaging.open_groups.OpenGroupMessage
import org.session.libsession.messaging.threads.Address
import org.session.libsession.utilities.GroupUtil
import org.session.libsignal.service.internal.push.SignalServiceProtos.*
import org.session.libsignal.protos.SignalServiceProtos.*
import org.session.libsignal.utilities.Log
import org.session.libsignal.utilities.successBackground
import java.util.*

View File

@ -9,7 +9,7 @@ import org.session.libsession.messaging.open_groups.OpenGroupMessageV2
import org.session.libsession.messaging.open_groups.OpenGroupV2
import org.session.libsession.messaging.threads.Address
import org.session.libsession.utilities.GroupUtil
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.Log
import org.session.libsignal.utilities.successBackground
import java.util.concurrent.ScheduledExecutorService

View File

@ -8,7 +8,7 @@ import androidx.annotation.VisibleForTesting
import org.session.libsession.utilities.DelimiterUtil
import org.session.libsession.utilities.GroupUtil
import org.session.libsignal.utilities.guava.Optional
import org.session.libsignal.service.internal.util.Util
import org.session.libsignal.utilities.Util
import java.util.*
import java.util.concurrent.atomic.AtomicReference
import java.util.regex.Matcher

View File

@ -17,13 +17,12 @@ import org.session.libsignal.service.api.push.exceptions.PushNetworkException
import org.session.libsignal.service.api.util.StreamDetails
import org.session.libsignal.service.internal.push.ProfileAvatarData
import org.session.libsignal.service.internal.push.PushAttachmentData
import org.session.libsignal.service.internal.push.http.DigestingRequestBody
import org.session.libsignal.service.internal.push.http.ProfileCipherOutputStreamFactory
import org.session.libsignal.streams.DigestingRequestBody
import org.session.libsignal.streams.ProfileCipherOutputStreamFactory
import org.session.libsignal.utilities.Hex
import org.session.libsignal.utilities.JsonUtil
import org.session.libsignal.utilities.HTTP
import org.session.libsignal.utilities.*
import org.session.libsignal.utilities.*
import org.session.libsignal.utilities.Base64
import org.session.libsignal.utilities.Log
import java.util.*
@ -210,7 +209,7 @@ open class DotNetAPI {
fun uploadProfilePicture(server: String, key: ByteArray, profilePicture: StreamDetails, setLastProfilePictureUpload: () -> Unit): UploadResult {
val profilePictureUploadData = ProfileAvatarData(profilePicture.stream, ProfileCipherOutputStream.getCiphertextLength(profilePicture.length), profilePicture.contentType, ProfileCipherOutputStreamFactory(key))
val file = DigestingRequestBody(profilePictureUploadData.data, profilePictureUploadData.outputStreamFactory,
profilePictureUploadData.contentType, profilePictureUploadData.dataLength, null)
profilePictureUploadData.contentType, profilePictureUploadData.dataLength, null)
val body = MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("type", "network.loki")

View File

@ -2,7 +2,7 @@ package org.session.libsession.messaging.utilities
import com.google.protobuf.ByteString
import org.session.libsignal.utilities.Log
import org.session.libsignal.service.internal.push.SignalServiceProtos.Envelope
import org.session.libsignal.protos.SignalServiceProtos.Envelope
import org.session.libsignal.protos.WebSocketProtos.WebSocketMessage
import org.session.libsignal.protos.WebSocketProtos.WebSocketRequestMessage
import java.security.SecureRandom

View File

@ -8,7 +8,7 @@ import nl.komponents.kovenant.functional.bind
import nl.komponents.kovenant.functional.map
import org.session.libsession.messaging.utilities.MessageWrapper
import org.session.libsession.snode.utilities.getRandomElement
import org.session.libsignal.service.internal.push.SignalServiceProtos
import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.service.loki.Snode
import org.session.libsignal.utilities.HTTP
import org.session.libsignal.service.loki.LokiAPIDatabaseProtocol

View File

@ -2,7 +2,7 @@ package org.session.libsession.utilities
import androidx.annotation.WorkerThread
import org.session.libsignal.utilities.ByteUtil
import org.session.libsignal.service.internal.util.Util
import org.session.libsignal.utilities.Util
import org.session.libsignal.utilities.Hex
import org.whispersystems.curve25519.Curve25519
import javax.crypto.Cipher

View File

@ -8,8 +8,8 @@ import org.session.libsession.messaging.file_server.FileServerAPIV2
import org.session.libsession.utilities.preferences.ProfileKeyUtil
import org.session.libsignal.streams.ProfileCipherOutputStream
import org.session.libsignal.service.internal.push.ProfileAvatarData
import org.session.libsignal.service.internal.push.http.DigestingRequestBody
import org.session.libsignal.service.internal.push.http.ProfileCipherOutputStreamFactory
import org.session.libsignal.streams.DigestingRequestBody
import org.session.libsignal.streams.ProfileCipherOutputStreamFactory
import org.session.libsignal.utilities.retryIfNeeded
import org.session.libsignal.utilities.ThreadUtils
import java.io.ByteArrayInputStream

View File

@ -5,7 +5,6 @@ import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate
import org.session.libsession.messaging.sending_receiving.notifications.MessageNotifier
import org.session.libsession.messaging.threads.Address
import org.session.libsession.messaging.threads.recipients.Recipient
import org.session.libsignal.service.internal.push.SignalServiceProtos
class SSKEnvironment(
val typingIndicators: TypingIndicatorsProtocol,

View File

@ -1,7 +1,7 @@
package org.session.libsignal.crypto
import org.whispersystems.curve25519.Curve25519
import org.session.libsignal.service.internal.util.Util
import org.session.libsignal.utilities.Util
import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec

View File

@ -7,7 +7,7 @@
package org.session.libsignal.service.api.messages;
import org.session.libsignal.utilities.guava.Optional;
import org.session.libsignal.service.internal.push.SignalServiceProtos;
import org.session.libsignal.protos.SignalServiceProtos;
public class SignalServiceContent {
private final String sender;

View File

@ -9,7 +9,7 @@ package org.session.libsignal.service.api.messages;
import org.session.libsignal.utilities.guava.Optional;
import org.session.libsignal.service.api.messages.shared.SharedContact;
import org.session.libsignal.service.api.push.SignalServiceAddress;
import org.session.libsignal.service.internal.push.SignalServiceProtos.DataMessage.ClosedGroupControlMessage;
import org.session.libsignal.protos.SignalServiceProtos.DataMessage.ClosedGroupControlMessage;
import java.util.LinkedList;
import java.util.List;

View File

@ -9,7 +9,7 @@ package org.session.libsignal.service.api.messages;
import com.google.protobuf.ByteString;
import org.session.libsignal.service.api.push.SignalServiceAddress;
import org.session.libsignal.service.internal.push.SignalServiceProtos.Envelope;
import org.session.libsignal.protos.SignalServiceProtos.Envelope;
/**
* This class represents an encrypted Signal Service envelope.

View File

@ -1,7 +1,7 @@
package org.session.libsignal.service.internal.push;
import org.session.libsignal.service.internal.push.http.OutputStreamFactory;
import org.session.libsignal.streams.OutputStreamFactory;
import java.io.InputStream;

View File

@ -7,7 +7,7 @@
package org.session.libsignal.service.internal.push;
import org.session.libsignal.service.api.messages.SignalServiceAttachment.ProgressListener;
import org.session.libsignal.service.internal.push.http.OutputStreamFactory;
import org.session.libsignal.streams.OutputStreamFactory;
import java.io.InputStream;

View File

@ -8,7 +8,7 @@ package org.session.libsignal.streams;
import org.session.libsignal.exceptions.InvalidMacException;
import org.session.libsignal.exceptions.InvalidMessageException;
import org.session.libsignal.service.internal.util.Util;
import org.session.libsignal.utilities.Util;
import java.io.File;
import java.io.FileInputStream;

View File

@ -6,7 +6,7 @@
package org.session.libsignal.streams;
import org.session.libsignal.service.internal.util.Util;
import org.session.libsignal.utilities.Util;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -1,7 +1,4 @@
package org.session.libsignal.service.internal.push.http;
import org.session.libsignal.streams.AttachmentCipherOutputStream;
import org.session.libsignal.streams.DigestingOutputStream;
package org.session.libsignal.streams;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -1,6 +1,6 @@
package org.session.libsignal.streams;
import org.session.libsignal.service.internal.util.Util;
import org.session.libsignal.utilities.Util;
import java.io.FilterInputStream;
import java.io.IOException;

View File

@ -1,7 +1,5 @@
package org.session.libsignal.service.internal.push.http;
package org.session.libsignal.streams;
import org.session.libsignal.streams.DigestingOutputStream;
import org.session.libsignal.service.api.messages.SignalServiceAttachment.ProgressListener;
import java.io.IOException;

View File

@ -1,7 +1,4 @@
package org.session.libsignal.service.internal.push.http;
import org.session.libsignal.streams.DigestingOutputStream;
package org.session.libsignal.streams;
import java.io.IOException;
import java.io.OutputStream;
@ -9,5 +6,4 @@ import java.io.OutputStream;
public interface OutputStreamFactory {
public DigestingOutputStream createFor(OutputStream wrap) throws IOException;
}

View File

@ -1,6 +1,6 @@
package org.session.libsignal.streams;
import org.session.libsignal.service.internal.util.Util;
import org.session.libsignal.utilities.Util;
import java.io.FilterInputStream;
import java.io.IOException;

View File

@ -1,6 +1,5 @@
package org.session.libsignal.streams
import org.session.libsignal.service.internal.push.http.OutputStreamFactory
import java.io.OutputStream
/**

View File

@ -1,6 +1,6 @@
package org.session.libsignal.streams;
import org.session.libsignal.service.internal.util.Util;
import org.session.libsignal.utilities.Util;
import java.io.FilterInputStream;
import java.io.IOException;

View File

@ -1,8 +1,4 @@
package org.session.libsignal.service.internal.push.http;
import org.session.libsignal.streams.DigestingOutputStream;
import org.session.libsignal.streams.ProfileCipherOutputStream;
package org.session.libsignal.streams;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -4,7 +4,7 @@
* Licensed according to the LICENSE file in this repository.
*/
package org.session.libsignal.service.internal.util;
package org.session.libsignal.utilities;
import java.io.ByteArrayOutputStream;
import java.io.IOException;