From cec9fd15ab864a47e2232ccc799b64dbc7a0fadd Mon Sep 17 00:00:00 2001 From: Alexander Bakker Date: Fri, 18 Oct 2024 17:54:39 +0200 Subject: [PATCH] Bump targetSdkVersion to 35 and update dependencies --- app/build.gradle | 34 +- app/lint.xml | 8 + .../android/webdav/activities/MainActivity.kt | 36 +- .../android/webdav/provider/WebDavClient.kt | 14 +- app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/strings.xml | 4 +- build.gradle | 10 +- gradle/verification-metadata.xml | 2361 ++++++++--------- gradle/wrapper/gradle-wrapper.properties | 4 +- tests/docker-compose.yml | 14 +- 10 files changed, 1190 insertions(+), 1297 deletions(-) create mode 100644 app/lint.xml diff --git a/app/build.gradle b/app/build.gradle index c4dced2..b725364 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,12 +29,12 @@ def getGitBranch = { -> return getCmdOutput(["git", "rev-parse", "--abbrev-ref", android { namespace packageName - compileSdk 34 + compileSdk 35 defaultConfig { applicationId packageName minSdkVersion 27 - targetSdkVersion 34 + targetSdkVersion 35 versionCode 3 versionName "0.1.2" @@ -104,12 +104,12 @@ android { } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8 } lint { abortOnError true - disable 'MissingTranslation' + checkDependencies true } aboutLibraries { @@ -125,16 +125,16 @@ android { dependencies { def roomVersion = "2.6.1" - def espressoVersion = "3.5.1" + def espressoVersion = '3.6.1' - implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.core:core-ktx:1.12.0' - implementation "androidx.fragment:fragment-ktx:1.6.2" - implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7' - implementation 'androidx.navigation:navigation-ui-ktx:2.7.7' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.fragment:fragment-ktx:1.8.4' + implementation 'androidx.navigation:navigation-fragment-ktx:2.8.3' + implementation 'androidx.navigation:navigation-ui-ktx:2.8.3' implementation "androidx.room:room-runtime:$roomVersion" - implementation 'com.google.android.material:material:1.11.0' + implementation 'com.google.android.material:material:1.12.0' implementation "com.google.dagger:hilt-android:$hiltVersion" implementation "com.mikepenz:aboutlibraries:$aboutLibrariesVersion" implementation "com.mikepenz:aboutlibraries-core:$aboutLibrariesVersion" @@ -144,20 +144,20 @@ dependencies { implementation 'com.squareup.retrofit2:converter-simplexml:2.11.0' implementation 'com.github.thegrizzlylabs:sardine-android:0.9' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0' kapt "androidx.room:room-compiler:$roomVersion" kapt "com.google.dagger:hilt-android-compiler:$hiltVersion" testImplementation 'junit:junit:4.13.2' - androidTestImplementation "androidx.test:core:1.5.0" - androidTestImplementation "androidx.test:runner:1.5.2" - androidTestImplementation "androidx.test:rules:1.5.0" - androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test:core:1.6.1' + androidTestImplementation 'androidx.test:runner:1.6.2' + androidTestImplementation 'androidx.test:rules:1.6.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion" androidTestImplementation "androidx.test.uiautomator:uiautomator:2.3.0" androidTestImplementation "com.google.dagger:hilt-android-testing:$hiltVersion" - androidTestUtil "androidx.test:orchestrator:1.4.2" + androidTestUtil 'androidx.test:orchestrator:1.5.1' kaptAndroidTest "com.google.dagger:hilt-android-compiler:$hiltVersion" } diff --git a/app/lint.xml b/app/lint.xml new file mode 100644 index 0000000..9425588 --- /dev/null +++ b/app/lint.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt b/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt index c64a158..bd39fac 100644 --- a/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt +++ b/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt @@ -1,12 +1,12 @@ package dev.rocli.android.webdav.activities +import android.graphics.drawable.Drawable import android.os.Bundle import android.view.Menu import android.view.MenuItem import android.view.View.GONE import android.view.View.VISIBLE import android.view.ViewGroup -import androidx.annotation.ColorInt import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.view.ActionMode import androidx.core.view.ViewPropertyAnimatorCompat @@ -14,6 +14,7 @@ import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.findNavController import androidx.navigation.ui.NavigationUI.setupActionBarWithNavController +import com.google.android.material.appbar.AppBarLayout import com.google.android.material.color.DynamicColors import com.google.android.material.color.MaterialColors import dagger.hilt.android.AndroidEntryPoint @@ -99,9 +100,7 @@ class MainActivity : AppCompatActivity() { private inner class ActionModeStatusGuardHack { private var fadeAnimField: Field? = null private var actionModeViewField: Field? = null - - @ColorInt - private val statusBarColor: Int = window.statusBarColor + private var appBarBackground: Drawable? = null init { try { @@ -115,7 +114,7 @@ class MainActivity : AppCompatActivity() { } } - public fun apply(visibility: Int) { + fun apply(visibility: Int) { if (fadeAnimField == null || actionModeViewField == null) { return } @@ -123,27 +122,34 @@ class MainActivity : AppCompatActivity() { val fadeAnim: ViewPropertyAnimatorCompat? val actionModeView: ViewGroup? try { - fadeAnim = fadeAnimField?.get(getDelegate()) as ViewPropertyAnimatorCompat? - actionModeView = actionModeViewField?.get(getDelegate()) as ViewGroup? + fadeAnim = fadeAnimField?.get(delegate) as ViewPropertyAnimatorCompat? + actionModeView = actionModeViewField?.get(delegate) as ViewGroup? } catch (e: IllegalAccessException) { return } - if (fadeAnim == null || actionModeView == null) { - return + val appBarLayout = findViewById(R.id.app_bar_layout) + if (appBarLayout != null && appBarBackground == null) { + appBarBackground = appBarLayout.background } + if (fadeAnim == null || actionModeView == null || appBarLayout == null || appBarBackground == null) { + return + } fadeAnim.cancel() - actionModeView.visibility = visibility - actionModeView.setAlpha(if (visibility == VISIBLE) 1f else 0f) - window.statusBarColor = if (visibility == VISIBLE) { - MaterialColors.getColor( - actionModeView, + if (visibility == VISIBLE) { + actionModeView.visibility = VISIBLE + actionModeView.alpha = 1f + val color = MaterialColors.getColor( + appBarLayout, com.google.android.material.R.attr.colorSurfaceContainer ) + appBarLayout.setBackgroundColor(color) } else { - statusBarColor + actionModeView.visibility = GONE + actionModeView.alpha = 0f + appBarLayout.background = appBarBackground } } } diff --git a/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt b/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt index 7f02c6f..a642cd2 100644 --- a/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt +++ b/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt @@ -305,12 +305,14 @@ class WebDavClient( trustManagerFactory.trustManagers } else { hostnameVerifier { _, _ -> true } - arrayOf(@SuppressLint("CustomX509TrustManager") - object : X509TrustManager { - override fun getAcceptedIssuers(): Array = arrayOf() - override fun checkClientTrusted(certs: Array, authType: String) = Unit - override fun checkServerTrusted(certs: Array, authType: String) = Unit - }) + arrayOf( + @SuppressLint("CustomX509TrustManager") + object : X509TrustManager { + override fun getAcceptedIssuers(): Array = arrayOf() + override fun checkClientTrusted(certs: Array, authType: String) = Unit + override fun checkServerTrusted(certs: Array, authType: String) = Unit + } + ) } sslContext.init(keyManager, trustManager, SecureRandom()) sslSocketFactory(sslContext.socketFactory, trustManager.first() as X509TrustManager) diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index b9f5690..6290e15 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,5 +1,5 @@ - + #29638A #29638A #FFFFFF diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3140292..60274fa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ - + WebDAV WebDAV Provider - WebDAV Provider (Debug) + WebDAV Provider (Debug) About Save Edit diff --git a/build.gradle b/build.gradle index 4cd32a5..30028c9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { ext { - aboutLibrariesVersion = '11.1.1' - hiltVersion = '2.51.1' - kotlinVersion = '1.9.23' + aboutLibrariesVersion = '11.2.3' + hiltVersion = '2.52' + kotlinVersion = '2.0.21' } repositories { @@ -12,8 +12,8 @@ buildscript { } dependencies { - classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7" - classpath 'com.android.tools.build:gradle:8.3.1' + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.8.3" + classpath 'com.android.tools.build:gradle:8.7.1' classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion" classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$aboutLibrariesVersion" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index c2de17c..c9bb14f 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -1,13 +1,8 @@ - + true false - - - - - @@ -18,36 +13,30 @@ - - - + + + - - - - - - - - - + + + - - - - + + - - + + + + - - + + @@ -80,8 +69,21 @@ - - + + + + + + + + + + + + + + + @@ -106,67 +108,63 @@ - - - - - - + + + - - + + + + - - + + - - - + + + - - - + + + - - + + - - - - - - + + + - - + + - - - + + + + + + - - - + + + - - + + - - - - - - + + + - - + + @@ -184,9 +182,6 @@ - - - @@ -211,9 +206,6 @@ - - - @@ -236,6 +228,19 @@ + + + + + + + + + + + + + @@ -244,9 +249,12 @@ - - - + + + + + + @@ -256,8 +264,13 @@ - - + + + + + + + @@ -275,9 +288,6 @@ - - - @@ -286,9 +296,6 @@ - - - @@ -306,20 +313,17 @@ - - - - - - - - - + + + - - - + + + + + + @@ -330,20 +334,12 @@ - - - - - - - - - - - + + + - - + + @@ -362,11 +358,6 @@ - - - - - @@ -382,76 +373,61 @@ - - - - - - - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - - - + + - - - - - - + + + - - + + - - - - - - + + + - - + + @@ -483,31 +459,25 @@ - - - + + + - - - - - + + - - - - - - - - - + + + + + + @@ -518,26 +488,25 @@ - - - + + + - - + + + + - - + + - - - - - - + + + - - + + @@ -590,15 +559,17 @@ - - - + + + - - + + + + - - + + @@ -625,15 +596,12 @@ - - - - - - + + + - - + + @@ -660,15 +628,12 @@ - - - - - - + + + - - + + @@ -684,26 +649,20 @@ - - - + + + - - - - - + + - - - - - - + + + - - + + @@ -722,20 +681,17 @@ - - - - - - + + + - - + + - - - + + + @@ -762,15 +718,17 @@ - - - + + + - - + + + + - - + + @@ -789,15 +747,17 @@ - - - + + + - - + + + + - - + + @@ -816,15 +776,12 @@ - - - - - - + + + - - + + @@ -851,15 +808,20 @@ - - - + + + - - + + - - + + + + + + + @@ -875,15 +837,12 @@ - - - - - - + + + - - + + @@ -907,15 +866,12 @@ - - - + + + - - - - - + + @@ -942,108 +898,84 @@ - - - - - - + + + - - + + - - - - - - + + + - - + + - - - + + + - - - - - + + - - - - - - + + + - - + + - - - - - - + + + - - + + - - - + + + - - - - - + + - - - + + + - - + + - - - + + + - - + + - - - - - - + + + - - + + - - - - - - + + + - - + + @@ -1054,15 +986,12 @@ - - - + + + - - - - - + + @@ -1093,9 +1022,6 @@ - - - @@ -1104,9 +1030,6 @@ - - - @@ -1115,9 +1038,6 @@ - - - @@ -1150,8 +1070,10 @@ - - + + + + @@ -1169,9 +1091,6 @@ - - - @@ -1180,9 +1099,6 @@ - - - @@ -1191,9 +1107,6 @@ - - - @@ -1202,9 +1115,6 @@ - - - @@ -1213,14 +1123,6 @@ - - - - - - - - @@ -1229,117 +1131,106 @@ - - - - - - - - - - - - - - + + + - - + + - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -1349,9 +1240,6 @@ - - - @@ -1360,8 +1248,13 @@ - - + + + + + + + @@ -1372,20 +1265,12 @@ - - - - - - - - + + + - - - - - + + @@ -1435,9 +1320,6 @@ - - - @@ -1446,230 +1328,221 @@ - - - - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - - - - - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -1696,268 +1569,284 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + @@ -1967,9 +1856,6 @@ - - - @@ -1992,15 +1878,12 @@ - - - + + + - - - - - + + @@ -2020,9 +1903,6 @@ - - - @@ -2071,11 +1951,6 @@ - - - - - @@ -2123,84 +1998,84 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -2208,12 +2083,12 @@ - - - + + + - - + + @@ -2512,45 +2387,28 @@ - - - - - - + + + - - + + - - - + + + - - + + - - - - - - + + + - - - - - - - - - - - - + @@ -2560,22 +2418,16 @@ - - - - - - + + + - - + + - - - @@ -2588,14 +2440,6 @@ - - - - - - - - @@ -2627,9 +2471,6 @@ - - - @@ -2638,9 +2479,6 @@ - - - @@ -2657,9 +2495,6 @@ - - - @@ -2668,9 +2503,6 @@ - - - @@ -2679,9 +2511,6 @@ - - - @@ -2952,6 +2781,14 @@ + + + + + + + + @@ -3172,28 +3009,36 @@ - - - + + + + + + + + + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3233,12 +3078,12 @@ - - - + + + - - + + @@ -3269,6 +3114,11 @@ + + + + + @@ -3314,14 +3164,6 @@ - - - - - - - - @@ -3375,28 +3217,20 @@ - - - - - - - - - - - + + + - - + + - - - + + + - - + + @@ -3404,169 +3238,169 @@ - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3593,49 +3427,44 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - - - - + + + - - - - + + @@ -3646,15 +3475,17 @@ + + + + + - - - @@ -3662,23 +3493,34 @@ - - + + - - + + + + + - - + + + + - - + + - - - + + + + + + + + + @@ -3689,6 +3531,11 @@ + + + + + @@ -3699,22 +3546,19 @@ - - - + + + - - - + + + - - - - - - + + + @@ -3725,6 +3569,14 @@ + + + + + + + + @@ -3749,20 +3601,12 @@ - - - - - - - - - - - + + + - - + + @@ -3773,6 +3617,14 @@ + + + + + + + + @@ -3802,44 +3654,36 @@ - - - - - - - - - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3850,6 +3694,14 @@ + + + + + + + + @@ -3873,9 +3725,6 @@ - - - @@ -3883,9 +3732,6 @@ - - - @@ -3898,15 +3744,20 @@ - - - + + + + + + - - + + + + - - + + @@ -3919,22 +3770,29 @@ - - - + + + - - - + + + - - - + + + - - + + + + + + + + + @@ -3945,20 +3803,25 @@ - - - + + + - - + + - - - + + + - - + + + + + + + @@ -3969,15 +3832,20 @@ - - - + + + + + + - - + + + + - - + + @@ -3985,42 +3853,51 @@ + + + + + - - + + + + + + + - - - - - - - - - + + + - - + + - - - + + + + + + - - + + + + - - + + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ad78386..3f66b4e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ #Fri Mar 01 15:45:22 GMT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=f2b9ed0faf8472cbe469255ae6c86eddb77076c75191741b4a462f33128dd419 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionSha256Sum=258e722ec21e955201e31447b0aed14201765a3bfbae296a46cf60b70e66db70 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index a0dc6eb..a660599 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -17,7 +17,7 @@ services: healthcheck: test: "curl -v -L --fail-with-body http://127.0.0.1/health || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-hacdias: build: ./servers/hacdias volumes: @@ -27,7 +27,7 @@ services: healthcheck: test: "curl -v --fail-with-body -u test:test -X PROPFIND http://127.0.0.1 || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-nginx: build: ./servers/nginx volumes: @@ -39,7 +39,7 @@ services: healthcheck: test: "curl -v --fail-with-body -X PROPFIND http://127.0.0.1 || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-nginx-apache-subpath: build: ./servers/nginx volumes: @@ -56,7 +56,7 @@ services: healthcheck: test: "curl -v --fail-with-body -L -X PROPFIND -H 'Depth: 1' http://127.0.0.1/webdav || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-nextcloud: build: ./servers/nextcloud volumes: @@ -73,7 +73,7 @@ services: healthcheck: test: "curl -v -L --fail-with-body -u admin:admin -X PROPFIND http://127.0.0.1/remote.php/dav/files/admin || exit 1" start_period: 20s - start_interval: 1s + #start_interval: 1s webdav-apache: build: ./servers/apache volumes: @@ -83,7 +83,7 @@ services: healthcheck: test: "curl -v --fail-with-body -X PROPFIND -H 'Depth: 1' http://127.0.0.1 || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-apache-subpath: build: ./servers/apache environment: @@ -98,4 +98,4 @@ services: healthcheck: test: "curl -v --fail-with-body -X PROPFIND -H 'Depth: 1' http://127.0.0.1/webdav || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s