diff --git a/android/.gitignore b/android/.gitignore index 65b7315af..6f568019d 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -1,10 +1,13 @@ -*.iml -*.class -.gradle +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat /local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle.dev b/android/app/build.gradle.dev index b5edef9da..128047c4b 100644 --- a/android/app/build.gradle.dev +++ b/android/app/build.gradle.dev @@ -26,16 +26,21 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' } - lintOptions { - disable 'InvalidPackage' - } - defaultConfig { applicationId "com.invoiceninja.app" minSdkVersion 19 diff --git a/android/app/build.gradle.prod b/android/app/build.gradle.prod index 0d7a35d3c..6fe1914a9 100644 --- a/android/app/build.gradle.prod +++ b/android/app/build.gradle.prod @@ -31,16 +31,21 @@ def keystoreProperties = new Properties() keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) android { - compileSdkVersion 30 + compileSdkVersion 31 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' } - lintOptions { - disable 'InvalidPackage' - } - defaultConfig { applicationId "com.invoiceninja.app" minSdkVersion 19 @@ -59,6 +64,7 @@ android { storePassword keystoreProperties['storePassword'] } } + buildTypes { debug { signingConfig signingConfigs.release diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index dd79b1b95..08490728f 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,8 @@ - + diff --git a/android/app/src/main/AndroidManifest.foss.xml b/android/app/src/main/AndroidManifest.foss.xml index 8fcd3649f..70b558a1a 100644 --- a/android/app/src/main/AndroidManifest.foss.xml +++ b/android/app/src/main/AndroidManifest.foss.xml @@ -17,35 +17,26 @@ android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" + android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> + + - - - - - - - - + + - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8fcd3649f..70b558a1a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -17,35 +17,26 @@ android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" + android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> + + - - - - - - - - + + - diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..204c5f484 --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/android/app/src/main/res/drawable-v21/logo.png b/android/app/src/main/res/drawable-v21/logo.png new file mode 100644 index 000000000..cf6386b18 Binary files /dev/null and b/android/app/src/main/res/drawable-v21/logo.png differ diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 95dbd10d2..f114f65cc 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -3,10 +3,10 @@ + + android:gravity="center" + android:src="@drawable/logo" /> - diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index d3d98ef96..591bb70a8 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,6 +1,7 @@ - - - - diff --git a/android/app/src/main/res/xml/provider_paths.xml b/android/app/src/main/res/xml/provider_paths.xml deleted file mode 100644 index ffa74ab56..000000000 --- a/android/app/src/main/res/xml/provider_paths.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index dd79b1b95..cae07737d 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,8 +1,9 @@ - + - diff --git a/android/build.gradle b/android/build.gradle index 397355fbf..87b851297 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.72' + ext.kotlin_version = '1.3.50' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' + classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.google.gms:google-services:4.3.10' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } @@ -15,18 +15,16 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { project.evaluationDependsOn(':app') } task clean(type: Delete) { delete rootProject.buildDir -} \ No newline at end of file +} diff --git a/android/build.gradle.foss b/android/build.gradle.foss index 2d2af0acd..ed45c6588 100644 --- a/android/build.gradle.foss +++ b/android/build.gradle.foss @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.72' + ext.kotlin_version = '1.3.50' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' + classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -14,15 +14,13 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { project.evaluationDependsOn(':app') } diff --git a/android/gradle.properties b/android/gradle.properties index 98cb8719d..9a334c62e 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ -android.enableJetifier=true -android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true android.enableR8=true android.enableDexingArtifactTransform=false diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 939efa295..bc6a58afd 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14fb1..44e62bcf0 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,11 @@ include ':app' -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/android/settings_aar.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/pubspec.foss.yaml b/pubspec.foss.yaml index 115b53603..00036558b 100644 --- a/pubspec.foss.yaml +++ b/pubspec.foss.yaml @@ -55,7 +55,7 @@ dependencies: flutter_launcher_icons: ^0.9.1 overflow_view: ^0.3.1 flutter_styled_toast: ^2.0.0 - permission_handler: ^8.1.4+2 + permission_handler: ^8.3.0 file_picker: ^4.2.3 draggable_scrollbar: ^0.1.0 boardview: ^0.2.2 diff --git a/pubspec.next.yaml b/pubspec.next.yaml index 9223726f5..588a8c2ae 100644 --- a/pubspec.next.yaml +++ b/pubspec.next.yaml @@ -55,7 +55,7 @@ dependencies: flutter_launcher_icons: ^0.9.1 overflow_view: ^0.3.1 flutter_styled_toast: ^2.0.0 - permission_handler: ^8.1.4+2 + permission_handler: ^8.3.0 file_picker: ^4.2.3 draggable_scrollbar: ^0.1.0 boardview: ^0.2.2 diff --git a/pubspec.yaml b/pubspec.yaml index 9223726f5..588a8c2ae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -55,7 +55,7 @@ dependencies: flutter_launcher_icons: ^0.9.1 overflow_view: ^0.3.1 flutter_styled_toast: ^2.0.0 - permission_handler: ^8.1.4+2 + permission_handler: ^8.3.0 file_picker: ^4.2.3 draggable_scrollbar: ^0.1.0 boardview: ^0.2.2