diff --git a/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt b/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt index 8f6395a20fc..35bcd7786c0 100644 --- a/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt @@ -246,6 +246,11 @@ class UseCaseModule { @CurrentAccount currentAccount: UserId ) = coreLogic.getSessionScope(currentAccount).getPersistentWebSocketStatus + @ViewModelScoped + @Provides + fun provideCheckCrlRevocationListUseCase(@KaliumCoreLogic coreLogic: CoreLogic, @CurrentAccount currentAccount: UserId) = + coreLogic.getSessionScope(currentAccount).checkCrlRevocationList + @ViewModelScoped @Provides fun provideIsMLSEnabledUseCase(@KaliumCoreLogic coreLogic: CoreLogic, @CurrentAccount currentAccount: UserId) = diff --git a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt index 667437dc59c..81027e20b0b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt +++ b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt @@ -59,6 +59,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.E2EIFailure import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.debug.DisableEventProcessingUseCase +import com.wire.kalium.logic.feature.e2ei.CheckCrlRevocationListUseCase import com.wire.kalium.logic.feature.e2ei.usecase.E2EIEnrollmentResult import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountResult import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountUseCase @@ -98,6 +99,7 @@ class DebugDataOptionsViewModel private val mlsKeyPackageCountUseCase: MLSKeyPackageCountUseCase, private val restartSlowSyncProcessForRecovery: RestartSlowSyncProcessForRecoveryUseCase, private val disableEventProcessingUseCase: DisableEventProcessingUseCase, + private val checkCrlRevocationListUseCase: CheckCrlRevocationListUseCase ) : ViewModel() { var state by mutableStateOf( @@ -114,6 +116,14 @@ class DebugDataOptionsViewModel ) } + fun checkCrlRevocationList() { + viewModelScope.launch { + checkCrlRevocationListUseCase( + forceUpdate = true + ) + } + } + fun enableEncryptedProteusStorage(enabled: Boolean) { if (enabled) { viewModelScope.launch { @@ -248,7 +258,8 @@ fun DebugDataOptions( onDisableEventProcessingChange = viewModel::disableEventProcessing, enrollE2EICertificate = viewModel::enrollE2EICertificate, handleE2EIEnrollmentResult = viewModel::handleE2EIEnrollmentResult, - dismissCertificateDialog = viewModel::dismissCertificateDialog + dismissCertificateDialog = viewModel::dismissCertificateDialog, + checkCrlRevocationList = viewModel::checkCrlRevocationList ) } @@ -266,7 +277,8 @@ fun DebugDataOptionsContent( onManualMigrationPressed: () -> Unit, enrollE2EICertificate: () -> Unit, handleE2EIEnrollmentResult: (Either) -> Unit, - dismissCertificateDialog: () -> Unit + dismissCertificateDialog: () -> Unit, + checkCrlRevocationList: () -> Unit ) { Column { @@ -303,6 +315,16 @@ fun DebugDataOptionsContent( ) if (BuildConfig.PRIVATE_BUILD) { + SettingsItem( + title = stringResource(R.string.debug_id), + text = state.debugId, + trailingIcon = R.drawable.ic_copy, + onIconPressed = Clickable( + enabled = true, + onClick = { } + ) + ) + SettingsItem( title = stringResource(R.string.debug_id), text = state.debugId, @@ -352,7 +374,8 @@ fun DebugDataOptionsContent( isEventProcessingEnabled = state.isEventProcessingDisabled, onDisableEventProcessingChange = onDisableEventProcessingChange, onRestartSlowSyncForRecovery = onRestartSlowSyncForRecovery, - onForceUpdateApiVersions = onForceUpdateApiVersions + onForceUpdateApiVersions = onForceUpdateApiVersions, + checkCrlRevocationList = checkCrlRevocationList ) } @@ -520,7 +543,8 @@ private fun DebugToolsOptions( isEventProcessingEnabled: Boolean, onDisableEventProcessingChange: (Boolean) -> Unit, onRestartSlowSyncForRecovery: () -> Unit, - onForceUpdateApiVersions: () -> Unit + onForceUpdateApiVersions: () -> Unit, + checkCrlRevocationList: () -> Unit ) { FolderHeader(stringResource(R.string.label_debug_tools_title)) Column { @@ -548,6 +572,29 @@ private fun DebugToolsOptions( ) } ) + + // checkCrlRevocationList + RowItemTemplate( + modifier = Modifier.wrapContentWidth(), + title = { + Text( + style = MaterialTheme.wireTypography.body01, + color = MaterialTheme.wireColorScheme.onBackground, + text = "CRL revocation check", + modifier = Modifier.padding(start = dimensions().spacing8x) + ) + }, + actions = { + WirePrimaryButton( + minSize = MaterialTheme.wireDimensions.buttonMediumMinSize, + minClickableSize = MaterialTheme.wireDimensions.buttonMinClickableSize, + onClick = checkCrlRevocationList, + text = stringResource(R.string.debug_settings_force_api_versioning_update_button_text), + fillMaxWidth = false + ) + } + ) + RowItemTemplate( modifier = Modifier.wrapContentWidth(), title = { @@ -625,5 +672,6 @@ fun PreviewOtherDebugOptions() { enrollE2EICertificate = {}, handleE2EIEnrollmentResult = {}, dismissCertificateDialog = {}, + checkCrlRevocationList = {} ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/debug/DebugScreen.kt b/app/src/main/kotlin/com/wire/android/ui/debug/DebugScreen.kt index cc6d9225d8b..fa38be1fb90 100644 --- a/app/src/main/kotlin/com/wire/android/ui/debug/DebugScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/debug/DebugScreen.kt @@ -70,9 +70,9 @@ fun DebugScreen(navigator: Navigator) { private fun UserDebugContent( onNavigationPressed: () -> Unit, onManualMigrationPressed: (currentAccount: UserId) -> Unit, -) { + userDebugViewModel: UserDebugViewModel = hiltViewModel(), - val userDebugViewModel: UserDebugViewModel = hiltViewModel() +) { val debugContentState: DebugContentState = rememberDebugContentState(userDebugViewModel.logPath) WireScaffold( diff --git a/kalium b/kalium index 4be820aa2bb..91a09ffd30c 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 4be820aa2bb05ffc40a8ec1709660b16cbe6bfdd +Subproject commit 91a09ffd30ca372196420b1ef650c71d2e09fdef