From 0488be9c67df3b715c481b85265a4f761a24d31b Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 27 Jun 2023 09:53:17 -0300 Subject: [PATCH] Upgrade libraries --- app/build.gradle | 24 +++++++++---------- .../android/server/WebserverManager.kt | 17 ++++--------- build.gradle | 4 ++-- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d8630d8f..9858763c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,7 +77,7 @@ android { compose true } composeOptions { - kotlinCompilerExtensionVersion '1.4.4' + kotlinCompilerExtensionVersion '1.4.6' } packagingOptions { jniLibs { @@ -100,43 +100,43 @@ configurations { dependencies { implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.core:core-ktx:1.10.1' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.activity:activity-compose:1.7.0' + implementation 'androidx.activity:activity-compose:1.7.2' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' - implementation 'com.google.android.material:material:1.8.0' + implementation 'com.google.android.material:material:1.9.0' implementation platform("androidx.compose:compose-bom:$compose_version") implementation 'androidx.compose.material:material' implementation "androidx.compose.material:material-icons-extended" implementation 'androidx.compose.ui:ui-tooling-preview' - implementation "androidx.navigation:navigation-compose:2.5.3" + implementation "androidx.navigation:navigation-compose:2.6.0" implementation "androidx.hilt:hilt-navigation-compose:1.0.0" - implementation "androidx.profileinstaller:profileinstaller:1.3.0" - implementation "androidx.security:security-crypto:1.1.0-alpha05" + implementation "androidx.profileinstaller:profileinstaller:1.3.1" + implementation "androidx.security:security-crypto:1.1.0-alpha06" implementation "com.google.dagger:hilt-android:$hilt_version" kapt "com.google.dagger:hilt-compiler:$hilt_version" // Tor - implementation "org.briarproject:onionwrapper-android:0.0.3" + implementation "org.briarproject:onionwrapper-android:0.0.4" tor 'org.briarproject:tor-android:0.4.7.13-2' tor 'org.briarproject:obfs4proxy-android:0.0.14-tor2' tor 'org.briarproject:snowflake-android:2.5.1' implementation 'org.briarproject:moat-api:0.2' implementation 'com.squareup.okhttp3:okhttp:4.10.0' - def ktor_version = '2.2.4' + def ktor_version = '2.3.1' implementation "io.ktor:ktor-server-core:$ktor_version" implementation "io.ktor:ktor-server-netty:$ktor_version" implementation "io.ktor:ktor-server-pebble:$ktor_version" implementation "io.ktor:ktor-server-status-pages:$ktor_version" implementation "io.ktor:ktor-server-call-logging:$ktor_version" - implementation 'org.slf4j:slf4j-api:2.0.6' + implementation 'org.slf4j:slf4j-api:2.0.7' implementation 'com.github.tony19:logback-android:3.0.0' - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2' + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3' debugImplementation 'androidx.compose.ui:ui-tooling' debugImplementation 'androidx.compose.ui:ui-test-manifest' @@ -145,7 +145,7 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.4.0" + androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.4.3" androidTestImplementation 'tools.fastlane:screengrab:2.1.1' } diff --git a/app/src/main/java/org/onionshare/android/server/WebserverManager.kt b/app/src/main/java/org/onionshare/android/server/WebserverManager.kt index aefad8ec..a5fdd4b5 100644 --- a/app/src/main/java/org/onionshare/android/server/WebserverManager.kt +++ b/app/src/main/java/org/onionshare/android/server/WebserverManager.kt @@ -4,7 +4,6 @@ import android.net.TrafficStats import android.util.Base64 import android.util.Base64.NO_PADDING import android.util.Base64.URL_SAFE -import com.mitchellbosecke.pebble.loader.ClasspathLoader import io.ktor.http.ContentDisposition.Companion.Attachment import io.ktor.http.ContentDisposition.Parameters.FileName import io.ktor.http.HttpHeaders.ContentDisposition @@ -17,8 +16,7 @@ import io.ktor.server.application.call import io.ktor.server.application.install import io.ktor.server.engine.ApplicationEngine import io.ktor.server.engine.embeddedServer -import io.ktor.server.http.content.resources -import io.ktor.server.http.content.static +import io.ktor.server.http.content.staticResources import io.ktor.server.netty.Netty import io.ktor.server.pebble.Pebble import io.ktor.server.pebble.PebbleContent @@ -30,6 +28,7 @@ import io.ktor.server.response.respondFile import io.ktor.server.routing.Route import io.ktor.server.routing.get import io.ktor.server.routing.routing +import io.pebbletemplates.pebble.loader.ClasspathLoader import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import org.slf4j.LoggerFactory @@ -136,15 +135,9 @@ class WebserverManager @Inject constructor() { } private fun Route.defaultRoutes(staticPath: String) { - static("$staticPath/css") { - resources("assets/static/css") - } - static("$staticPath/img") { - resources("assets/static/img") - } - static("$staticPath/js") { - resources("assets/static/js") - } + staticResources("$staticPath/css", "assets/static/css") + staticResources("$staticPath/img", "assets/static/img") + staticResources("$staticPath/js", "assets/static/js") } private fun Route.sendRoutes(sendPage: SendPage, staticPathMap: Map) { diff --git a/build.gradle b/build.gradle index d4503987..24bf027e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { ext { - kotlin_version = '1.8.10' + kotlin_version = '1.8.20' hilt_version = '2.45' - compose_version = '2023.03.00' + compose_version = '2023.05.01' } repositories { google()