Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import build.getServerTargets
plugins {
`kotlin-dsl` apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.ktlint) apply false
}
Expand Down
13 changes: 7 additions & 6 deletions buildSrc/src/main/java/build/EnvUtil.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package build

import org.gradle.api.Action
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.process.ExecResult
import org.gradle.process.ExecOperations
import org.gradle.kotlin.dsl.support.serviceOf
import java.io.ByteArrayOutputStream
import java.io.File
import java.util.Base64
Expand All @@ -28,16 +28,17 @@ fun Project.fileFromEnv(project: Project, envName: String, fileName: String): Fi
}

fun Project.runCommand(command: String): String {
val execOperations = project.serviceOf<ExecOperations>()
val output = ByteArrayOutputStream()

val result: ExecResult? = exec(Action {
val result = execOperations.exec {
commandLine = listOf("sh", "-c", command)
standardOutput = output
}).assertNormalExitValue()
}.assertNormalExitValue()

if (result?.exitValue == 0) {
if (result.exitValue == 0) {
return output.toString().lines().filter { it.isNotBlank() }.joinToString("\n")
}

throw IllegalStateException("Command '${command}' return exit value: ${result?.exitValue}.")
throw IllegalStateException("Command '${command}' return exit value: ${result.exitValue}.")
}
23 changes: 12 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
[versions]
agp = "8.13.2"
kotlin = "2.3.0"
agp = "9.0.0"
kotlin = "2.3.10"
coreKtx = "1.17.0"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
lifecycleRuntimeKtx = "2.10.0"
activityCompose = "1.12.1"
composeBom = "2025.12.00"
webkit = "1.14.0"
ausweis = "2.4.0"
activityCompose = "1.12.3"
composeBom = "2026.01.01"
fragment = "1.8.9"
webkit = "1.15.0"
ausweis = "2.4.1"
credentials = "1.5.0"
yubikit = "3.0.0"
yubikit = "3.0.1"
yubifork = "wwwwallet~with-sign-ext-SNAPSHOT"
logback = "3.0.0"
test-json = "20250517"
test-json = "20251224"
coroutines = "1.10.2"
androidxtest = "1.7.0"
ktlint = "14.0.1"
gps-ic = "16.0.0-alpha08"
registryDigitalcredentialsMdoc = "1.0.0-alpha03"
gps-ic = "16.0.0-alpha10"
registryDigitalcredentialsMdoc = "1.0.0-alpha04"
datastore = "1.2.0"
cbor = "4.5.6"
cose = "1.1.0"
Expand All @@ -32,6 +33,7 @@ androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-co
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-fragment = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment"}
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
Expand Down Expand Up @@ -61,6 +63,5 @@ cose = { group = "com.augustcellars.cose", name = "cose-java", version.ref = "co

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Sep 20 11:23:24 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion wrapper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.ktlint)
}
Expand Down Expand Up @@ -109,6 +108,7 @@ dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.fragment)
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class BleServerHandler(
preparedWrite: Boolean,
responseNeeded: Boolean,
offset: Int,
payload: ByteArray?,
value: ByteArray?,
) {
super.onCharacteristicWriteRequest(
device,
Expand All @@ -300,20 +300,20 @@ class BleServerHandler(
preparedWrite,
responseNeeded,
offset,
payload,
value,
)

state.let {
if (it is Connected) {
val writeState =
if (payload != null) {
if (value != null) {
when (characteristic?.uuid) {
ServiceCharacteristic.ClientToServer.uuid -> {
// registered characteristic found, report back
val msg =
"Received $payload (${payload.toHumanReadable()}, ${
"Received $value (${value.toHumanReadable()}, ${
String(
payload,
value,
)
}) from ${characteristic.uuid}"
YOLOLogger.d(tagForLog, msg)
Expand All @@ -322,12 +322,12 @@ class BleServerHandler(
device!!,
characteristic,
false,
payload,
value,
)

// check if server wanted to see what client wrote.
if (it.readCallback != null) {
it.readCallback(payload)
it.readCallback(value)
state = it.copy(readCallback = null)
}

Expand Down Expand Up @@ -357,7 +357,7 @@ class BleServerHandler(
requestId,
writeState,
offset,
payload,
value,
)
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,9 @@ class LocalContainer(
) = try {
YOLOLogger.i("found credentials", "get options: ${options.toString(2)}")

val allowedCredentials: List<Map<*, *>> =
(options.getNested("publicKey.allowCredentials") as? List<Map<*, *>>) ?: listOf<Map<*, *>>()
@Suppress("UNCHECKED_CAST")
val allowedCredentials =
(options.getNested("publicKey.allowCredentials") as? List<Map<*, *>>) ?: listOf()

val rpId = options.getNested("publicKey.rpId") as? String ?: ""

Expand Down