feat: Wakelock + Release-Keystore-Signing

- Wakelock (wakelock_plus): Tablet-Display schläft nie ein, kein manuelles
  Entsperren vor jedem Stempeln nötig.
- Release-Build signiert jetzt mit eigenem Keystore statt Debug-Key.
  Keystore (release-keystore.jks) + key.properties liegen NUR auf dem
  Build-Rechner (236), nie im Git (siehe android/.gitignore). Fallback auf
  Debug-Signing falls key.properties fehlt (frischer Checkout ohne
  Keystore-Zugriff bricht Build nicht).
  Wichtig: storeFile-Pfad in build.gradle.kts über rootProject.file()
  aufgelöst, nicht file() – sonst relativ zum falschen Modul (app/ statt
  android/).

v0.1.3+4.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dzdm3EWeNdYFUuXFRJryA1
This commit is contained in:
patrickandClaude Sonnet 5 committed 2026-09-10 12:16:01 +02:00
1 parent cea8ba8f08
commit 8044a90d12
4 files changed
+39 -12

No files matched your search

+30 -10
View File
@@ -1,9 +1,23 @@
import java.util.Properties
import java.io.FileInputStream
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: android/key.properties (nie committen, siehe .gitignore).
// Fehlt die Datei (z.B. frischer Checkout ohne Keystore), fällt der Release-
// Build auf den Debug-Key zurück statt zu scheitern – nur auf dem
// Build-Rechner (236) ist der echte Release-Keystore hinterlegt.
val keystorePropertiesFile = rootProject.file("key.properties")
val keystoreProperties = Properties()
val hasReleaseKeystore = keystorePropertiesFile.exists()
if (hasReleaseKeystore) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
android {
namespace = "de.timemaster.timemaster_kiosk"
compileSdk = 36
@@ -15,25 +29,31 @@ android {
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "de.timemaster.timemaster_kiosk"
// 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
// Uses the version code from pubspec.yaml. When using split APKs, 1000 * ABI_VERSION
// is added automatically by Flutter. (https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions)
// You can force using the value of versionCode by specifying the `-P force-version-code-ignoring-abi=true`
// flag during build.
versionCode = flutter.versionCode
versionName = flutter.versionName
}
signingConfigs {
if (hasReleaseKeystore) {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = rootProject.file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["storePassword"] as String
}
}
}
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 = if (hasReleaseKeystore) {
signingConfigs.getByName("release")
} else {
signingConfigs.getByName("debug")
}
}
}
}
+1 -1
View File
@@ -1,3 +1,3 @@
/// Manuell mit pubspec.yaml synchron halten (siehe timemaster-mobile,
/// gleiche Konvention – kein package_info_plus während aktiver Feldtests).
const String kAppVersion = '0.1.2+3';
const String kAppVersion = '0.1.3+4';
+6
View File
@@ -1,5 +1,6 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
import 'app_version.dart';
import 'services/api_client.dart';
import 'screens/enrollment_screen.dart';
@@ -44,6 +45,11 @@ Future<void> main() async {
// sichtbar machen und mit leerem Enrollment-Status weiterstarten.
debugPrint('ApiClient.init() fehlgeschlagen (Kiosk $kAppVersion): $e\n$st');
}
// Kiosk-Tablet ist dauerhaft im Einsatz – Display soll nie einschlafen,
// sonst muss vor jedem Stempeln erst entsperrt werden. Fehler hier (z.B.
// Plattform-Channel nicht bereit) sind nicht kritisch genug, um den
// Start zu blockieren.
unawaited(WakelockPlus.enable().catchError((_) {}));
runApp(const TimeMasterKioskApp());
}, (error, stack) {
debugPrint('Unbehandelter Fehler (Kiosk $kAppVersion): $error\n$stack');
+2 -1
View File
@@ -1,7 +1,7 @@
name: timemaster_kiosk
description: TimeMaster Kiosk – Stempeluhr für Android-Tablets hinter VPN
publish_to: 'none'
version: 0.1.2+3
version: 0.1.3+4
environment:
sdk: '>=3.3.0 <4.0.0'
@@ -13,6 +13,7 @@ dependencies:
dio: ^5.7.0
flutter_secure_storage: ^9.2.2
nfc_manager: ^4.2.1
wakelock_plus: ^1.2.8
dev_dependencies:
flutter_test: