@@ -28,7 +28,6 @@ import com.exxeta.securitytoolkit.ThreatDetectionCenter
28
28
29
29
@Composable
30
30
fun ThreatStatusList () {
31
-
32
31
val context = LocalContext .current
33
32
val detectionCenter = ThreatDetectionCenter (context)
34
33
detectionCenter.threats
@@ -46,7 +45,9 @@ fun ThreatStatusList() {
46
45
ThreatStatus (
47
46
" Root" ,
48
47
" Is a way of acquiring privileged control over the operating system of a device. Tools such as Magisk or Shadow can hide the privileged access" ,
49
- reportedThreats.contains(ThreatDetectionCenter .Threat .ROOT_PRIVILEGES ),
48
+ reportedThreats.contains(
49
+ ThreatDetectionCenter .Threat .ROOT_PRIVILEGES ,
50
+ ),
50
51
),
51
52
ThreatStatus (
52
53
" Hooks" ,
@@ -58,11 +59,30 @@ fun ThreatStatusList() {
58
59
" Running the application in an Emulator" ,
59
60
reportedThreats.contains(ThreatDetectionCenter .Threat .SIMULATOR ),
60
61
),
62
+ ThreatStatus (
63
+ " Passcode" ,
64
+ " Indicates if current device is unprotected with a passcode. Biometric protection requires a passcode to be set up" ,
65
+ reportedThreats.contains(
66
+ ThreatDetectionCenter .Threat .DEVICE_WITHOUT_PASSCODE ,
67
+ ),
68
+ ),
69
+ ThreatStatus (
70
+ " Hardware protection" ,
71
+ " Refers to hardware capabilities of current device, specific to hardware-backed cryptography operations. If not available, no additional hardware security layer can be used when working with keys, certificates and keychain" ,
72
+ reportedThreats.contains(
73
+ ThreatDetectionCenter .Threat .HARDWARE_PROTECTION_UNAVAILABLE ,
74
+ ),
75
+ ),
76
+ ThreatStatus (
77
+ " Signature missmatch" ,
78
+ " Expects app to be signed with a given certificate. For PlayStore should match the one provided by the store via Play Console" ,
79
+ detectionCenter.hasAppSignatureMissmatch(" INVALID" ),
80
+ ),
61
81
)
62
82
63
83
LazyColumn (
64
84
modifier = Modifier
65
- .padding(16 .dp)
85
+ .padding(16 .dp),
66
86
) {
67
87
item {
68
88
Spacer (modifier = Modifier .height(48 .dp))
@@ -71,7 +91,7 @@ fun ThreatStatusList() {
71
91
contentDescription = " stethoscope_24px" ,
72
92
modifier = Modifier
73
93
.fillMaxWidth()
74
- .size(80 .dp)
94
+ .size(80 .dp),
75
95
)
76
96
Spacer (modifier = Modifier .height(24 .dp))
77
97
Text (
@@ -80,7 +100,7 @@ fun ThreatStatusList() {
80
100
modifier = Modifier
81
101
.fillMaxWidth()
82
102
.padding(bottom = 8 .dp),
83
- textAlign = TextAlign .Center
103
+ textAlign = TextAlign .Center ,
84
104
)
85
105
Text (
86
106
text = " Here is a list of the threats that could put you at risk" ,
@@ -89,7 +109,7 @@ fun ThreatStatusList() {
89
109
.fillMaxWidth()
90
110
.padding(bottom = 16 .dp),
91
111
textAlign = TextAlign .Center ,
92
- color = Color .Gray
112
+ color = Color .Gray ,
93
113
)
94
114
}
95
115
items(threats) { item ->
@@ -98,7 +118,7 @@ fun ThreatStatusList() {
98
118
.padding(8 .dp)
99
119
.fillMaxWidth(),
100
120
shape = MaterialTheme .shapes.medium,
101
- elevation = CardDefaults .cardElevation(1 .dp)
121
+ elevation = CardDefaults .cardElevation(1 .dp),
102
122
) {
103
123
ThreatStatusRow (threatStatus = item)
104
124
}
@@ -112,4 +132,4 @@ private fun Preview() {
112
132
MobileSecurityToolkitExampleTheme {
113
133
ThreatStatusList ()
114
134
}
115
- }
135
+ }
0 commit comments