Added button to do ZRTP SAS validation again

This commit is contained in:
Sylvain Berfini 2024-02-02 11:37:52 +01:00
parent e19e9bfdc7
commit 25ab474fba
4 changed files with 35 additions and 6 deletions

View file

@ -382,5 +382,14 @@ class ActiveCallFragment : GenericCallFragment() {
MediaEncryptionStatisticsDialogFragment.TAG
)
bottomSheetDialog = modalBottomSheet
model.showZrtpSasValidationDialogEvent.observe(viewLifecycleOwner) {
it.consume {
callViewModel.showZrtpSasDialogIfPossible()
modalBottomSheet.dismiss()
bottomSheetDialog = null
}
}
}
}

View file

@ -26,6 +26,7 @@ import org.linphone.core.Call
import org.linphone.core.MediaEncryption
import org.linphone.core.StreamType
import org.linphone.utils.AppUtils
import org.linphone.utils.Event
class CallMediaEncryptionModel @WorkerThread constructor(call: Call) {
val mediaEncryption = MutableLiveData<String>()
@ -37,6 +38,10 @@ class CallMediaEncryptionModel @WorkerThread constructor(call: Call) {
val zrtpAuthTag = MutableLiveData<String>()
val zrtpAuthSas = MutableLiveData<String>()
val showZrtpSasValidationDialogEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
init {
isMediaEncryptionZrtp.postValue(false)
@ -104,4 +109,8 @@ class CallMediaEncryptionModel @WorkerThread constructor(call: Call) {
}
}
}
fun showSasValidationDialog() {
showZrtpSasValidationDialogEvent.value = Event(true)
}
}

View file

@ -11,7 +11,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:background="?attr/color_main2_000">
<androidx.appcompat.widget.AppCompatTextView
style="@style/context_menu_action_label_style"
@ -29,7 +30,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@{model.zrtpCipher}"
android:text="@{model.zrtpCipher, default=@string/call_stats_zrtp_cipher_algo}"
android:textColor="?attr/color_grey_900"
android:gravity="center_vertical"
android:visibility="@{model.isMediaEncryptionZrtp ? View.VISIBLE : View.GONE}"/>
@ -40,7 +41,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@{model.zrtpKeyAgreement}"
android:text="@{model.zrtpKeyAgreement, default=@string/call_stats_zrtp_key_agreement_algo}"
android:textColor="?attr/color_grey_900"
android:gravity="center_vertical"
android:visibility="@{model.isMediaEncryptionZrtp ? View.VISIBLE : View.GONE}" />
@ -51,7 +52,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@{model.zrtpHash}"
android:text="@{model.zrtpHash, default=@string/call_stats_zrtp_hash_algo}"
android:textColor="?attr/color_grey_900"
android:gravity="center_vertical"
android:visibility="@{model.isMediaEncryptionZrtp ? View.VISIBLE : View.GONE}" />
@ -62,7 +63,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@{model.zrtpAuthTag}"
android:text="@{model.zrtpAuthTag, default=@string/call_stats_zrtp_auth_tag_algo}"
android:textColor="?attr/color_grey_900"
android:gravity="center_vertical"
android:visibility="@{model.isMediaEncryptionZrtp ? View.VISIBLE : View.GONE}" />
@ -73,11 +74,20 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@{model.zrtpAuthSas}"
android:text="@{model.zrtpAuthSas, default=@string/call_stats_zrtp_sas_algo}"
android:textColor="?attr/color_grey_900"
android:gravity="center_vertical"
android:visibility="@{model.isMediaEncryptionZrtp ? View.VISIBLE : View.GONE}" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/secondary_button_label_style"
android:onClick="@{() -> model.showSasValidationDialog()}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:text="@string/call_do_zrtp_sas_validation_again"
android:visibility="@{model.isMediaEncryptionZrtp ? View.VISIBLE : View.GONE}"/>
</LinearLayout>
</layout>

View file

@ -516,6 +516,7 @@
<string name="call_state_ended">Ended</string>
<string name="call_zrtp_end_to_end_encrypted">End-to-end encrypted by ZRTP</string>
<string name="call_post_quantum_zrtp_end_to_end_encrypted">End-to-end encrypted by post-quantum ZRTP</string>
<string name="call_do_zrtp_sas_validation_again">Validate ZRTP SAS again</string>
<string name="calls_list_title">Calls list</string>
<string name="call_transfer_title">Transfer call to</string>
<string name="call_remote_is_recording">%s is recording</string>