WIP clean

This commit is contained in:
Ryan ZHAO 2021-01-21 16:12:05 +11:00
parent 106bd4b560
commit 9856814904
3 changed files with 3 additions and 1340 deletions

View File

@ -8,17 +8,11 @@ import com.goterl.lazycode.lazysodium.interfaces.Box
import com.goterl.lazycode.lazysodium.interfaces.Sign import com.goterl.lazycode.lazysodium.interfaces.Sign
import org.session.libsignal.libsignal.ecc.ECKeyPair import org.session.libsignal.libsignal.ecc.ECKeyPair
import org.session.libsignal.libsignal.util.Hex import org.session.libsignal.libsignal.util.Hex
import org.session.libsignal.service.api.messages.SignalServiceEnvelope
import org.session.libsignal.service.internal.push.SignalServiceProtos.Envelope.Type.CLOSED_GROUP_CIPHERTEXT_VALUE
import org.session.libsignal.service.internal.push.SignalServiceProtos.Envelope.Type.UNIDENTIFIED_SENDER_VALUE
import org.session.libsignal.service.loki.api.crypto.SessionProtocol import org.session.libsignal.service.loki.api.crypto.SessionProtocol
import org.session.libsignal.service.loki.utilities.hexEncodedPublicKey import org.session.libsignal.service.loki.utilities.hexEncodedPublicKey
import org.session.libsignal.service.loki.utilities.removing05PrefixIfNeeded import org.session.libsignal.service.loki.utilities.removing05PrefixIfNeeded
import org.session.libsignal.service.loki.utilities.toHexString import org.session.libsignal.service.loki.utilities.toHexString
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil
import org.thoughtcrime.securesms.database.DatabaseFactory
import org.thoughtcrime.securesms.loki.utilities.KeyPairUtilities import org.thoughtcrime.securesms.loki.utilities.KeyPairUtilities
import org.thoughtcrime.securesms.util.TextSecurePreferences
class SessionProtocolImpl(private val context: Context) : SessionProtocol { class SessionProtocolImpl(private val context: Context) : SessionProtocol {

View File

@ -11,27 +11,21 @@ import org.session.libsignal.service.loki.protocol.closedgroups.SharedSenderKeys
class MessagingConfiguration( class MessagingConfiguration(
val context: Context, val context: Context,
val storage: StorageProtocol, val storage: StorageProtocol,
val signalStorage: SignalProtocolStore,
val sskDatabase: SharedSenderKeysDatabaseProtocol, val sskDatabase: SharedSenderKeysDatabaseProtocol,
val messageDataProvider: MessageDataProvider, val messageDataProvider: MessageDataProvider,
val sessionResetImp: SessionResetProtocol, val sessionProtocol: SessionProtocol)
val sessionProtocol: SessionProtocol,
val certificateValidator: CertificateValidator)
{ {
companion object { companion object {
lateinit var shared: MessagingConfiguration lateinit var shared: MessagingConfiguration
fun configure(context: Context, fun configure(context: Context,
storage: StorageProtocol, storage: StorageProtocol,
signalStorage: SignalProtocolStore,
sskDatabase: SharedSenderKeysDatabaseProtocol, sskDatabase: SharedSenderKeysDatabaseProtocol,
messageDataProvider: MessageDataProvider, messageDataProvider: MessageDataProvider,
sessionResetImp: SessionResetProtocol, sessionProtocol: SessionProtocol
sessionProtocol: SessionProtocol,
certificateValidator: CertificateValidator
) { ) {
if (Companion::shared.isInitialized) { return } if (Companion::shared.isInitialized) { return }
shared = MessagingConfiguration(context, storage, signalStorage, sskDatabase, messageDataProvider, sessionResetImp, sessionProtocol, certificateValidator) shared = MessagingConfiguration(context, storage, sskDatabase, messageDataProvider, sessionProtocol)
} }
} }
} }