Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Tchap comments #1056

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ task generateCoverageReport(type: JacocoReport) {
task unitTestsWithCoverage(type: GradleBuild) {
// the 7.1.3 android gradle plugin has a bug where enableTestCoverage generates invalid coverage
startParameter.projectProperties.coverage = "false"
// Tchap: Specify variant for every module
// TCHAP Specify variant for every module
tasks = [/*':matrix-sdk-android:testDebugUnitTest',*/ ':vector:testGplayBtchapWithdmvoipWithoutpinningDebugUnitTest', ':vector-app:testGplayBtchapWithdmvoipWithoutpinningDebugUnitTest', ':vector-config:testBtchapWithdmvoipDebugUnitTest']
}

Expand Down
2 changes: 1 addition & 1 deletion library/attachment-viewer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
}
}

// Tchap: Add tchap flavors
// TCHAP Add tchap flavors
// The 'target' dimension permits to specify which platform are used
flavorDimensions = ["target"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AudioPicker : Picker<MultiPickerAudioType>() {
* Returns selected audio files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerAudioType> {
// Tchap: Grant permission to access the selected file.
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
selectedUri.toMultiPickerAudioType(context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class FilePicker : Picker<MultiPickerBaseType>() {
* Returns selected files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseType> {
// Tchap: Grant permission to access the selected file.
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
val type = context.contentResolver.getType(selectedUri)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ImagePicker : Picker<MultiPickerImageType>() {
* Returns selected image files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerImageType> {
// Tchap: Grant permission to access the selected file.
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
selectedUri.toMultiPickerImageType(context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MediaPicker : Picker<MultiPickerBaseMediaType>() {
* Returns selected image/video files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseMediaType> {
// Tchap: Grant permission to access the selected file.
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
val mimeType = context.contentResolver.getType(selectedUri)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ abstract class Picker<T> {
uriList.forEach {
for (resolveInfo in resInfoList) {
val packageName: String = resolveInfo.activityInfo.packageName
// Tchap: Replace implicit intent by an explicit to fix crash on some devices like Xiaomi.
// TCHAP Replace implicit intent by an explicit to fix crash on some devices like Xiaomi.
try {
context.grantUriPermission(packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION)
} catch (e: Exception) {
Expand Down Expand Up @@ -113,7 +113,7 @@ abstract class Picker<T> {
}
}
}
// Tchap: Grant permission to access the selected file.
// TCHAP Grant permission to access the selected file.
val packageName = context.applicationContext.packageName
return selectedUriList.onEach { context.grantUriPermission(packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class VideoPicker : Picker<MultiPickerVideoType>() {
* Returns selected video files or empty list if user did not select any files.
*/
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerVideoType> {
// Tchap: Grant permission to access the selected file.
// TCHAP Grant permission to access the selected file.
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
selectedUri.toMultiPickerVideoType(context)
}
Expand Down
2 changes: 1 addition & 1 deletion library/ui-styles/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {
}
}

// Tchap: Add tchap flavors
// TCHAP Add tchap flavors
// The 'target' dimension permits to specify which platform are used
flavorDimensions = ["target"]

Expand Down
2 changes: 1 addition & 1 deletion matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ dependencies {
// - https://github.com/square/okhttp/issues/3278
// - https://github.com/square/okhttp/issues/4455
// - https://github.com/square/okhttp/issues/3146
// Tchap: Use api instead of implementation to share these dependencies with the other modules
// TCHAP Use api instead of implementation to share these dependencies with the other modules
api(platform("com.squareup.okhttp3:okhttp-bom:4.10.0"))
api 'com.squareup.okhttp3:okhttp'
api 'com.squareup.okhttp3:logging-interceptor'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CommonTestHelper internal constructor(context: Context, val cryptoConfig:
applicationFlavor = "TestFlavor",
roomDisplayNameFallbackProvider = TestRoomDisplayNameFallbackProvider(),
syncConfig = SyncConfig(longPollTimeout = 5_000L),
// Tchap: Do not limit here key requests to my devices to unblock crypto tests
// TCHAP Do not limit here key requests to my devices to unblock crypto tests
cryptoConfig = MXCryptoConfig(limitRoomKeyRequestsToMyDevices = false),
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RealmSessionStoreMigration43Test {
realm?.close()
}

// Tchap: Use custom realm database
// TCHAP Use custom realm database
@Test
fun migrationShouldBeNeeed() {
val realmName = "tchap_session_41.realm"
Expand All @@ -76,7 +76,7 @@ class RealmSessionStoreMigration43Test {
}
}

// Tchap: Use custom realm database
// TCHAP Use custom realm database
// Database key for alias `session_db_feb3823dd11e8b4b0b19d5d1d9e3b864`: 2948ff8106ad80ca8aeba7ef59775075258d8805f9f6eb306add6c3097154bf5c99bbc965931a29e4512f0b3981d3a562c4c86b860846bac2312e1ab61026762
// $167541532417nKwjC:agent2.tchap.incubateur.net
// $167541543920SxkBP:agent2.tchap.incubateur.net
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SessionSanityMigrationTest {
realm?.close()
}

// Tchap: use custom realm database
// TCHAP use custom realm database
@Test
fun sessionDatabaseShouldMigrateGracefully() {
val realmName = "tchap_session_41.realm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class TimelineForwardPaginationTest : InstrumentedTest {
snapshot.groupingBy { it -> it.root.type }.eachCountTo(snapshotTypes)
// Some state events on room creation
assertEquals("m.room.name", 1, snapshotTypes.remove("m.room.name"))
// Tchap: guest_access don't used (TimelineDisplayableEvents.kt)
// TCHAP guest_access don't used (TimelineDisplayableEvents.kt)
// assertEquals("m.room.guest_access", 1, snapshotTypes.remove("m.room.guest_access"))
assertEquals("m.room.history_visibility", 1, snapshotTypes.remove("m.room.history_visibility"))
assertEquals("m.room.join_rules", 1, snapshotTypes.remove("m.room.join_rules"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ internal class DefaultRegistrationWizard(
private suspend fun sendThreePid(threePid: RegisterThreePid): RegistrationResult {
val safeSession = pendingSessionData.currentSession ?: throw IllegalStateException("developer error, call createAccount() method first")

// Tchap: add a specific nextLink requires by Tchap registration process.
// TCHAP add a specific nextLink requires by Tchap registration process.
val hsUri = pendingSessionData.homeServerConnectionConfig.homeServerUri
val isUri = pendingSessionData.homeServerConnectionConfig.identityServerUri
val nextLink = "$hsUri#/register?client_secret=${pendingSessionData.clientSecret}" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package org.matrix.android.sdk.internal.session

import dagger.BindsInstance
import dagger.Component
import fr.gouv.tchap.android.sdk.internal.auth.TchapAccountValidityModule // Tchap: forgotten module in Element. Made Variant with RustCrypto to fail.
import fr.gouv.tchap.android.sdk.internal.auth.TchapAccountValidityModule // TCHAP forgotten module in Element. Made Variant with RustCrypto to fail.
import org.matrix.android.sdk.api.MatrixCoroutineDispatchers
import org.matrix.android.sdk.api.auth.data.SessionParams
import org.matrix.android.sdk.api.securestorage.SecureStorageModule
Expand Down Expand Up @@ -70,7 +70,7 @@ import org.matrix.android.sdk.internal.util.system.SystemModule
@Component(
dependencies = [MatrixComponent::class],
modules = [
TchapAccountValidityModule::class, // Tchap: forgotten module in Element. Made Variant with RustCrypto to fail.
TchapAccountValidityModule::class, // TCHAP forgotten module in Element. Made Variant with RustCrypto to fail.
SessionModule::class,
RoomModule::class,
SyncModule::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
.also {
Timber.e("## Send: Work cancelled by user")

// Tchap: Revoke read permission to the local file.
// TCHAP Revoke read permission to the local file.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.revokeUriPermission(context.packageName, params.attachment.queryUri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
} else {
Expand Down Expand Up @@ -408,7 +408,7 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
return Result.success(WorkerParamsFactory.toData(sendParams)).also {
Timber.v("## handleSuccess $attachmentUrl, work is stopped $isStopped")

// Tchap: Revoke read permission to the local file.
// TCHAP Revoke read permission to the local file.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.revokeUriPermission(context.packageName, params.attachment.queryUri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ internal class RoomSummaryDataSource @Inject constructor(
RoomCategoryFilter.ONLY_ROOMS -> query.equalTo(RoomSummaryEntityFields.IS_DIRECT, false)
RoomCategoryFilter.ONLY_WITH_NOTIFICATIONS -> query.greaterThan(RoomSummaryEntityFields.NOTIFICATION_COUNT, 0)
RoomCategoryFilter.ALL -> {
// Tchap: we ignore DMs with directUserId different from a matrix id.
// TCHAP we ignore DMs with directUserId different from a matrix id.
// directUserId could be an email if the user has no account and he was invited by email.
query.beginGroup()
query.beginGroup()
Expand Down
2 changes: 1 addition & 1 deletion tools/danger/dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if (github.requested_reviewers.users.length == 0 && !pr.draft) {
}

// Check that translations have not been modified by developers
// Tchap: deactivate translation file checking.
// TCHAP deactivate translation file checking.
//if (user != "RiotTranslateBot") {
// if (editedFiles.some(file => file.endsWith("strings.xml") && !file.endsWith("values/strings.xml"))) {
// fail("Some translation files have been edited. Only user `RiotTranslateBot` (i.e. translations coming from Weblate) is allowed to do that.\nPlease read more about translations management [in the doc](https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#internationalisation).")
Expand Down
54 changes: 27 additions & 27 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ knit {
exclude '**/build/**'
exclude '**/.gradle/**'
exclude '**/towncrier/template.md'
exclude '**/*_CHANGES.md' // Tchap: Exclude all changes files
exclude '**/*_CHANGES.md' // TCHAP Exclude all changes files
}
}

Expand Down Expand Up @@ -101,7 +101,7 @@ static def gitBranchName() {

// For Google Play build, build on any other branch than main will have a "-dev" suffix
static def getGplayVersionSuffix() {
// Tchap: No suffix for tagged release
// TCHAP No suffix for tagged release
if (gitBranchName() == "main" || gitTag().startsWith("tchap_v")) {
return ""
} else {
Expand All @@ -115,7 +115,7 @@ static def gitTag() {
}

// For F-Droid build, build on a not tagged commit will have a "-dev" suffix
// Tchap: unused
// TCHAP unused
@SuppressWarnings('unused')
static def getFdroidVersionSuffix() {
if (gitTag() == "") {
Expand Down Expand Up @@ -171,13 +171,13 @@ android {

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// Tchap: Disable universalApk
// TCHAP Disable universalApk
// Keep abiFilter for the universalApk
// ndk {
// abiFilters "armeabi-v7a", "x86", 'arm64-v8a', 'x86_64'
// }

// Tchap: Use only en and fr
// TCHAP Use only en and fr
resConfigs "en", "fr"

// Ref: https://developer.android.com/studio/build/configure-apk-splits.html
Expand All @@ -196,15 +196,15 @@ android {
// Specifies a list of ABIs that Gradle should create APKs for.
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"

// Tchap: Disable universalApk
// TCHAP Disable universalApk
// Generate a universal APK that includes all ABIs, so user who install from CI tool can use this one by default.
universalApk false
}
}

applicationVariants.all { variant ->
// assign different version code for each output
// Tchap: Increase the factor from 10 to 100 due to Neo users integration
// TCHAP Increase the factor from 10 to 100 due to Neo users integration
def baseVariantVersion = variant.versionCode * 100
variant.outputs.each { output ->
def baseAbiVersionCode = project.ext.abiVersionCodes.get(output.getFilter(OutputFile.ABI))
Expand Down Expand Up @@ -238,24 +238,24 @@ android {
storeFile file('./signature/debug.keystore')
storePassword 'android'
}
// TODO Tchap: Update
/* nightly {
keyAlias System.env.ELEMENT_ANDROID_NIGHTLY_KEYID ?: project.property("signing.element.nightly.keyId")
keyPassword System.env.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD ?: project.property("signing.element.nightly.keyPassword")
storeFile file('./signature/nightly.keystore')
storePassword System.env.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD ?: project.property("signing.element.nightly.storePassword")
}
release {
keyAlias project.property("signing.element.keyId")
keyPassword project.property("signing.element.keyPassword")
storeFile file(project.property("signing.element.storePath"))
storePassword project.property("signing.element.storePassword")
} */
// TCHAP no nightly and release signing configurations
// nightly {
// keyAlias System.env.ELEMENT_ANDROID_NIGHTLY_KEYID ?: project.property("signing.element.nightly.keyId")
// keyPassword System.env.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD ?: project.property("signing.element.nightly.keyPassword")
// storeFile file('./signature/nightly.keystore')
// storePassword System.env.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD ?: project.property("signing.element.nightly.storePassword")
// }
// release {
// keyAlias project.property("signing.element.keyId")
// keyPassword project.property("signing.element.keyPassword")
// storeFile file(project.property("signing.element.storePath"))
// storePassword project.property("signing.element.storePassword")
// }
}

buildTypes {
debug {
// Tchap: no debug version
// TCHAP no debug version
// applicationIdSuffix ".debug"
// resValue "string", "app_name", "Element dbg"
// resValue "color", "launcher_background", "#0DBD8B"
Expand All @@ -282,7 +282,7 @@ android {
// signingConfig signingConfigs.release
}

// Tchap: No nightly
// TCHAP no nightly version
// nightly {
// initWith release
// applicationIdSuffix ".nightly"
Expand Down Expand Up @@ -316,7 +316,7 @@ android {
// }
}

// Tchap: no night mode
// TCHAP no nightly version
// sourceSets {
// nightly {
// java.srcDirs += "src/release/java"
Expand Down Expand Up @@ -384,7 +384,7 @@ android {
}
}

// Tchap: Rename unsigned apk
// TCHAP Rename unsigned apk
applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = outputFileName
Expand Down Expand Up @@ -424,7 +424,7 @@ android {
}
}

// Tchap: Use custom configuration for Flipper library
// TCHAP Use custom configuration for Flipper library
configurations {
fdroidBtchapWithvoipWithoutpinningDebugImplementation
fdroidDevTchapWithvoipWithoutpinningDebugImplementation
Expand Down Expand Up @@ -495,15 +495,15 @@ dependencies {
// API-only library
gplayImplementation libs.google.appdistributionApi
// Full SDK implementation
// Tchap: No nightly
// TCHAP No nightly
// nightlyImplementation libs.google.appdistribution

// OSS License, gplay flavor only
gplayImplementation 'com.google.android.gms:play-services-oss-licenses:17.0.1'
kapt libs.dagger.hiltCompiler
ksp libs.airbnb.epoxyProcessor

// Tchap: We had to exclude fbjni for withVoip, the library is already include in jitsi library
// TCHAP We had to exclude fbjni for withVoip, the library is already include in jitsi library
// Flipper, debug builds only
gplayBtchapWithvoipWithpinningDebugImplementation(libs.flipper.flipper) { exclude group: 'com.facebook.fbjni', module: 'fbjni' }
gplayBtchapWithvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin) { exclude group: 'com.facebook.fbjni', module: 'fbjni' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import im.vector.app.waitForView

class OnboardingRobot {

// Tchap: Override default feature values for tests
// TCHAP Override default feature values for tests
private val context = InstrumentationRegistry.getInstrumentation().targetContext
private val defaultVectorFeatures =
DebugVectorFeatures(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DebugJitsiActivity : VectorBaseActivity<ActivityDebugJitsiBinding>() {

@SuppressLint("SetTextI18n")
override fun initUiAndData() {
// Tchap: Jitsi is only available on withvoip flavor, just comment the following lines to remove the dependency
// TCHAP Jitsi is only available on withvoip flavor, just comment the following lines to remove the dependency
// val isCrashReportingDisabled = JitsiMeet.isCrashReportingDisabled(this)
// views.status.text = "Jitsi crash reporting is disabled: $isCrashReportingDisabled"
//
Expand Down
Loading
Loading