diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ecb54172..0d6cf8c07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Added - Map & Stats from selection +- support Android 12/S (API 31) ## [v1.4.8] - 2021-08-08 ### Added diff --git a/README.md b/README.md index b50198c80..b6295fa75 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Aves is a gallery and metadata explorer app. It is built for Android, with Flutt - search and filter by country, place, XMP tag, type (animated, raster, vector…) - favorites - statistics -- support Android API 20 ~ 30 (Lollipop ~ R) +- support Android API 20 ~ 31 (Lollipop ~ S) - Android integration (app shortcuts, handle view/pick intents) ## Project Setup diff --git a/android/app/build.gradle b/android/app/build.gradle index 999193448..5f17de9c9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -43,7 +43,7 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion 30 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -60,7 +60,7 @@ android { // - google_maps_flutter v2.0.5: 20 // - Aves native: 19 minSdkVersion 20 - targetSdkVersion 30 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName manifestPlaceholders = [googleApiKey: keystoreProperties['googleApiKey']] @@ -115,7 +115,7 @@ repositories { dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9' implementation 'androidx.core:core-ktx:1.6.0' - implementation 'androidx.exifinterface:exifinterface:1.3.2' + implementation 'androidx.exifinterface:exifinterface:1.3.3' implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.caverock:androidsvg-aar:1.4' implementation 'com.commonsware.cwac:document:0.4.1' diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt b/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt index 0692d7deb..c4c3ba8db 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt @@ -461,6 +461,8 @@ object StorageUtils { val effectiveUri = getOriginalUri(context, uri) return try { MediaMetadataRetriever().apply { + // on Android S preview, setting the data source works but yields an internal IOException + // (`Input file descriptor already original`), whether we provide the original URI or not setDataSource(context, effectiveUri) } } catch (e: Exception) { diff --git a/android/build.gradle b/android/build.gradle index 37844e272..ab428ae27 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.8' + classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' } } diff --git a/lib/model/entry.dart b/lib/model/entry.dart index 50a3f8a28..89c12f1cc 100644 --- a/lib/model/entry.dart +++ b/lib/model/entry.dart @@ -238,9 +238,10 @@ class AvesEntry { bool get canRotateAndFlip => canEdit && canEditExif; // support for writing EXIF - // as of androidx.exifinterface:exifinterface:1.3.0 + // as of androidx.exifinterface:exifinterface:1.3.3 bool get canEditExif { switch (mimeType.toLowerCase()) { + case MimeTypes.dng: case MimeTypes.jpeg: case MimeTypes.png: case MimeTypes.webp: diff --git a/lib/widgets/aves_app.dart b/lib/widgets/aves_app.dart index 6a142abe3..17f005d94 100644 --- a/lib/widgets/aves_app.dart +++ b/lib/widgets/aves_app.dart @@ -123,17 +123,19 @@ class _AvesAppState extends State { } Future _setup() async { - await Firebase.initializeApp().then((app) { + await Firebase.initializeApp().then((app) async { FlutterError.onError = reportService.recordFlutterError; final now = DateTime.now(); - reportService.setCustomKeys({ - 'locales': window.locales.join(', '), - 'time_zone': '${now.timeZoneName} (${now.timeZoneOffset})', + final hasPlayServices = await availability.hasPlayServices; + await reportService.setCustomKeys({ 'build_mode': kReleaseMode ? 'release' : kProfileMode ? 'profile' : 'debug', + 'has_play_services': hasPlayServices, + 'locales': window.locales.join(', '), + 'time_zone': '${now.timeZoneName} (${now.timeZoneOffset})', }); }); await settings.init(); diff --git a/scripts/fix_android_log_levels.bat b/scripts/fix_android_log_levels.bat index 520b0df2d..12d5967b2 100644 --- a/scripts/fix_android_log_levels.bat +++ b/scripts/fix_android_log_levels.bat @@ -14,6 +14,8 @@ adb.exe shell setprop log.tag.AudioTrack INFO adb.exe shell setprop log.tag.CompatibilityChangeReporter INFO adb.exe shell setprop log.tag.Counters WARN adb.exe shell setprop log.tag.CustomizedTextParser INFO +adb.exe shell setprop log.tag.EGL_emulation INFO +adb.exe shell setprop log.tag.HostConnection INFO adb.exe shell setprop log.tag.InputMethodManager WARN adb.exe shell setprop log.tag.InsetsSourceConsumer INFO adb.exe shell setprop log.tag.InputTransport INFO @@ -22,6 +24,7 @@ adb.exe shell setprop log.tag.MediaCodec WARN adb.exe shell setprop log.tag.MediaMetadataRetriever INFO adb.exe shell setprop log.tag.MediaMetadataRetrieverJNI INFO adb.exe shell setprop log.tag.NuMediaExtractor INFO +adb.exe shell setprop log.tag.skia INFO adb.exe shell setprop log.tag.SurfaceControl WARN adb.exe shell setprop log.tag.SurfaceUtils INFO adb.exe shell setprop log.tag.SurfaceView WARN diff --git a/scripts/fix_android_log_levels.sh b/scripts/fix_android_log_levels.sh new file mode 100755 index 000000000..3771741a1 --- /dev/null +++ b/scripts/fix_android_log_levels.sh @@ -0,0 +1,23 @@ +#!/bin/bash +adb shell setprop log.tag.ACodec WARN +adb shell setprop log.tag.AHierarchicalStateMachine ERROR +adb shell setprop log.tag.AudioCapabilities ERROR +adb shell setprop log.tag.AudioTrack INFO +adb shell setprop log.tag.CompatibilityChangeReporter INFO +adb shell setprop log.tag.Counters WARN +adb shell setprop log.tag.CustomizedTextParser INFO +adb shell setprop log.tag.EGL_emulation INFO +adb shell setprop log.tag.HostConnection INFO +adb shell setprop log.tag.InputMethodManager WARN +adb shell setprop log.tag.InsetsSourceConsumer INFO +adb shell setprop log.tag.InputTransport INFO +adb shell setprop log.tag.J4A INFO +adb shell setprop log.tag.MediaCodec WARN +adb shell setprop log.tag.MediaMetadataRetriever INFO +adb shell setprop log.tag.MediaMetadataRetrieverJNI INFO +adb shell setprop log.tag.NuMediaExtractor INFO +adb shell setprop log.tag.skia INFO +adb shell setprop log.tag.SurfaceControl WARN +adb shell setprop log.tag.SurfaceUtils INFO +adb shell setprop log.tag.SurfaceView WARN +adb shell setprop log.tag.VideoCapabilities ERROR