diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a50eaa1..9c0593a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -10,9 +10,10 @@ val keystoreProperties = Properties () keystoreProperties . load ( FileInputStream ( rootProject . file ("keystore.properties") ) ) plugins { - id ("com.android.application") . version ("9.0.0") - id ("org.jetbrains.kotlin.plugin.compose") . version ("2.3.0") - id ("org.jetbrains.kotlin.plugin.serialization") . version ("2.3.0") + id ("com.android.application") . version ("8.13.1") + id ("org.jetbrains.kotlin.android") . version ("2.2.21") + id ("org.jetbrains.kotlin.plugin.compose") . version ("2.2.21") + id ("org.jetbrains.kotlin.plugin.serialization") . version ("2.2.21") } android { @@ -48,7 +49,7 @@ android { } compileOptions { // Required even though we don't have any Java sources because it needs to match Kotlin's JVM version - targetCompatibility = JavaVersion . VERSION_25 + targetCompatibility = JavaVersion . VERSION_23 } buildFeatures { compose = true @@ -57,22 +58,22 @@ android { kotlin { compilerOptions { - jvmTarget = JvmTarget . JVM_25 + jvmTarget = JvmTarget . JVM_23 } } dependencies { // Android runtime libraries implementation ( "com.google.android.material:material:1.13.0" ) - implementation ( "androidx.activity:activity-compose:1.12.2" ) + implementation ( "androidx.activity:activity-compose:1.12.1" ) implementation ( "androidx.core:core-ktx:1.17.0" ) implementation ( "androidx.compose.material3:material3:1.4.0" ) - implementation ( "androidx.compose.ui:ui:1.10.1" ) - implementation ( "androidx.compose.ui:ui-graphics:1.10.1" ) - debugImplementation ( "androidx.compose.ui:ui-tooling:1.10.1" ) + implementation ( "androidx.compose.ui:ui:1.10.0" ) + implementation ( "androidx.compose.ui:ui-graphics:1.10.0" ) + debugImplementation ( "androidx.compose.ui:ui-tooling:1.10.0" ) implementation ( "androidx.lifecycle:lifecycle-runtime-ktx:2.10.0" ) implementation ( "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2" ) - implementation ( "org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0" ) + implementation ( "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0" ) // Other libraries implementation ( "io.github.davidepianca98:kmqtt-common:1.0.0" ) implementation ( "io.github.davidepianca98:kmqtt-client:1.0.0" ) diff --git a/app/src/main/java/com/kernelmaft/zanbur/common/config.kt b/app/src/main/java/com/kernelmaft/zanbur/common/config.kt index 0fb9d9f..c425c41 100644 --- a/app/src/main/java/com/kernelmaft/zanbur/common/config.kt +++ b/app/src/main/java/com/kernelmaft/zanbur/common/config.kt @@ -3,7 +3,7 @@ package com.kernelmaft.zanbur.common object Config { - const val MQTT_SERVER_HOST = "merovech.kernelmaft.com" + const val MQTT_SERVER_HOST = "deorwine.kernelmaft.com" const val MQTT_SERVER_PORT = 1883 const val MQTT_TOPIC = "zigbee2mqtt" diff --git a/app/src/main/java/com/kernelmaft/zanbur/network/exception-printer.kt b/app/src/main/java/com/kernelmaft/zanbur/network/exception-printer.kt deleted file mode 100644 index cd8b172..0000000 --- a/app/src/main/java/com/kernelmaft/zanbur/network/exception-printer.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.kernelmaft.zanbur.network - -import kotlinx.coroutines.CoroutineExceptionHandler - - - -val exceptionPrinter = CoroutineExceptionHandler { _ , throwable -> - throwable . printStackTrace () - throw throwable -} diff --git a/app/src/main/java/com/kernelmaft/zanbur/network/mqtt.kt b/app/src/main/java/com/kernelmaft/zanbur/network/mqtt.kt index 1710834..212d73a 100644 --- a/app/src/main/java/com/kernelmaft/zanbur/network/mqtt.kt +++ b/app/src/main/java/com/kernelmaft/zanbur/network/mqtt.kt @@ -25,7 +25,7 @@ object MqttClient { this . coroutineScope = coroutineScope val json = Json { ignoreUnknownKeys = true } - coroutineScope . launch ( IO + exceptionPrinter ) { + coroutineScope . launch (IO) { client = MQTTClient ( MQTT5 , MQTT_SERVER_HOST , MQTT_SERVER_PORT , null ) { for ( handler in publishHandlers ) handler ( it , json ) } @@ -38,7 +38,7 @@ object MqttClient { fun addPublishHandler ( handler : MqttPublishHandler ) = publishHandlers . add (handler) fun publish ( topic : String , payload : UByteArray ) { - coroutineScope !! . launch ( IO + exceptionPrinter ) { + coroutineScope !! . launch (IO) { client !! . publish ( false , AT_MOST_ONCE , topic , payload ) } }