From dfcaf4d35ab8478d99467bea570f61787d694424 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 9 Jun 2025 18:47:11 +0200 Subject: [PATCH] upgrades --- android/app/build.gradle | 18 +++++------ .../aves/channel/calls/AnalysisHandler.kt | 8 ++--- .../aves/channel/calls/DeviceHandler.kt | 2 ++ .../aves/channel/calls/GeocodingHandler.kt | 9 ++---- .../aves/channel/calls/GlobalSearchHandler.kt | 4 +-- .../aves/channel/calls/SecurityHandler.kt | 4 +-- .../thibault/aves/metadata/PixyMetaHelper.kt | 4 +-- .../deckers/thibault/aves/utils/MathUtils.kt | 2 +- android/settings.gradle.kts | 8 ++--- lib/services/geocoding_service.dart | 2 +- plugins/aves_services_google/lib/src/map.dart | 2 +- pubspec.lock | 32 +++---------------- 12 files changed, 34 insertions(+), 61 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index bb6a533fb..3a55aab39 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -33,13 +33,13 @@ kotlin { } android { - namespace 'deckers.thibault.aves' - compileSdk 35 + namespace = 'deckers.thibault.aves' + compileSdk = 36 defaultConfig { applicationId packageName minSdk flutter.minSdkVersion - targetSdk 35 + targetSdk 36 versionCode flutter.versionCode versionName flutter.versionName manifestPlaceholders = [googleApiKey: keystoreProperties["googleApiKey"] ?: ""] @@ -149,14 +149,14 @@ repositories { } dependencies { - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2' - implementation "androidx.appcompat:appcompat:1.7.0" + implementation "androidx.appcompat:appcompat:1.7.1" implementation 'androidx.core:core-ktx:1.16.0' - implementation 'androidx.lifecycle:lifecycle-process:2.9.0' + implementation 'androidx.lifecycle:lifecycle-process:2.9.1' implementation 'androidx.media:media:1.7.0' implementation 'androidx.multidex:multidex:2.0.1' - implementation 'androidx.security:security-crypto:1.1.0-alpha07' + implementation 'androidx.security:security-crypto:1.1.0-beta01' implementation 'androidx.work:work-runtime-ktx:2.10.1' implementation 'com.commonsware.cwac:document:0.5.0' @@ -164,7 +164,7 @@ dependencies { implementation "com.github.bumptech.glide:glide:$glide_version" implementation 'com.google.android.material:material:1.12.0' // SLF4J implementation for `mp4parser` - implementation 'org.slf4j:slf4j-simple:2.0.16' + implementation 'org.slf4j:slf4j-simple:2.0.17' // forked, built by JitPack: // - https://jitpack.io/p/deckerst/Android-TiffBitmapFactory @@ -178,7 +178,7 @@ dependencies { implementation 'com.github.deckerst:pixymeta-android:cb1cdc932e' implementation project(':exifinterface') - testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.4' + testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.13.1' kapt 'androidx.annotation:annotation:1.9.1' ksp "com.github.bumptech.glide:ksp:$glide_version" diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/AnalysisHandler.kt b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/AnalysisHandler.kt index 0ee874058..cc7b46e52 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/AnalysisHandler.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/AnalysisHandler.kt @@ -2,6 +2,7 @@ package deckers.thibault.aves.channel.calls import android.app.ActivityManager import android.content.Context +import androidx.core.content.edit import androidx.work.ExistingWorkPolicy import androidx.work.OneTimeWorkRequestBuilder import androidx.work.WorkInfo @@ -18,7 +19,6 @@ import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking - class AnalysisHandler(private val activity: FlutterFragmentActivity, private val onAnalysisCompleted: () -> Unit) : MethodChannel.MethodCallHandler { private val ioScope = CoroutineScope(SupervisorJob() + Dispatchers.IO) @@ -38,9 +38,8 @@ class AnalysisHandler(private val activity: FlutterFragmentActivity, private val } val preferences = activity.getSharedPreferences(AnalysisWorker.SHARED_PREFERENCES_KEY, Context.MODE_PRIVATE) - with(preferences.edit()) { + preferences.edit { putLong(AnalysisWorker.PREF_CALLBACK_HANDLE_KEY, callbackHandle) - apply() } result.success(true) } @@ -69,9 +68,8 @@ class AnalysisHandler(private val activity: FlutterFragmentActivity, private val // work `Data` cannot occupy more than 10240 bytes when serialized // so we save the possibly long list of entry IDs to shared preferences val preferences = activity.getSharedPreferences(AnalysisWorker.SHARED_PREFERENCES_KEY, Context.MODE_PRIVATE) - with(preferences.edit()) { + preferences.edit { putStringSet(AnalysisWorker.PREF_ENTRY_IDS_KEY, allEntryIds?.map { it.toString() }?.toSet()) - apply() } val workData = workDataOf( diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DeviceHandler.kt b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DeviceHandler.kt index e727a1c99..8d09be3e1 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DeviceHandler.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DeviceHandler.kt @@ -1,5 +1,6 @@ package deckers.thibault.aves.channel.calls +import android.annotation.SuppressLint import android.app.LocaleConfig import android.app.LocaleManager import android.content.Context @@ -102,6 +103,7 @@ class DeviceHandler(private val context: Context) : MethodCallHandler { } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + @SuppressLint("WrongConstant") val lm = context.getSystemService(Context.LOCALE_SERVICE) as? LocaleManager lm?.overrideLocaleConfig = LocaleConfig(LocaleList.forLanguageTags(locales.joinToString(","))) } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GeocodingHandler.kt b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GeocodingHandler.kt index 6af0642e2..d8379b59f 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GeocodingHandler.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GeocodingHandler.kt @@ -31,7 +31,7 @@ class GeocodingHandler(private val context: Context) : MethodCallHandler { private fun getAddress(call: MethodCall, result: MethodChannel.Result) { val latitude = call.argument("latitude")?.toDouble() val longitude = call.argument("longitude")?.toDouble() - val localeString = call.argument("locale") + val localeLanguageTag = call.argument("localeLanguageTag") val maxResults = call.argument("maxResults") ?: 1 if (latitude == null || longitude == null) { result.error("getAddress-args", "missing arguments", null) @@ -43,11 +43,8 @@ class GeocodingHandler(private val context: Context) : MethodCallHandler { return } - geocoder = geocoder ?: if (localeString != null) { - val split = localeString.split("_") - val language = split[0] - val country = if (split.size > 1) split[1] else "" - Geocoder(context, Locale(language, country)) + geocoder = geocoder ?: if (localeLanguageTag != null) { + Geocoder(context, Locale.forLanguageTag(localeLanguageTag)) } else { Geocoder(context) } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GlobalSearchHandler.kt b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GlobalSearchHandler.kt index 4ccb395af..b3704db8f 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GlobalSearchHandler.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/GlobalSearchHandler.kt @@ -1,6 +1,7 @@ package deckers.thibault.aves.channel.calls import android.content.Context +import androidx.core.content.edit import deckers.thibault.aves.SearchSuggestionsProvider import deckers.thibault.aves.channel.calls.Coresult.Companion.safe import io.flutter.plugin.common.MethodCall @@ -29,9 +30,8 @@ class GlobalSearchHandler(private val context: Context) : MethodCallHandler { } val preferences = context.getSharedPreferences(SearchSuggestionsProvider.SHARED_PREFERENCES_KEY, Context.MODE_PRIVATE) - with(preferences.edit()) { + preferences.edit { putLong(SearchSuggestionsProvider.CALLBACK_HANDLE_KEY, callbackHandle) - apply() } result.success(true) } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/SecurityHandler.kt b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/SecurityHandler.kt index 336cb4546..1263ce759 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/SecurityHandler.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/SecurityHandler.kt @@ -2,6 +2,7 @@ package deckers.thibault.aves.channel.calls import android.content.Context import android.content.SharedPreferences +import androidx.core.content.edit import androidx.security.crypto.EncryptedSharedPreferences import androidx.security.crypto.MasterKey import deckers.thibault.aves.channel.calls.Coresult.Companion.safe @@ -45,7 +46,7 @@ class SecurityHandler(private val context: Context) : MethodCallHandler { } val preferences = getStore() - with(preferences.edit()) { + preferences.edit { when (value) { is Boolean -> putBoolean(key, value) is Float -> putFloat(key, value) @@ -58,7 +59,6 @@ class SecurityHandler(private val context: Context) : MethodCallHandler { return } } - apply() } result.success(true) } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/PixyMetaHelper.kt b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/PixyMetaHelper.kt index e1d11786e..2f3b17a02 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/metadata/PixyMetaHelper.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/metadata/PixyMetaHelper.kt @@ -81,12 +81,12 @@ object PixyMetaHelper { output: OutputStream, iptcDataList: List?, ) { - val iptc = iptcDataList?.flatMap { + val iptc: List = iptcDataList?.flatMap { val record = it["record"] as Int val tag = it["tag"] as Int val values = it["values"] as List<*> values.map { data -> IPTCDataSet(IPTCRecord.fromRecordNumber(record), tag, data as ByteArray) } - } ?: ArrayList() + } ?: ArrayList() Metadata.insertIPTC(input, output, iptc) } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/utils/MathUtils.kt b/android/app/src/main/kotlin/deckers/thibault/aves/utils/MathUtils.kt index 8935cd712..7002c07f0 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/utils/MathUtils.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/utils/MathUtils.kt @@ -5,5 +5,5 @@ import kotlin.math.pow object MathUtils { fun highestPowerOf2(x: Int): Int = highestPowerOf2(x.toDouble()) - private fun highestPowerOf2(x: Double): Int = if (x < 1) 0 else 2.toDouble().pow(log2(x).toInt()).toInt() + fun highestPowerOf2(x: Double): Int = if (x < 1) 0 else 2.toDouble().pow(log2(x).toInt()).toInt() } \ No newline at end of file diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 89d573443..1a1c00e25 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -18,10 +18,10 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.8.1" apply false - id("org.jetbrains.kotlin.android") version "2.1.10" apply false - id("com.google.devtools.ksp") version "2.1.10-1.0.29" apply false - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" + id("com.android.application") version "8.10.1" apply false + id("org.jetbrains.kotlin.android") version "2.1.21" apply false + id("com.google.devtools.ksp") version "2.1.21-2.0.1" apply false + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } include(":app") diff --git a/lib/services/geocoding_service.dart b/lib/services/geocoding_service.dart index c84390d93..48a2f4a70 100644 --- a/lib/services/geocoding_service.dart +++ b/lib/services/geocoding_service.dart @@ -15,7 +15,7 @@ class GeocodingService { final result = await _platform.invokeMethod('getAddress', { 'latitude': coordinates.latitude, 'longitude': coordinates.longitude, - 'locale': locale.toString(), + 'localeLanguageTag': locale.toLanguageTag(), // we only really need one address, but sometimes the native geocoder // returns nothing with `maxResults` of 1, but succeeds with `maxResults` of 2+ 'maxResults': 2, diff --git a/plugins/aves_services_google/lib/src/map.dart b/plugins/aves_services_google/lib/src/map.dart index 5c4f4eb72..4957e8e68 100644 --- a/plugins/aves_services_google/lib/src/map.dart +++ b/plugins/aves_services_google/lib/src/map.dart @@ -209,7 +209,7 @@ class _EntryGoogleMapState extends State> { bitmapScaling: MapBitmapScaling.none, ), position: _toServiceLatLng(dotLocation), - zIndex: 1, + zIndexInt: 1, ) }, polylines: { diff --git a/pubspec.lock b/pubspec.lock index fd9594647..97bc3f0ac 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -112,14 +112,6 @@ packages: url: "https://github.com/deckerst/flutter_google_charts.git" source: git version: "0.12.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" - source: hosted - version: "2.0.3" cli_config: dependency: transitive description: @@ -180,10 +172,10 @@ packages: dependency: transitive description: name: coverage - sha256: "4b8701e48a58f7712492c9b1f7ba0bb9d525644dd66d023b62e1fc8cdb560c8a" + sha256: aa07dbe5f2294c827b7edb9a87bba44a9c15a3cc81bc8da2ca19b37322d30080 url: "https://pub.dev" source: hosted - version: "1.14.0" + version: "1.14.1" crypto: dependency: transitive description: @@ -588,10 +580,10 @@ packages: dependency: transitive description: name: google_maps_flutter_platform_interface - sha256: "970c8f766c02909c7be282dea923c971f83a88adaf07f8871d0aacebc3b07bb2" + sha256: f8293f072ed8b068b092920a72da6693aa8b3d62dc6b5c5f0bc44c969a8a776c url: "https://pub.dev" source: hosted - version: "2.11.1" + version: "2.12.1" google_maps_flutter_web: dependency: transitive description: @@ -680,14 +672,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.1" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://pub.dev" - source: hosted - version: "4.9.0" latlong2: dependency: "direct main" description: @@ -1234,14 +1218,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" - url: "https://pub.dev" - source: hosted - version: "1.5.0" qr: dependency: transitive description: