-
Notifications
You must be signed in to change notification settings - Fork 177
feat: upgrade security system #1450
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
Merged
+8,429
−341
Merged
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0624288
feat: new security system (phase 1)
HashEngineering 5ab1962
feat: new security system (phase 2)
HashEngineering 4cf7737
feat: add fallback testing
HashEngineering f1f0591
fix: add propagate context
HashEngineering a967b50
feat: add add security status and track
HashEngineering 7f30bdb
feat: add add security status and track
HashEngineering 1b20d3d
feat: add add security status and track
HashEngineering 57963fd
feat: add another test failure mode
HashEngineering c9a3d5f
feat: new security system phase 3, recovery
HashEngineering a794696
feat: remove obsolete files
HashEngineering dd2f403
feat: notify user of lost password/PIN
HashEngineering 110be64
feat: other updates
HashEngineering fd21786
feat: update dialogs with new components
HashEngineering 47403ba
feat: restore migration step
HashEngineering 86efb03
feat: prevent crashes
HashEngineering 9c73707
fixes: minor fixes
HashEngineering e38b795
fix: minor fixes
HashEngineering d3b0dd6
docs: add QA test protocol
HashEngineering 8e61189
Merge branch 'master' of https://github.com/dashevo/dash-wallet into …
HashEngineering 61e1f54
fix: remove debug UI elements
HashEngineering a8168a6
fix: remove password dumps in debug mode
HashEngineering 06c8fe5
fix: only set healthy status if encryption is true
HashEngineering File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
common/src/main/java/org/dash/wallet/common/data/SecuritySystemStatus.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Copyright 2025 Dash Core Group. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package org.dash.wallet.common.data | ||
|
|
||
| enum class SecuritySystemStatus( | ||
| val value: Int, | ||
| val isHealthy: Boolean, | ||
| val hasFallback: Boolean | ||
| ) { | ||
| DEAD(0, false, false), | ||
| FALLBACKS(2, false, true), | ||
| HEALTHY(1, true, false), | ||
| HEALTHY_WITH_FALLBACKS(3, true, true); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
267 changes: 267 additions & 0 deletions
267
common/src/main/java/org/dash/wallet/common/ui/components/FeatureList.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,267 @@ | ||
| /* | ||
| * Copyright 2025 Dash Core Group. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package org.dash.wallet.common.ui.components | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.border | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import androidx.compose.ui.res.vectorResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.unit.sp | ||
| import org.dash.wallet.common.R | ||
|
|
||
| data class FeatureItem( | ||
| val heading: String, | ||
| val text: String? = null, | ||
| val icon: ImageVector? = null, | ||
| val number: String? = null | ||
| ) | ||
|
|
||
| @Composable | ||
| fun FeatureItemNumber( | ||
| number: String, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| Box( | ||
| modifier = modifier | ||
| .size(24.dp) | ||
| .background( | ||
| color = MyTheme.Colors.dashBlue, | ||
| shape = RoundedCornerShape(8.dp) | ||
| ), | ||
| contentAlignment = Alignment.Center | ||
| ) { | ||
| Text( | ||
| text = number, | ||
| fontSize = 14.sp, | ||
| color = Color.White, | ||
| textAlign = TextAlign.Center | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun FeatureSingleItem( | ||
| heading: String, | ||
| text: String? = null, | ||
| modifier: Modifier = Modifier, | ||
| icon: ImageVector? = null, | ||
| number: String? = null | ||
| ) { | ||
| Row( | ||
| modifier = modifier.fillMaxWidth(), | ||
| horizontalArrangement = Arrangement.spacedBy(12.dp), | ||
| verticalAlignment = Alignment.Top | ||
| ) { | ||
| Box( | ||
| modifier = Modifier | ||
| .size(40.dp) | ||
| .padding(top = 10.dp), | ||
| contentAlignment = Alignment.TopCenter | ||
| ) { | ||
| when { | ||
| number != null -> { | ||
| FeatureItemNumber(number = number) | ||
| } | ||
| icon != null -> { | ||
| Icon( | ||
| imageVector = icon, | ||
| contentDescription = null, | ||
| modifier = Modifier.size(20.dp), | ||
| tint = MyTheme.Colors.gray300 | ||
| ) | ||
| } | ||
| else -> { | ||
| Box( | ||
| modifier = Modifier | ||
| .size(20.dp) | ||
| .border( | ||
| width = 2.5.dp, | ||
| color = MyTheme.Colors.gray300, | ||
| shape = RoundedCornerShape(5.dp) | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Column( | ||
| modifier = Modifier | ||
| .weight(1f) | ||
| .padding(top = 10.dp), | ||
| verticalArrangement = Arrangement.spacedBy(2.dp) | ||
| ) { | ||
| Text( | ||
| text = heading, | ||
| style = MyTheme.Typography.TitleSmallMedium, | ||
| color = MyTheme.Colors.textPrimary | ||
| ) | ||
| if (text != null) { | ||
| Text( | ||
| text = text, | ||
| style = MyTheme.Typography.BodyMedium, | ||
| color = MyTheme.Colors.textSecondary | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun FeatureList( | ||
| items: List<FeatureItem>, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| Column( | ||
| modifier = modifier.fillMaxWidth(), | ||
| verticalArrangement = Arrangement.spacedBy(16.dp) | ||
| ) { | ||
| items.forEach { item -> | ||
| FeatureSingleItem( | ||
| heading = item.heading, | ||
| text = item.text, | ||
| icon = item.icon, | ||
| number = item.number | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun FeatureSingleItemPreview() { | ||
| Box( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .background(Color.White) | ||
| .padding(20.dp) | ||
| ) { | ||
| FeatureSingleItem( | ||
| heading = "heading", | ||
| text = "text" | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun FeatureListPreview() { | ||
| Box( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .background(Color.White) | ||
| .padding(20.dp) | ||
| ) { | ||
| FeatureList( | ||
| items = listOf( | ||
| FeatureItem("heading", "text"), | ||
| FeatureItem("heading", "text"), | ||
| FeatureItem("heading", "text"), | ||
| FeatureItem("heading", "text") | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun FeatureListWithIconsPreview() { | ||
| Box( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .background(Color.White) | ||
| .padding(20.dp) | ||
| ) { | ||
| FeatureList( | ||
| items = listOf( | ||
| FeatureItem( | ||
| "Enhanced Security", | ||
| "Your wallet will use the latest encryption technology", | ||
| ImageVector.vectorResource(R.drawable.ic_preview) | ||
| ), | ||
| FeatureItem( | ||
| "Biometric Support", | ||
| "Unlock your wallet with fingerprint or face recognition", | ||
| ImageVector.vectorResource(R.drawable.ic_preview) | ||
| ), | ||
| FeatureItem( | ||
| "PIN Protection", | ||
| "Set a secure PIN to protect your funds", | ||
| ImageVector.vectorResource(R.drawable.ic_preview) | ||
| ), | ||
| FeatureItem( | ||
| "Recovery Options", | ||
| "Multiple ways to recover your wallet if needed", | ||
| ImageVector.vectorResource(R.drawable.ic_preview) | ||
| ) | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun FeatureListWithNumbersPreview() { | ||
| Box( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .background(Color.White) | ||
| .padding(20.dp) | ||
| ) { | ||
| FeatureList( | ||
| items = listOf( | ||
| FeatureItem( | ||
| heading = "Create a secure PIN", | ||
| text = "Choose a 6-digit PIN that you'll use to unlock your wallet", | ||
| number = "1" | ||
| ), | ||
| FeatureItem( | ||
| heading = "Write down your recovery phrase", | ||
| text = "Save your 12-word recovery phrase in a safe place", | ||
| number = "2" | ||
| ), | ||
| FeatureItem( | ||
| heading = "Enable biometric authentication", | ||
| text = "Use fingerprint or face recognition for quick access", | ||
| number = "3" | ||
| ), | ||
| FeatureItem( | ||
| heading = "Start using your wallet", | ||
| text = "You're all set! Begin sending and receiving Dash", | ||
| number = "4" | ||
| ) | ||
| ) | ||
| ) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.