Files
umbrix/android/app/build.gradle

125 lines
3.2 KiB
Groovy
Raw Normal View History

2024-03-06 22:50:05 +03:30
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
2023-07-06 17:18:41 +03:30
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
2023-10-11 17:38:02 +03:30
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 "+++"
}
2024-06-01 14:29:41 +02:00
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')?: '1'
2023-07-06 17:18:41 +03:30
2024-06-01 14:29:41 +02:00
def flutterVersionName = localProperties.getProperty('flutter.versionName') ?: '1.0'
2023-07-06 17:18:41 +03:30
android {
2024-05-31 23:01:00 +02:00
namespace 'com.hiddify.hiddify'
testNamespace "test.com.hiddify.hiddify"
2024-07-27 23:39:36 +02:00
compileSdkVersion 35
2023-10-15 15:56:26 +03:30
ndkVersion "26.1.10909125"
2023-07-06 17:18:41 +03:30
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
2023-08-21 14:27:23 +00:00
applicationId "app.hiddify.com"
2023-07-06 17:18:41 +03:30
minSdkVersion 21
2024-07-27 23:39:36 +02:00
targetSdkVersion 35
2023-07-06 17:18:41 +03:30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
2023-09-23 00:54:17 +03:30
2023-08-22 08:05:05 +00:00
splits {
2023-09-23 00:54:17 +03:30
abi {
enable true
reset()
2023-10-11 17:38:02 +03:30
//noinspection ChromeOsAbiSupport
2023-09-23 00:54:17 +03:30
include "x86_64", "armeabi-v7a", "arm64-v8a"
universalApk true
}
2023-08-22 08:05:05 +00:00
}
2023-08-22 09:01:36 +00:00
2023-10-11 17:38:02 +03:30
if (hasKeyStore) {
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
2023-07-06 17:18:41 +03:30
}
}
2023-10-11 17:38:02 +03:30
2023-08-22 09:01:36 +00:00
buildTypes {
release {
2023-10-11 17:38:02 +03:30
if (hasKeyStore) {
signingConfig signingConfigs.release
} else {
signingConfig signingConfigs.debug
}
2023-09-23 00:54:17 +03:30
ndk {
2023-10-11 17:38:02 +03:30
//noinspection ChromeOsAbiSupport
2023-09-23 00:54:17 +03:30
abiFilters "x86_64", "armeabi-v7a", "arm64-v8a"
2023-10-15 15:56:26 +03:30
debugSymbolLevel 'FULL'
2023-09-23 00:54:17 +03:30
}
2023-08-22 09:01:36 +00:00
}
}
2023-08-22 08:05:05 +00:00
2023-08-19 22:27:23 +03:30
buildFeatures {
viewBinding true
aidl true
}
2023-09-23 00:54:17 +03:30
}
android.applicationVariants.all { variant ->
2023-09-23 00:54:17 +03:30
variant.outputs.each { output ->
output.versionCodeOverride = android.defaultConfig.versionCode
}
2023-07-06 17:18:41 +03:30
}
flutter {
source '../..'
}
dependencies {
2023-09-23 00:54:17 +03:30
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
2023-08-29 19:16:17 +03:30
implementation 'com.google.code.gson:gson:2.10.1'
2023-12-21 16:19:22 +03:30
implementation 'androidx.core:core-ktx:1.12.0'
2023-08-19 22:27:23 +03:30
implementation 'androidx.appcompat:appcompat:1.6.1'
2023-12-21 16:19:22 +03:30
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
2023-10-15 15:56:26 +03:30
}