plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" } def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } boolean hasKeyStore = false def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) hasKeyStore = true } else { println "+++" println "No keystore defined. The app will not be signed." println "Create a android/key.properties file with the following properties:" println "storePassword" println "keyPassword" println "keyAlias" println "storeFile" println "+++" } def flutterVersionCode = localProperties.getProperty('flutter.versionCode')?: '1' def flutterVersionName = localProperties.getProperty('flutter.versionName') ?: '1.0' android { namespace 'com.hiddify.hiddify' testNamespace "test.com.hiddify.hiddify" compileSdkVersion 34 ndkVersion "26.1.10909125" compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = '17' } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { applicationId "com.hiddify.app.test" minSdkVersion 21 targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } splits { abi { enable true reset() //noinspection ChromeOsAbiSupport include "x86_64", "armeabi-v7a", "arm64-v8a" universalApk true } } if (hasKeyStore) { signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile file(keystoreProperties['storeFile']) storePassword keystoreProperties['storePassword'] } } } buildTypes { release { if (hasKeyStore) { signingConfig signingConfigs.release } else { signingConfig signingConfigs.debug } ndk { //noinspection ChromeOsAbiSupport abiFilters "x86_64", "armeabi-v7a", "arm64-v8a" debugSymbolLevel 'FULL' } } } buildFeatures { viewBinding true aidl true } } android.applicationVariants.all { variant -> variant.outputs.each { output -> output.versionCodeOverride = android.defaultConfig.versionCode } } flutter { source '../..' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation 'com.google.code.gson:gson:2.10.1' implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2' }