Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Feb 5, 2025
1 parent 5a12b0b commit dd40f32
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 208 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,8 @@ jobs:
# TCHAP stay on current branch
# with:
# https://github.com/actions/checkout/issues/881
<<<<<<< HEAD
# ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Use JDK 17
=======
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Use JDK 21
>>>>>>> v1.6.30
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<<<<<<< HEAD
# Tchap Android
=======
[![Latest build](https://github.com/element-hq/element-android/actions/workflows/build.yml/badge.svg?query=branch%3Adevelop)](https://github.com/element-hq/element-android/actions/workflows/build.yml?query=branch%3Adevelop)
[![Weblate](https://translate.element.io/widgets/element-android/-/svg-badge.svg)](https://translate.element.io/engage/element-android/?utm_source=widget)
[![Element Android Matrix room #element-android:matrix.org](https://img.shields.io/matrix/element-android:matrix.org.svg?label=%23element-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#element-android:matrix.org)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=element-android&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=element-android)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=element-android&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=element-android)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=element-android&metric=bugs)](https://sonarcloud.io/summary/new_code?id=element-android)
>>>>>>> v1.6.30

Tchap Android is an Android Matrix Client provided by [DINUM](https://tchap.numerique.gouv.fr/). The app can be run on every Android devices with Android OS Lollipop and more (API 21).

Expand Down
10 changes: 1 addition & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,11 @@ sonar {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectVersion", project(":vector").android.defaultConfig.versionName
property "sonar.sourceEncoding", "UTF-8"
<<<<<<< HEAD
property "sonar.links.homepage", "https://github.com/tchapgouv/tchap-android/"
property "sonar.links.ci", "https://github.com/tchapgouv/tchap-android/actions"
property "sonar.links.scm", "https://github.com/tchapgouv/tchap-android/"
property "sonar.links.issue", "https://github.com/tchapgouv/tchap-android/issues"
property "sonar.organization", "new_vector_ltd_organization"
=======
property "sonar.links.homepage", "https://github.com/element-hq/element-android/"
property "sonar.links.ci", "https://github.com/element-hq/element-android/actions"
property "sonar.links.scm", "https://github.com/element-hq/element-android/"
property "sonar.links.issue", "https://github.com/element-hq/element-android/issues"
property "sonar.organization", "element-hq"
>>>>>>> v1.6.30
property "sonar.organization", "tchapgouv"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/jacoco/generateCoverageReport/generateCoverageReport.xml"
property "sonar.login", project.hasProperty("SONAR_LOGIN") ? SONAR_LOGIN : "invalid"
Expand Down
10 changes: 1 addition & 9 deletions library/external/realmfieldnameshelper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

apply plugin: 'kotlin'
apply plugin: 'java'

sourceCompatibility = versions.sourceCompat
targetCompatibility = versions.targetCompat

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}
targetCompatibility = versions.sourceCompat

dependencies {
implementation 'com.squareup:javapoet:1.13.0'
Expand Down
11 changes: 3 additions & 8 deletions library/ui-strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,6 @@
<string name="audio_call_with_participant">Appel audio avec %s</string>
<string name="video_call_with_participant">Appel vidéo avec %s</string>
<string name="call_ringing">Appel en cours…</string>
<string name="microphone_in_use_title">Microphone en cours d’utilisation</string>
<string name="spaces">Espaces</string>
<string name="a11y_stop_voice_message">Arrêter l’enregistrement</string>
<string name="space_add_space_to_any_space_you_manage">Ajouter un espace à un espace que vous gérez.</string>
Expand Down Expand Up @@ -2961,25 +2960,21 @@
<string name="crosssigning_verify_after_update">Application mise-à-jour</string>
<string name="sign_out_anyway">Se déconnecter malgré tout</string>
<string name="sign_out_failed_dialog_message">Impossible de joindre le serveur d’accueil. Si vous vous déconnectez malgré tout, cet appareil ne sera pas effacé de la liste de vos appareils, vous pourrez l’enlever en utilisant un autre client.</string>
<<<<<<< HEAD
</resources>
=======
<string name="invite_unknown_users_dialog_content">Impossible de trouver les profils pour les identifiants Matrix listés ci-dessous. Voulez-vous quand même les inviter \?
\n
\n%s</string>
<string name="invite_unknown_users_dialog_submit">Inviter quand même</string>
<string name="login_splash_sign_in">Se connecter</string>
<string name="create_room_unknown_users_dialog_content">Impossible de trouver des profils pour les ID Matrix listés ci-dessous. Voulez-vous tout de même débuter une nouvelle conversation \?
<string name="create_room_unknown_users_dialog_content">Impossible de trouver des profils pour les identifiants ci-dessous. Voulez-vous tout de même débuter une nouvelle conversation \?
\n
\n%s</string>
\n%s</string> <!-- Tchap: Use custom string -->
<string name="create_room_unknown_users_dialog_submit">Commencer la conversation quand même</string>
<string name="user_reported_as_inappropriate_title">Utilisateur signalé</string>
<string name="message_report_user">Signaler l’utilisateur</string>
<string name="user_reported_as_inappropriate_content">Ce contenu a été signalé.
\n
\nSi vous ne voulez plus voir de contenu de cet utilisateur, vous pouvez l’ignorer pour masquer ses messages.</string>
<string name="call_unsupported">Appel non pris en charge</string>
<string name="call_unsupported_matrix_rtc_call">Appel non pris en charge. La nouvelle application Element X est nécessaire pour rejoindre cet appel.</string>
<string name="call_unsupported_matrix_rtc_call">Appel non pris en charge.</string> <!-- Tchap: Use custom string -->
<string name="microphone_in_use_title">Microphone en service</string>
</resources>
>>>>>>> v1.6.30
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,17 @@ import dagger.Lazy
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.auth.UserInteractiveAuthInterceptor
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.api.failure.MatrixError
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupLastVersionResult
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersion
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersionResult
import org.matrix.android.sdk.api.session.crypto.model.GossipingToDeviceObject
import org.matrix.android.sdk.api.session.crypto.model.MXUsersDevicesMap
import org.matrix.android.sdk.api.session.events.model.Content
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.uia.UiaResult
import org.matrix.android.sdk.internal.auth.registration.handleUIA
import org.matrix.android.sdk.internal.crypto.OlmMachine
import org.matrix.android.sdk.internal.crypto.PerSessionBackupQueryRateLimiter
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.BackupKeysResult
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.CreateKeysBackupVersionBody
import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysBackupData
Expand All @@ -59,7 +53,6 @@ import org.matrix.android.sdk.internal.crypto.model.rest.KeysUploadBody
import org.matrix.android.sdk.internal.crypto.model.rest.KeysUploadResponse
import org.matrix.android.sdk.internal.crypto.model.rest.RestKeyInfo
import org.matrix.android.sdk.internal.crypto.model.rest.SignatureUploadResponse
import org.matrix.android.sdk.internal.crypto.store.IMXCommonCryptoStore
import org.matrix.android.sdk.internal.crypto.tasks.ClaimOneTimeKeysForUsersDeviceTask
import org.matrix.android.sdk.internal.crypto.tasks.DefaultSendVerificationMessageTask
import org.matrix.android.sdk.internal.crypto.tasks.DownloadKeysForUsersTask
Expand Down Expand Up @@ -102,10 +95,10 @@ internal class RequestSender @Inject constructor(
private val getRoomSessionDataTask: GetRoomSessionDataTask,
private val moshi: Moshi,
cryptoCoroutineScope: CoroutineScope,
private val rateLimiter: PerSessionBackupQueryRateLimiter,
private val cryptoStore: IMXCommonCryptoStore,
// private val rateLimiter: PerSessionBackupQueryRateLimiter,
// private val cryptoStore: IMXCommonCryptoStore,
private val localEchoRepository: LocalEchoRepository,
private val olmMachine: Lazy<OlmMachine>
// private val olmMachine: Lazy<OlmMachine>
) {

private val scope = CoroutineScope(
Expand Down Expand Up @@ -249,40 +242,40 @@ internal class RequestSender @Inject constructor(
.adapter<Map<String, Map<String, Any>>>(Map::class.java)
val jsonBody = adapter.fromJson(body)!!

if (eventType == EventType.ROOM_KEY_REQUEST) {
scope.launch {
Timber.v("Intercepting key request, try backup")
/**
* It's a bit hacky, check how this can be better integrated with rust?
*/
try {
jsonBody.forEach { (_, deviceToContent) ->
deviceToContent.forEach { (_, content) ->
val hashMap = content as? Map<*, *>
val action = hashMap?.get("action")?.toString()
if (GossipingToDeviceObject.ACTION_SHARE_REQUEST == action) {
val requestBody = hashMap["body"] as? Map<*, *>
val roomId = requestBody?.get("room_id") as? String
val sessionId = requestBody?.get("session_id") as? String
val senderKey = requestBody?.get("sender_key") as? String
if (roomId != null && sessionId != null) {
// try to perform a lazy migration from legacy store
val legacy = tryOrNull("Failed to access legacy crypto store") {
cryptoStore.getInboundGroupSession(sessionId, senderKey.orEmpty())
}
if (legacy == null || olmMachine.get().importRoomKey(legacy).isFailure) {
rateLimiter.tryFromBackupIfPossible(sessionId, roomId)
}
}
}
}
}
Timber.v("Intercepting key request, try backup")
} catch (failure: Throwable) {
Timber.v(failure, "Failed to use backup")
}
}
}
// if (eventType == EventType.ROOM_KEY_REQUEST) {
// scope.launch {
// Timber.v("Intercepting key request, try backup")
// /**
// * It's a bit hacky, check how this can be better integrated with rust?
// */
// try {
// jsonBody.forEach { (_, deviceToContent) ->
// deviceToContent.forEach { (_, content) ->
// val hashMap = content as? Map<*, *>
// val action = hashMap?.get("action")?.toString()
// if (GossipingToDeviceObject.ACTION_SHARE_REQUEST == action) {
// val requestBody = hashMap["body"] as? Map<*, *>
// val roomId = requestBody?.get("room_id") as? String
// val sessionId = requestBody?.get("session_id") as? String
// val senderKey = requestBody?.get("sender_key") as? String
// if (roomId != null && sessionId != null) {
// // try to perform a lazy migration from legacy store
// val legacy = tryOrNull("Failed to access legacy crypto store") {
// cryptoStore.getInboundGroupSession(sessionId, senderKey.orEmpty())
// }
// if (legacy == null || olmMachine.get().importRoomKey(legacy).isFailure) {
// rateLimiter.tryFromBackupIfPossible(sessionId, roomId)
// }
// }
// }
// }
// }
// Timber.v("Intercepting key request, try backup")
// } catch (failure: Throwable) {
// Timber.v(failure, "Failed to use backup")
// }
// }
// }

val userMap = MXUsersDevicesMap<Any>()
userMap.join(jsonBody)
Expand Down
4 changes: 0 additions & 4 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ ext.versionMinor = 16
// Note: even values are reserved for regular release, odd values for hotfix release.
// When creating a hotfix, you should decrease the value, since the current value
// is the value for the next regular release.
<<<<<<< HEAD
ext.versionPatch = 0
=======
ext.versionPatch = 30
>>>>>>> v1.6.30

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down
5 changes: 1 addition & 4 deletions vector-app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
-dontwarn org.commonmark.ext.gfm.strikethrough.Strikethrough
-dontwarn org.mozilla.javascript.**
-dontwarn org.slf4j.**
<<<<<<< HEAD
-dontwarn org.jspecify.annotations.NullMarked

# TCHAP guava rules
-dontwarn com.google.j2objc.annotations.**
Expand All @@ -104,6 +104,3 @@
-dontwarn java.lang.reflect.AnnotatedType
-dontwarn jdk.javadoc.doclet.**
-dontwarn org.checkerframework.**
=======
-dontwarn org.jspecify.annotations.NullMarked
>>>>>>> v1.6.30
6 changes: 1 addition & 5 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,7 @@ dependencies {
// WebRTC
withdmvoipImplementation('com.github.tchapgouv:webrtc:124.2.0')
// Jitsi
<<<<<<< HEAD
withvoipApi('org.jitsi.react:jitsi-meet-sdk:8.1.1') {
=======
api('org.jitsi.react:jitsi-meet-sdk:10.2.0') {
>>>>>>> v1.6.30
withvoipApi('org.jitsi.react:jitsi-meet-sdk:10.2.0') {
exclude group: 'com.google.firebase'
exclude group: 'com.google.android.gms'
exclude group: 'com.android.installreferrer'
Expand Down
10 changes: 2 additions & 8 deletions vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,11 @@
<!-- Matching asset file: https://develop.element.io/.well-known/assetlinks.json -->
<!-- <data android:host="develop.element.io" />-->
<!-- Matching asset file: https://staging.element.io/.well-known/assetlinks.json -->
<<<<<<< HEAD
<!-- <data android:host="staging.element.io" />-->
<!-- Fix it https://github.com/element-hq/element-android/issues/8904 -->
<!-- <data android:host="mobile.element.io" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
=======
<data android:host="staging.element.io" />
<!-- Fix it https://github.com/element-hq/element-android/issues/8904 -->
<data android:host="mobile.element.io" />
</intent-filter>
</activity>
>>>>>>> v1.6.30

<!-- Activity alias for matrix.to or element permalinks -->
<!-- exported="true" is required to handle android.intent.action.VIEW for URL redirection-->
Expand Down
6 changes: 0 additions & 6 deletions vector/src/main/java/im/vector/app/features/VectorFeatures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ class DefaultVectorFeatures @Inject constructor(
override fun isLocationSharingEnabled() = Config.ENABLE_LOCATION_SHARING
override fun forceUsageOfOpusEncoder(): Boolean = false
override fun isNewAppLayoutFeatureEnabled(): Boolean = true
<<<<<<< HEAD
override fun isQrCodeLoginEnabled(): Boolean = false // TCHAP disable QrCode login for now
override fun isQrCodeLoginForAllServers(): Boolean = false
override fun isReciprocateQrCodeLogin(): Boolean = false
=======
>>>>>>> v1.6.30
override fun isVoiceBroadcastEnabled(): Boolean = true
override fun isUnverifiedSessionsAlertEnabled(): Boolean = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ import com.airbnb.mvrx.MavericksViewModelFactory
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
<<<<<<< HEAD
import fr.gouv.tchap.features.platform.GetPlatformResult
import fr.gouv.tchap.features.platform.Params
import fr.gouv.tchap.features.platform.TchapGetPlatformTask
import im.vector.app.R
=======
import im.vector.app.config.Config
import im.vector.app.config.SunsetConfig
>>>>>>> v1.6.30
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.MavericksAssistedViewModelFactory
import im.vector.app.core.di.hiltMavericksViewModelFactory
Expand Down Expand Up @@ -127,35 +124,9 @@ class OnboardingViewModel @AssistedInject constructor(
}
}

<<<<<<< HEAD
private fun checkQrCodeLoginCapability() {
if (!vectorFeatures.isQrCodeLoginEnabled()) {
setState {
copy(
canLoginWithQrCode = false
)
}
} else if (vectorFeatures.isQrCodeLoginForAllServers()) {
// allow for all servers
setState {
copy(
canLoginWithQrCode = true
)
}
} else {
setState {
copy(
canLoginWithQrCode = selectedHomeserver.isLoginWithQrSupported
)
}
}
}

// TCHAP
private var currentHomeServerConnectionConfig: HomeServerConnectionConfig? = null

=======
>>>>>>> v1.6.30
private val matrixOrgUrl = stringProvider.getString(im.vector.app.config.R.string.matrix_org_server_url).ensureTrailingSlash()
private val defaultHomeserverUrl = mdmService.getData(MdmData.DefaultHomeserverUrl, matrixOrgUrl)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ package im.vector.app.features.crypto.keys

import android.net.Uri
import im.vector.app.core.dispatchers.CoroutineDispatchers
import im.vector.app.test.fakes.FakeAuthenticationService
import im.vector.app.test.fakes.FakeContext
import im.vector.app.test.fakes.FakeCryptoService
import im.vector.app.test.fakes.FakeSession
import im.vector.app.test.fakes.FakeStringProvider
import io.mockk.every
import io.mockk.justRun
import io.mockk.mockk
Expand All @@ -31,6 +33,8 @@ class KeysExporterTest {
private val cryptoService = FakeCryptoService()
private val context = FakeContext()
private val keysExporter = KeysExporter(
authenticationService = FakeAuthenticationService(), // TCHAP add policy on the password to export keys
stringProvider = FakeStringProvider().instance, // TCHAP add policy on the password to export keys
session = FakeSession(fakeCryptoService = cryptoService),
context = context.instance,
dispatchers = CoroutineDispatchers(Dispatchers.Unconfined, Dispatchers.Unconfined)
Expand Down
Loading

0 comments on commit dd40f32

Please sign in to comment.