Skip to content

Commit

Permalink
Bump targetSdkVersion to 35 and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbakker committed Oct 18, 2024
1 parent 7304f30 commit 0c87f24
Show file tree
Hide file tree
Showing 13 changed files with 1,371 additions and 1,145 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<img align="left" width="80" height="80" src="app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp"
alt="App icon">

# WebDAV Provider [![CI](https://github.com/alexbakker/webdav-provider/workflows/build/badge.svg)](https://github.com/alexbakker/webdav-provider/actions?query=workflow%3Abuild)
# WebDAV Provider [![build](https://github.com/alexbakker/webdav-provider/actions/workflows/build.yaml/badge.svg)](https://github.com/alexbakker/webdav-provider/actions/workflows/build.yaml)

__WebDAV Provider__ is an Android app that can expose WebDAV through Android's
Storage Access Framework (SAF). This allows you to access your WebDAV storage
Expand Down
37 changes: 19 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -99,17 +99,17 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_11
}

lint {
abortOnError true
disable 'MissingTranslation'
checkDependencies true
}

aboutLibraries {
Expand All @@ -125,16 +125,16 @@ android {

dependencies {
def roomVersion = "2.6.1"
def espressoVersion = "3.5.1"
def espressoVersion = '3.5.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"
Expand All @@ -144,20 +144,21 @@ 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"

// NOTE: Don't update test/espresso libraries until this is resolved: https://github.com/android/android-test/issues/2273
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: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.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.4.2'
kaptAndroidTest "com.google.dagger:hilt-android-compiler:$hiltVersion"
}
8 changes: 8 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="MissingTranslation" severity="ignore" />
<issue id="MissingQuantity" severity="ignore" />
<issue id="UnusedResources" severity="error">
<ignore path="res/raw/aboutlibraries.json" />
</issue>
</lint>
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ScreenshotTest {
scenario.close()
}

@Test
@Test(timeout = 30000)
fun takeShowcaseScreenshots() {
onView(withId(R.id.rvAccounts))
.check(matches(hasDescendant(withText("Nextcloud"))))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
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
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
Expand Down Expand Up @@ -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 {
Expand All @@ -115,35 +114,42 @@ class MainActivity : AppCompatActivity() {
}
}

public fun apply(visibility: Int) {
fun apply(visibility: Int) {
if (fadeAnimField == null || actionModeViewField == null) {
return
}

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<AppBarLayout>(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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,14 @@ class WebDavClient(
trustManagerFactory.trustManagers
} else {
hostnameVerifier { _, _ -> true }
arrayOf(@SuppressLint("CustomX509TrustManager")
object : X509TrustManager {
override fun getAcceptedIssuers(): Array<X509Certificate> = arrayOf()
override fun checkClientTrusted(certs: Array<X509Certificate>, authType: String) = Unit
override fun checkServerTrusted(certs: Array<X509Certificate>, authType: String) = Unit
})
arrayOf(
@SuppressLint("CustomX509TrustManager")
object : X509TrustManager {
override fun getAcceptedIssuers(): Array<X509Certificate> = arrayOf()
override fun checkClientTrusted(certs: Array<X509Certificate>, authType: String) = Unit
override fun checkServerTrusted(certs: Array<X509Certificate>, authType: String) = Unit
}
)
}
sslContext.init(keyManager, trustManager, SecureRandom())
sslSocketFactory(sslContext.socketFactory, trustManager.first() as X509TrustManager)
Expand Down
Loading

0 comments on commit 0c87f24

Please sign in to comment.