mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-10 16:02:25 +01:00
move the certificate screen changes to the experimental branch
This commit is contained in:
1 parent
a549077c13
commit
ddaf3e5657
3 files changed
+18
-28
No files matched your search
@@ -60,6 +60,7 @@ fun CertSetupScreen(onDone: () -> Unit) {
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
var downloadState by remember { mutableStateOf<DownloadState>(DownloadState.Idle) }
|
||||
var showImport by remember { mutableStateOf(false) }
|
||||
var pendingUri by remember { mutableStateOf<Uri?>(null) }
|
||||
var manualProgress by remember { mutableStateOf(false) }
|
||||
|
||||
@@ -90,7 +91,7 @@ fun CertSetupScreen(onDone: () -> Unit) {
|
||||
if (installed) {
|
||||
"Cars accept only Google-issued certificates, and you have one loaded."
|
||||
} else {
|
||||
"Cars accept only Google-issued certificates. Gearslip doesn't include one, so choose where yours comes from."
|
||||
"Cars accept only Google-issued certificates. Download one to connect."
|
||||
},
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
textAlign = TextAlign.Center,
|
||||
@@ -130,11 +131,10 @@ fun CertSetupScreen(onDone: () -> Unit) {
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth().height(56.dp),
|
||||
) {
|
||||
Text("Download from aasdk")
|
||||
Text("Download certificate")
|
||||
}
|
||||
Text(
|
||||
"The open-source aasdk project publishes this certificate at github.com/opencardev/aasdk. " +
|
||||
"Most cars accept it; some from around 2020 on don't.",
|
||||
"Works with most cars built before 2020. Newer cars reject it.",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
textAlign = TextAlign.Center,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
@@ -177,18 +177,16 @@ fun CertSetupScreen(onDone: () -> Unit) {
|
||||
|
||||
Spacer(Modifier.height(16.dp))
|
||||
|
||||
OutlinedButton(
|
||||
onClick = { importLauncher.launch(arrayOf("*/*")) },
|
||||
modifier = Modifier.fillMaxWidth().height(52.dp),
|
||||
) { Text("Import my own file") }
|
||||
Text(
|
||||
"A .p12 file with its private key, from wherever you choose.",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
textAlign = TextAlign.Center,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(top = 8.dp),
|
||||
)
|
||||
Spacer(Modifier.height(16.dp))
|
||||
if (showImport) {
|
||||
OutlinedButton(
|
||||
onClick = { importLauncher.launch(arrayOf("*/*")) },
|
||||
modifier = Modifier.fillMaxWidth().height(52.dp),
|
||||
) { Text("Import your own .p12 cert") }
|
||||
Spacer(Modifier.height(16.dp))
|
||||
} else {
|
||||
TextButton(onClick = { showImport = true }) { Text("Import your own certificate instead") }
|
||||
Spacer(Modifier.height(8.dp))
|
||||
}
|
||||
|
||||
OutlinedButton(
|
||||
onClick = {
|
||||
|
||||
@@ -208,7 +208,7 @@ private fun CertificateSection() {
|
||||
}
|
||||
SettingsDivider()
|
||||
SettingsRow(
|
||||
if (downloading) "Downloading…" else "Download from aasdk",
|
||||
if (downloading) "Downloading…" else "Download certificate",
|
||||
Modifier.clickable(enabled = !downloading) {
|
||||
downloading = true
|
||||
scope.launch {
|
||||
@@ -222,14 +222,13 @@ private fun CertificateSection() {
|
||||
}
|
||||
}
|
||||
},
|
||||
subtitle = "The certificate the open-source aasdk project publishes on GitHub. Gearslip doesn't include one",
|
||||
icon = Icons.Filled.Refresh,
|
||||
)
|
||||
SettingsDivider()
|
||||
SettingsRow(
|
||||
"Import my own file",
|
||||
"Import a certificate",
|
||||
Modifier.clickable { picker.launch(arrayOf("*/*")) },
|
||||
subtitle = "A .p12 file with its private key, from wherever you choose",
|
||||
subtitle = "A .p12 file with its private key",
|
||||
icon = Icons.Filled.Add,
|
||||
)
|
||||
val removable = when (s?.kind) {
|
||||
|
||||
Reference in new issue
Block a user