Skip to content

Commit

Permalink
Add dmvoip variant
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Dec 6, 2023
1 parent 781ef3e commit 9456bdc
Show file tree
Hide file tree
Showing 28 changed files with 3,885 additions and 31 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [ GplayDevTchapRustCryptoWithoutvoipWithoutpinning, FdroidDevTchapRustCryptoWithoutvoipWithoutpinning, GplayBtchapRustCryptoWithvoipWithpinning ]
target: [ GplayDevTchapRustCryptoWithdmvoipWithoutpinning, FdroidDevTchapRustCryptoWithdmvoipWithoutpinning, GplayBtchapRustCryptoWithvoipWithpinning ]
# Allow all jobs on develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/develop' && format('integration-tests-develop-{0}-{1}', matrix.target, github.sha) || format('build-debug-{0}-{1}', matrix.target, github.ref) }}
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [ GplayBtchapRustCryptoWithoutvoipWithpinning, GplayTchapRustCryptoWithoutvoipWithpinning, FdroidBtchapRustCryptoWithoutvoipWithoutpinning, FdroidTchapRustCryptoWithoutvoipWithoutpinning, GplayBtchapRustCryptoWithvoipWithpinning ]
target: [ GplayBtchapRustCryptoWithdmvoipWithpinning, GplayTchapRustCryptoWithdmvoipWithpinning, FdroidBtchapRustCryptoWithdmvoipWithoutpinning, FdroidTchapRustCryptoWithdmvoipWithoutpinning, GplayBtchapRustCryptoWithvoipWithpinning ]
concurrency:
# Tchap: custom group
group: ${{ github.ref == 'refs/head/main' && format('build-release-apk-main-{0}-{1}', github.sha, matrix.target) || startsWith(github.ref, 'refs/tags/tchap_v') && format('build-release-apk-tag-{0}-{1}', github.sha, matrix.target) }}
Expand Down Expand Up @@ -82,8 +82,8 @@ jobs:
needs: release
env:
# Tchap: only generate exodus report for the following target
TARGET_NAME: "GplayTchapRustCryptoWithoutvoipWithpinning"
TARGET_FOLDER: "gplayTchapRustCryptoWithoutvoipWithpinning"
TARGET_NAME: "GplayTchapRustCryptoWithdmvoipWithpinning"
TARGET_FOLDER: "gplayTchapRustCryptoWithdmvoipWithpinning"
steps:
- name: Obtain apk from artifact
id: download
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ jobs:
- name: Run lint
# Not always, if ktlint or detekt fail, avoid running the long lint check.
run: |
./gradlew vector-app:lintGplayBtchapRustCryptoWithoutvoipWithpinningRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintFdroidBtchapRustCryptoWithoutvoipWithoutpinningRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintGplayBtchapRustCryptoWithdmvoipWithpinningRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintFdroidBtchapRustCryptoWithdmvoipWithoutpinningRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload reports
if: always()
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanity_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
touch emulator.log
chmod 777 emulator.log
adb logcat >> emulator.log &
./gradlew $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false connectedGplayBtchapRustCryptoWithoutvoipWithoutpinningDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || adb pull storage/emulated/0/Pictures/failure_screenshots && exit 1
./gradlew $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false connectedGplayBtchapRustCryptoWithdmvoipWithoutpinningDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || adb pull storage/emulated/0/Pictures/failure_screenshots && exit 1
- name: Upload Test Report Log
uses: actions/upload-artifact@v2
if: always()
Expand Down
76 changes: 62 additions & 14 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -371,21 +371,12 @@ android {
// buildConfigField "String", "FLAVOR_DESCRIPTION", "\"RustCrypto\""
}

withvoip {
dimension "voip"
}

withoutvoip {
dimension "voip"
}
withvoip { dimension "voip" }
withdmvoip { dimension "voip" }
withoutvoip { dimension "voip" }

withpinning {
dimension "pinning"
}

withoutpinning {
dimension "pinning"
}
withpinning { dimension "pinning" }
withoutpinning { dimension "pinning" }

devTchap {
dimension "target"
Expand Down Expand Up @@ -491,6 +482,24 @@ configurations {
gplayBtchapRustCryptoWithoutvoipWithoutpinningDebugImplementation
gplayDevTchapRustCryptoWithoutvoipWithoutpinningDebugImplementation
gplayTchapRustCryptoWithoutvoipWithoutpinningDebugImplementation


fdroidBtchapRustCryptoWithdmvoipWithpinningDebugImplementation
fdroidDevTchapRustCryptoWithdmvoipWithpinningDebugImplementation
fdroidTchapRustCryptoWithdmvoipWithpinningDebugImplementation

gplayBtchapRustCryptoWithdmvoipWithpinningDebugImplementation
gplayDevTchapRustCryptoWithdmvoipWithpinningDebugImplementation
gplayTchapRustCryptoWithdmvoipWithpinningDebugImplementation


fdroidBtchapRustCryptoWithdmvoipWithoutpinningDebugImplementation
fdroidDevTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation
fdroidTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation

gplayBtchapRustCryptoWithdmvoipWithoutpinningDebugImplementation
gplayDevTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation
gplayTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation
}

dependencies {
Expand Down Expand Up @@ -613,6 +622,45 @@ dependencies {
fdroidDevTchapRustCryptoWithoutvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidDevTchapRustCryptoWithoutvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)


gplayBtchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
gplayBtchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
gplayTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayDevTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
gplayDevTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)


fdroidBtchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
fdroidBtchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
fdroidTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidDevTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
fdroidDevTchapRustCryptoWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)


gplayBtchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
gplayBtchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
gplayTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayDevTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
gplayDevTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidBtchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidBtchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidDevTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidDevTchapRustCryptoWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

debugImplementation 'com.facebook.soloader:soloader:0.10.4'
debugImplementation "com.kgurgul.flipper:flipper-realm-android:2.2.0"

Expand Down
8 changes: 3 additions & 5 deletions vector-app/src/main/java/im/vector/app/VectorApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ class VectorApplication :
vectorUncaughtExceptionHandler.activate()

// Remove Log handler statically added by Jitsi
if (vectorFeatures.tchapIsVoipSupported()) {
Timber.forest()
.filter { it::class.java.name == "org.jitsi.meet.sdk.log.JitsiMeetDefaultLogHandler" }
.forEach { Timber.uproot(it) }
}
Timber.forest()
.filter { it::class.java.name == "org.jitsi.meet.sdk.log.JitsiMeetDefaultLogHandler" }
.forEach { Timber.uproot(it) }

if (buildMeta.isDebug) {
Timber.plant(Timber.DebugTree())
Expand Down
1 change: 1 addition & 0 deletions vector-config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android {

productFlavors {
withvoip { dimension "voip" }
withdmvoip { dimension "voip" }
withoutvoip { dimension "voip" }

devTchap { dimension "target" }
Expand Down
4 changes: 4 additions & 0 deletions vector-config/src/withdmvoip/res/values/config-features.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="tchap_is_voip_supported">true</bool>
</resources>
2 changes: 2 additions & 0 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ android {
}

withvoip { dimension "voip" }
withdmvoip { dimension "voip" }
withoutvoip { dimension "voip" }

withpinning { dimension "pinning" }
Expand Down Expand Up @@ -274,6 +275,7 @@ dependencies {
// Tchap: Manage jitsi lib
// WebRTC
withoutvoipImplementation('org.jitsi:webrtc:111.0.1')
withdmvoipImplementation('org.jitsi:webrtc:111.0.1')
// Jitsi
withvoipApi('org.jitsi.react:jitsi-meet-sdk:8.1.1') {
exclude group: 'com.google.firebase'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,11 @@ class TimelineViewModel @AssistedInject constructor(
R.id.invite -> state.canInvite
R.id.open_matrix_apps -> false // Tchap: there are no matrix apps
// Tchap: check if voip is enabled
R.id.voice_call -> vectorFeatures.tchapIsVoipSupported() && (state.isCallOptionAvailable() || state.hasActiveElementCallWidget())
// Tchap: check if voip is enabled
R.id.video_call -> vectorFeatures.tchapIsVoipSupported() &&
(state.isCallOptionAvailable() || state.jitsiState.confId == null || state.jitsiState.hasJoined)
R.id.video_call,
R.id.voice_call -> session.sessionParams.homeServerUrl.contains( "agent.dinum.tchap.gouv.fr") && vectorFeatures.tchapIsVoipSupported()
&& (state.isCallOptionAvailable() || state.hasActiveElementCallWidget())
// Show Join conference button only if there is an active conf id not joined. Otherwise fallback to default video disabled. ^
R.id.join_conference -> !state.isCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined
R.id.join_conference -> vectorFeatures.tchapIsVoipSupported() && !state.isCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined
R.id.search -> state.isSearchAvailable()
R.id.menu_timeline_thread_list -> vectorPreferences.areThreadMessagesEnabled()
R.id.dev_tools -> vectorPreferences.developerMode()
Expand Down
Loading

0 comments on commit 9456bdc

Please sign in to comment.