From 3850f0ed5a0e3043ea64a78e549f5b5e3b4b1cad Mon Sep 17 00:00:00 2001 From: Rodrigo Moraes Date: Tue, 7 Nov 2023 11:28:24 -0300 Subject: [PATCH 1/2] fix: Ajuste para biblioteca do android Broadcast respeitas as regras do android 12, ajuste no nome do aplicativo, ajuste no launch do aplicativo, ajuste para gerar um build assinado --- src/MobileApp/android/.gitignore | 1 + src/MobileApp/android/app/build.gradle | 18 +++++++++++++++--- .../android/app/src/main/AndroidManifest.xml | 19 ++++++++++++++++--- src/MobileApp/android/build.gradle | 2 ++ src/MobileApp/pubspec.yaml | 2 +- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/MobileApp/android/.gitignore b/src/MobileApp/android/.gitignore index 0a741cb4..9b7c0982 100644 --- a/src/MobileApp/android/.gitignore +++ b/src/MobileApp/android/.gitignore @@ -9,3 +9,4 @@ 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 \ No newline at end of file diff --git a/src/MobileApp/android/app/build.gradle b/src/MobileApp/android/app/build.gradle index 98c87274..c14887da 100644 --- a/src/MobileApp/android/app/build.gradle +++ b/src/MobileApp/android/app/build.gradle @@ -5,6 +5,11 @@ if (localPropertiesFile.exists()) { localProperties.load(reader) } } +def keystoreProperties = new Properties() + def keystorePropertiesFile = rootProject.file('key.properties') + if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { @@ -42,15 +47,22 @@ android { minSdkVersion 21 targetSdkVersion 33 ndkVersion "25.1.8937393" + multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release } } } diff --git a/src/MobileApp/android/app/src/main/AndroidManifest.xml b/src/MobileApp/android/app/src/main/AndroidManifest.xml index ff038206..92a193b9 100644 --- a/src/MobileApp/android/app/src/main/AndroidManifest.xml +++ b/src/MobileApp/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@