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 org.session.libsignal.libsignal.ecc.ECKeyPair
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.utilities.hexEncodedPublicKey
import org.session.libsignal.service.loki.utilities.removing05PrefixIfNeeded
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.util.TextSecurePreferences
class SessionProtocolImpl(private val context: Context) : SessionProtocol {

View File

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