mirror of
https://github.com/This-null/flexcam.git
synced 2026-09-03 07:53:51 +08:00
- Add a release signing config that reads keystore.properties when present - Keep debug builds working when the key file is absent - Enable v2 and v3 signature schemes so the key can be rotated later - Ignore keystores and keystore.properties so secrets stay out of the repo
69 lines
2.0 KiB
Kotlin
69 lines
2.0 KiB
Kotlin
import java.io.FileInputStream
|
|
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
android {
|
|
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
val keystoreProperties = Properties()
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
namespace = "com.flexcam"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
applicationId = "com.flexcam"
|
|
minSdk = 24
|
|
targetSdk = 36
|
|
versionCode = 4
|
|
versionName = "1.3"
|
|
}
|
|
|
|
signingConfigs {
|
|
if (keystorePropertiesFile.exists()) {
|
|
create("release") {
|
|
storeFile = file(keystoreProperties["storeFile"] as String)
|
|
storePassword = keystoreProperties["storePassword"] as String
|
|
keyAlias = keystoreProperties["keyAlias"] as String
|
|
keyPassword = keystoreProperties["keyPassword"] as String
|
|
enableV2Signing = true
|
|
enableV3Signing = true
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
if (keystorePropertiesFile.exists()) {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
val camerax = "1.4.1"
|
|
implementation("androidx.camera:camera-core:$camerax")
|
|
implementation("androidx.camera:camera-camera2:$camerax")
|
|
implementation("androidx.camera:camera-lifecycle:$camerax")
|
|
implementation("androidx.camera:camera-view:$camerax")
|
|
implementation("androidx.appcompat:appcompat:1.7.0")
|
|
implementation("androidx.core:core-ktx:1.13.1")
|
|
implementation("androidx.activity:activity-ktx:1.9.3")
|
|
implementation("androidx.lifecycle:lifecycle-service:2.8.7")
|
|
}
|