mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-12 08:31:05 +01:00
All three were delegated to the Flutter Gradle plugin, so there was no floor to reason about — and full-screen-intent and foreground-service semantics both changed at API 34/35, which is exactly the code the alarm path needs. - compileSdk/targetSdk = 36, matching the target phone. - minSdk = 28: the floor for android:showWhenLocked / android:turnScreenOn as plain manifest attributes (no legacy branch), which also clears flutter_secure_storage's API 23 and Flutter's own default of 24. Verified with `flutter build apk --debug` (exit 0). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EckWmyfetYq3Mi8MAnUudh
75 lines
2.6 KiB
Plaintext
75 lines
2.6 KiB
Plaintext
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
}
|
|
|
|
// Release signing key, kept out of the repo. CI writes key.properties from
|
|
// repository secrets; locally the file is absent and the build falls back to
|
|
// the debug key so `flutter run --release` still works. Every release APK is
|
|
// signed with the one shared key, so updates install over each other instead
|
|
// of forcing an uninstall.
|
|
val keystoreProperties = Properties().apply {
|
|
val f = rootProject.file("key.properties")
|
|
if (f.exists()) f.inputStream().use { load(it) }
|
|
}
|
|
|
|
android {
|
|
namespace = "com.kuhy.wake_alarm_sync"
|
|
// Pinned explicitly rather than delegated to the Flutter Gradle plugin:
|
|
// full-screen-intent and foreground-service semantics both changed at
|
|
// API 34/35, and the alarm path cannot be reasoned about without a floor.
|
|
compileSdk = 36
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "com.kuhy.wake_alarm_sync"
|
|
// 28 is the floor for android:showWhenLocked / android:turnScreenOn as
|
|
// plain manifest attributes, which the ring activity relies on; it also
|
|
// clears flutter_secure_storage's API 23 (Android Keystore) requirement
|
|
// and Flutter's own default of 24.
|
|
minSdk = 28
|
|
// Matches the target phone. Keep in step with compileSdk above.
|
|
targetSdk = 36
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
signingConfigs {
|
|
if (keystoreProperties.getProperty("storeFile") != null) {
|
|
create("release") {
|
|
storeFile = file(keystoreProperties.getProperty("storeFile"))
|
|
storePassword = keystoreProperties.getProperty("storePassword")
|
|
keyAlias = keystoreProperties.getProperty("keyAlias")
|
|
keyPassword = keystoreProperties.getProperty("keyPassword")
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
// Falls back to the debug key only when key.properties is absent
|
|
// (a fresh clone or a local run), so `flutter run --release` works.
|
|
signingConfig = signingConfigs.findByName("release")
|
|
?: signingConfigs.getByName("debug")
|
|
}
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|