internal
This commit is contained in:
parent
11236501c4
commit
a479e180ac
@ -24,10 +24,12 @@ import org.matrix.android.sdk.internal.crypto.model.OlmInboundGroupSessionWrappe
|
|||||||
/**
|
/**
|
||||||
* Data class to store result of [KeysBackupTestHelper.createKeysBackupScenarioWithPassword]
|
* Data class to store result of [KeysBackupTestHelper.createKeysBackupScenarioWithPassword]
|
||||||
*/
|
*/
|
||||||
data class KeysBackupScenarioData(val cryptoTestData: CryptoTestData,
|
internal data class KeysBackupScenarioData(
|
||||||
|
val cryptoTestData: CryptoTestData,
|
||||||
val aliceKeys: List<OlmInboundGroupSessionWrapper2>,
|
val aliceKeys: List<OlmInboundGroupSessionWrapper2>,
|
||||||
val prepareKeysBackupDataResult: PrepareKeysBackupDataResult,
|
val prepareKeysBackupDataResult: PrepareKeysBackupDataResult,
|
||||||
val aliceSession2: Session) {
|
val aliceSession2: Session
|
||||||
|
) {
|
||||||
fun cleanUp(testHelper: CommonTestHelper) {
|
fun cleanUp(testHelper: CommonTestHelper) {
|
||||||
cryptoTestData.cleanUp(testHelper)
|
cryptoTestData.cleanUp(testHelper)
|
||||||
testHelper.signOutAndClose(aliceSession2)
|
testHelper.signOutAndClose(aliceSession2)
|
||||||
|
@ -31,7 +31,7 @@ import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupCreation
|
|||||||
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersion
|
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersion
|
||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
|
|
||||||
class KeysBackupTestHelper(
|
internal class KeysBackupTestHelper(
|
||||||
private val testHelper: CommonTestHelper,
|
private val testHelper: CommonTestHelper,
|
||||||
private val cryptoTestHelper: CryptoTestHelper) {
|
private val cryptoTestHelper: CryptoTestHelper) {
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import org.commonmark.node.Text
|
|||||||
import org.commonmark.parser.delimiter.DelimiterProcessor
|
import org.commonmark.parser.delimiter.DelimiterProcessor
|
||||||
import org.commonmark.parser.delimiter.DelimiterRun
|
import org.commonmark.parser.delimiter.DelimiterRun
|
||||||
|
|
||||||
class DollarMathsDelimiterProcessor : DelimiterProcessor {
|
internal class DollarMathsDelimiterProcessor : DelimiterProcessor {
|
||||||
override fun getOpeningCharacter() = '$'
|
override fun getOpeningCharacter() = '$'
|
||||||
|
|
||||||
override fun getClosingCharacter() = '$'
|
override fun getClosingCharacter() = '$'
|
||||||
|
@ -22,7 +22,7 @@ import org.commonmark.renderer.html.HtmlNodeRendererContext
|
|||||||
import org.commonmark.renderer.html.HtmlWriter
|
import org.commonmark.renderer.html.HtmlWriter
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
|
|
||||||
class MathsHtmlNodeRenderer(private val context: HtmlNodeRendererContext) : MathsNodeRenderer() {
|
internal class MathsHtmlNodeRenderer(private val context: HtmlNodeRendererContext) : MathsNodeRenderer() {
|
||||||
private val html: HtmlWriter = context.writer
|
private val html: HtmlWriter = context.writer
|
||||||
override fun render(node: Node) {
|
override fun render(node: Node) {
|
||||||
val display = node.javaClass == DisplayMaths::class.java
|
val display = node.javaClass == DisplayMaths::class.java
|
||||||
|
@ -21,7 +21,7 @@ import org.commonmark.node.Node
|
|||||||
import org.commonmark.renderer.NodeRenderer
|
import org.commonmark.renderer.NodeRenderer
|
||||||
import java.util.HashSet
|
import java.util.HashSet
|
||||||
|
|
||||||
abstract class MathsNodeRenderer : NodeRenderer {
|
internal abstract class MathsNodeRenderer : NodeRenderer {
|
||||||
override fun getNodeTypes(): Set<Class<out Node>> {
|
override fun getNodeTypes(): Set<Class<out Node>> {
|
||||||
val types: MutableSet<Class<out Node>> = HashSet()
|
val types: MutableSet<Class<out Node>> = HashSet()
|
||||||
types.add(InlineMaths::class.java)
|
types.add(InlineMaths::class.java)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.matrix.android.sdk.internal.crypto
|
package org.matrix.android.sdk.internal.crypto
|
||||||
|
|
||||||
interface IncomingShareRequestCommon {
|
internal interface IncomingShareRequestCommon {
|
||||||
/**
|
/**
|
||||||
* The user id
|
* The user id
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,7 @@ import kotlin.math.min
|
|||||||
/**
|
/**
|
||||||
* Utility class to import/export the crypto data
|
* Utility class to import/export the crypto data
|
||||||
*/
|
*/
|
||||||
object MXMegolmExportEncryption {
|
internal object MXMegolmExportEncryption {
|
||||||
private const val HEADER_LINE = "-----BEGIN MEGOLM SESSION DATA-----"
|
private const val HEADER_LINE = "-----BEGIN MEGOLM SESSION DATA-----"
|
||||||
private const val TRAILER_LINE = "-----END MEGOLM SESSION DATA-----"
|
private const val TRAILER_LINE = "-----END MEGOLM SESSION DATA-----"
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import com.squareup.moshi.JsonClass
|
|||||||
* The type of object we use for importing and exporting megolm session data.
|
* The type of object we use for importing and exporting megolm session data.
|
||||||
*/
|
*/
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class MegolmSessionData(
|
internal data class MegolmSessionData(
|
||||||
/**
|
/**
|
||||||
* The algorithm used.
|
* The algorithm used.
|
||||||
*/
|
*/
|
||||||
|
@ -19,7 +19,7 @@ package org.matrix.android.sdk.internal.crypto.model
|
|||||||
import org.matrix.android.sdk.api.util.JsonDict
|
import org.matrix.android.sdk.api.util.JsonDict
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
data class MXKey(
|
internal data class MXKey(
|
||||||
/**
|
/**
|
||||||
* The type of the key (in the example: "signed_curve25519").
|
* The type of the key (in the example: "signed_curve25519").
|
||||||
*/
|
*/
|
||||||
|
@ -19,7 +19,7 @@ package org.matrix.android.sdk.internal.crypto.model
|
|||||||
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
|
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
data class MXOlmSessionResult(
|
internal data class MXOlmSessionResult(
|
||||||
/**
|
/**
|
||||||
* the device
|
* the device
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +26,7 @@ import java.io.Serializable
|
|||||||
* This class adds more context to a OlmInboundGroupSession object.
|
* This class adds more context to a OlmInboundGroupSession object.
|
||||||
* This allows additional checks. The class implements Serializable so that the context can be stored.
|
* This allows additional checks. The class implements Serializable so that the context can be stored.
|
||||||
*/
|
*/
|
||||||
class OlmInboundGroupSessionWrapper : Serializable {
|
internal class OlmInboundGroupSessionWrapper : Serializable {
|
||||||
|
|
||||||
// The associated olm inbound group session.
|
// The associated olm inbound group session.
|
||||||
var olmInboundGroupSession: OlmInboundGroupSession? = null
|
var olmInboundGroupSession: OlmInboundGroupSession? = null
|
||||||
|
@ -26,7 +26,7 @@ import java.io.Serializable
|
|||||||
* This class adds more context to a OlmInboundGroupSession object.
|
* This class adds more context to a OlmInboundGroupSession object.
|
||||||
* This allows additional checks. The class implements Serializable so that the context can be stored.
|
* This allows additional checks. The class implements Serializable so that the context can be stored.
|
||||||
*/
|
*/
|
||||||
class OlmInboundGroupSessionWrapper2 : Serializable {
|
internal class OlmInboundGroupSessionWrapper2 : Serializable {
|
||||||
|
|
||||||
// The associated olm inbound group session.
|
// The associated olm inbound group session.
|
||||||
var olmInboundGroupSession: OlmInboundGroupSession? = null
|
var olmInboundGroupSession: OlmInboundGroupSession? = null
|
||||||
|
@ -22,7 +22,7 @@ import org.matrix.olm.OlmSession
|
|||||||
/**
|
/**
|
||||||
* Encapsulate a OlmSession and a last received message Timestamp
|
* Encapsulate a OlmSession and a last received message Timestamp
|
||||||
*/
|
*/
|
||||||
data class OlmSessionWrapper(
|
internal data class OlmSessionWrapper(
|
||||||
// The associated olm session.
|
// The associated olm session.
|
||||||
val olmSession: OlmSession,
|
val olmSession: OlmSession,
|
||||||
// Timestamp at which the session last received a message.
|
// Timestamp at which the session last received a message.
|
||||||
|
@ -18,7 +18,7 @@ package org.matrix.android.sdk.internal.crypto.model
|
|||||||
|
|
||||||
import org.matrix.olm.OlmOutboundGroupSession
|
import org.matrix.olm.OlmOutboundGroupSession
|
||||||
|
|
||||||
data class OutboundGroupSessionWrapper(
|
internal data class OutboundGroupSessionWrapper(
|
||||||
val outboundGroupSession: OlmOutboundGroupSession,
|
val outboundGroupSession: OlmOutboundGroupSession,
|
||||||
val creationTime: Long
|
val creationTime: Long
|
||||||
)
|
)
|
||||||
|
@ -20,7 +20,7 @@ import com.squareup.moshi.Json
|
|||||||
import com.squareup.moshi.JsonClass
|
import com.squareup.moshi.JsonClass
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class DeviceKeysWithUnsigned(
|
internal data class DeviceKeysWithUnsigned(
|
||||||
/**
|
/**
|
||||||
* Required. The ID of the user the device belongs to. Must match the user ID used when logging in.
|
* Required. The ID of the user the device belongs to. Must match the user ID used when logging in.
|
||||||
*/
|
*/
|
||||||
|
@ -20,7 +20,7 @@ import com.squareup.moshi.Json
|
|||||||
import com.squareup.moshi.JsonClass
|
import com.squareup.moshi.JsonClass
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class EncryptedMessage(
|
internal data class EncryptedMessage(
|
||||||
@Json(name = "algorithm")
|
@Json(name = "algorithm")
|
||||||
val algorithm: String? = null,
|
val algorithm: String? = null,
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import com.squareup.moshi.JsonClass
|
|||||||
import org.matrix.android.sdk.api.session.crypto.model.GossipingToDeviceObject
|
import org.matrix.android.sdk.api.session.crypto.model.GossipingToDeviceObject
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class GossipingDefaultContent(
|
internal data class GossipingDefaultContent(
|
||||||
@Json(name = "action") override val action: String?,
|
@Json(name = "action") override val action: String?,
|
||||||
@Json(name = "requesting_device_id") override val requestingDeviceId: String?,
|
@Json(name = "requesting_device_id") override val requestingDeviceId: String?,
|
||||||
@Json(name = "m.request_id") override val requestId: String? = null
|
@Json(name = "m.request_id") override val requestId: String? = null
|
||||||
|
@ -33,7 +33,7 @@ import javax.inject.Inject
|
|||||||
// value : dict key $UserId
|
// value : dict key $UserId
|
||||||
// value dict key ts
|
// value dict key ts
|
||||||
// dict value ts value
|
// dict value ts value
|
||||||
typealias ReadReceiptContent = Map<String, Map<String, Map<String, Map<String, Double>>>>
|
internal typealias ReadReceiptContent = Map<String, Map<String, Map<String, Map<String, Double>>>>
|
||||||
|
|
||||||
private const val READ_KEY = "m.read"
|
private const val READ_KEY = "m.read"
|
||||||
private const val TIMESTAMP_KEY = "ts"
|
private const val TIMESTAMP_KEY = "ts"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user