android 12 support

This commit is contained in:
Thibault Deckers 2021-08-16 09:46:57 +09:00
parent 8669f34bad
commit 8d1352d3df
9 changed files with 42 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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'

View file

@ -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) {

View file

@ -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'
}
}

View file

@ -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:

View file

@ -123,17 +123,19 @@ class _AvesAppState extends State<AvesApp> {
}
Future<void> _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();

View file

@ -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

View file

@ -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