Merge remote-tracking branch 'origin/main'
# Conflicts: # android/app/src/main/kotlin/es/freetimelab/pluriwave/AlarmScheduler.kt
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
import java.util.Properties
|
||||
|
||||
val keystoreProperties = Properties()
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystorePropertiesFile.inputStream().use { keystoreProperties.load(it) }
|
||||
}
|
||||
|
||||
fun secret(name: String, propertyName: String): String? =
|
||||
keystoreProperties.getProperty(propertyName)?.takeIf { it.isNotBlank() }
|
||||
?: System.getenv(name)?.takeIf { it.isNotBlank() }
|
||||
|
||||
android {
|
||||
namespace = "es.freetimelab.pluriwave"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
@@ -20,21 +31,38 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "es.freetimelab.pluriwave"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
val storeFilePath = secret("KEYSTORE_PATH", "storeFile")
|
||||
val storePasswordValue = secret("KEYSTORE_PASSWORD", "storePassword")
|
||||
val keyAliasValue = secret("KEYSTORE_ALIAS", "keyAlias")
|
||||
val keyPasswordValue = secret("KEY_PASSWORD", "keyPassword")
|
||||
|
||||
if (!storeFilePath.isNullOrBlank()) {
|
||||
storeFile = file(storeFilePath)
|
||||
}
|
||||
if (!storePasswordValue.isNullOrBlank()) {
|
||||
storePassword = storePasswordValue
|
||||
}
|
||||
if (!keyAliasValue.isNullOrBlank()) {
|
||||
keyAlias = keyAliasValue
|
||||
}
|
||||
if (!keyPasswordValue.isNullOrBlank()) {
|
||||
keyPassword = keyPasswordValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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.getByName("debug")
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,7 +508,8 @@ class AlarmScheduler(private val context: Context) {
|
||||
appContext,
|
||||
requestCode(id, 2),
|
||||
Intent(appContext, MainActivity::class.java).apply {
|
||||
this.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||
this.flags =
|
||||
Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||
putExtra(PluriWaveAlarmReceiver.EXTRA_ALARM_ACTION, PluriWaveAlarmReceiver.ACTION_FIRE)
|
||||
},
|
||||
flags or PendingIntent.FLAG_IMMUTABLE
|
||||
|
||||
Reference in New Issue
Block a user