diff --git a/.gitignore b/.gitignore index 29a3a50..9d2a5f0 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release +/android/build/ diff --git a/android/app/build.gradle b/android/app/build.gradle index f53969b..cef6b80 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -5,6 +5,10 @@ plugins { id "dev.flutter.flutter-gradle-plugin" } +def keystorePropertiesFile = rootProject.file("key.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { namespace = "com.czg.cashier_reserve" compileSdk = flutter.compileSdkVersion @@ -21,21 +25,39 @@ android { } defaultConfig { - applicationId = "com.czg.cashier_reserve" + applicationId = "com.czg.cashierReserve" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion - versionCode = flutter.versionCode - versionName = flutter.versionName + versionCode = 1 + versionName = "1.0.0" minSdkVersion 26 targetSdkVersion 33 } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + debug { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + 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 } + debug { + signingConfig signingConfigs.release + } } } @@ -43,6 +65,12 @@ flutter { source = "../.." } +configurations.all { + resolutionStrategy { + force 'androidx.core:core-ktx:1.6.0' + } +} + dependencies { implementation(name:'callmodule-release',ext:'aar') implementation('com.android.support:appcompat-v7:28.0.0') diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index df42668..b40c911 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -18,4 +18,5 @@ -dontwarn org.linphone.core.Reason -dontwarn org.linphone.core.VideoActivationPolicy -dontwarn org.linphone.core.tools.Log --dontwarn org.linphone.core.tools.receiver.BluetoothReceiver \ No newline at end of file +-dontwarn org.linphone.core.tools.receiver.BluetoothReceiver +-dontwarn com.kaer.subutil.R$string \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f7d33aa..8b5fbe9 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -3,7 +3,7 @@ - if (project.plugins.hasPlugin('com.android.library') || project.plugins.hasPlugin('com.android.application')) { - println "project: ${project.name} Namespace get: ${project.android.namespace}" - def packageName = project.android.namespace ?: project.android.defaultConfig.applicationId ?: project.android.sourceSets.main.manifest.srcFile.text.find(/package="([^"]*)"/) ?: project.group -// project.android.namespace = packageName -// println "Namespace set to: ${packageName} for project: ${project.name}" - - // 如果包名不包含 "com.baidu",则设置命名空间 - if (packageName.contains('com.baidu')) { - println "Skipping namespace setting for project ${project.name} as the package name contains 'com.baidu' or 'isar_flutter_libs'" - } else { - project.android.namespace = packageName - println "Namespace set to: ${packageName} for project: ${project.name}" +// if (project.plugins.hasPlugin('com.android.library') || project.plugins.hasPlugin('com.android.application')) { +// println "project: ${project.name} Namespace get: ${project.android.namespace}" +// def packageName = project.android.namespace ?: project.android.defaultConfig.applicationId ?: project.android.sourceSets.main.manifest.srcFile.text.find(/package="([^"]*)"/) ?: project.group +//// project.android.namespace = packageName +//// println "Namespace set to: ${packageName} for project: ${project.name}" +// +// // 如果包名不包含 "com.baidu",则设置命名空间 +// if (packageName.contains('com.baidu')) { +// println "Skipping namespace setting for project ${project.name} as the package name contains 'com.baidu' or 'isar_flutter_libs'" +// } else { +// project.android.namespace = packageName +// println "Namespace set to: ${packageName} for project: ${project.name}" +// } +// } + if (project.plugins.hasPlugin("com.android.application") || + project.plugins.hasPlugin("com.android.library")) { + project.android { + compileSdkVersion 34 + buildToolsVersion "34.0.0" + } + } + if (project.hasProperty("android")) { + project.android { + if (namespace == null) { + namespace project.group + } } } } + + // ============ + project.buildDir = "${rootProject.buildDir}/${project.name}" +// project.evaluationDependsOn(":app") } rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { +//} +//subprojects { project.evaluationDependsOn(":app") } diff --git a/android/key.jks b/android/key.jks new file mode 100644 index 0000000..e59f617 Binary files /dev/null and b/android/key.jks differ