From b606909c65ad3a0099e81d48ed5ef1706faeae46 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Tue, 2 Aug 2022 22:25:19 +0200 Subject: [PATCH] fix: Update libs and SDK to 32 --- app/build.gradle | 6 +++--- .../keepass/activities/helpers/ExternalFileHelper.kt | 9 ++++----- build.gradle | 10 +++++----- crypto/build.gradle | 8 +++----- icon-pack-classic/build.gradle | 6 +++--- icon-pack-material/build.gradle | 6 +++--- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cd5f7ea0b..952b7da32 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -93,7 +93,7 @@ android { } } -def room_version = "2.4.2" +def room_version = "2.4.3" dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" @@ -101,14 +101,14 @@ dependencies { implementation "androidx.appcompat:appcompat:$android_appcompat_version" implementation 'androidx.preference:preference-ktx:1.2.0' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01' implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.biometric:biometric:1.1.0' implementation 'androidx.media:media:1.6.0' // Lifecycle - LiveData - ViewModel - Coroutines implementation "androidx.core:core-ktx:$android_core_version" - implementation 'androidx.fragment:fragment-ktx:1.4.1' + implementation 'androidx.fragment:fragment-ktx:1.5.1' implementation "com.google.android.material:material:$android_material_version" // Token auto complete // From sources until https://github.com/splitwise/TokenAutoComplete/pull/422 fixed diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/helpers/ExternalFileHelper.kt b/app/src/main/java/com/kunzisoft/keepass/activities/helpers/ExternalFileHelper.kt index cc12c2347..2a4ae25cf 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/helpers/ExternalFileHelper.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/helpers/ExternalFileHelper.kt @@ -56,7 +56,7 @@ class ExternalFileHelper { fun buildOpenDocument(onFileSelected: ((uri: Uri?) -> Unit)?) { - val resultCallback = ActivityResultCallback { result -> + val resultCallback = ActivityResultCallback { result -> result?.let { uri -> UriUtil.takeUriPermission(activity?.contentResolver, uri) onFileSelected?.invoke(uri) @@ -91,7 +91,7 @@ class ExternalFileHelper { fun buildCreateDocument(typeString: String = "application/octet-stream", onFileCreated: (fileCreated: Uri?)->Unit) { - val resultCallback = ActivityResultCallback { result -> + val resultCallback = ActivityResultCallback { result -> onFileCreated.invoke(result) } @@ -150,7 +150,7 @@ class ExternalFileHelper { class OpenDocument : ActivityResultContracts.OpenDocument() { @SuppressLint("InlinedApi") - override fun createIntent(context: Context, input: Array): Intent { + override fun createIntent(context: Context, input: Array): Intent { return super.createIntent(context, input).apply { addCategory(Intent.CATEGORY_OPENABLE) addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) @@ -178,11 +178,10 @@ class ExternalFileHelper { } } - class CreateDocument(private val typeString: String) : ActivityResultContracts.CreateDocument() { + class CreateDocument(typeString: String) : ActivityResultContracts.CreateDocument(typeString) { override fun createIntent(context: Context, input: String): Intent { return super.createIntent(context, input).apply { addCategory(Intent.CATEGORY_OPENABLE) - type = typeString } } } diff --git a/build.gradle b/build.gradle index f501dba35..b7ca96403 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,16 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.6.21' - ext.android_core_version = '1.7.0' - ext.android_appcompat_version = '1.4.1' - ext.android_material_version = '1.6.0' + ext.kotlin_version = '1.7.0' + ext.android_core_version = '1.8.0' + ext.android_appcompat_version = '1.4.2' + ext.android_material_version = '1.6.1' ext.android_test_version = '1.4.0' repositories { mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/crypto/build.gradle b/crypto/build.gradle index b834697a6..693dd7dbe 100644 --- a/crypto/build.gradle +++ b/crypto/build.gradle @@ -5,14 +5,12 @@ plugins { } android { - compileSdkVersion 31 - buildToolsVersion "31.0.0" + compileSdkVersion 32 + buildToolsVersion "32.0.0" defaultConfig { minSdkVersion 15 - targetSdkVersion 31 - versionCode 1 - versionName "1.0" + targetSdkVersion 32 multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/icon-pack-classic/build.gradle b/icon-pack-classic/build.gradle index 0559baee7..f5dbd2954 100644 --- a/icon-pack-classic/build.gradle +++ b/icon-pack-classic/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 31 - buildToolsVersion '31.0.0' + compileSdkVersion 32 + buildToolsVersion '32.0.0' defaultConfig { minSdkVersion 14 - targetSdkVersion 31 + targetSdkVersion 32 } resourcePrefix 'classic_' diff --git a/icon-pack-material/build.gradle b/icon-pack-material/build.gradle index a9667829b..1a5598e13 100644 --- a/icon-pack-material/build.gradle +++ b/icon-pack-material/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 31 - buildToolsVersion '31.0.0' + compileSdkVersion 32 + buildToolsVersion '32.0.0' defaultConfig { minSdkVersion 14 - targetSdkVersion 31 + targetSdkVersion 32 } resourcePrefix 'material_'