From a8a43f8708833302ddc37570a8924573948fa834 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sat, 12 Jul 2025 03:40:04 +0200 Subject: [PATCH] AndroidManifest: handle allowed actions --- lib/main.dart | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index bbb6355..623b5dd 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -221,7 +221,27 @@ class _MyHomePageState extends State { // Subscribe to all events (initial link and further) final sub = appLinks.uriLinkStream.listen((uri) { - doSSH("innentuer-open"); + final allowedActions = [ + 'innentuer-open', + 'aussentuer-open', + 'lab-close', + 'werkstatt-open', + 'werkstatt-close', + ]; + + final action = uri.host; + + if (!allowedActions.contains(action)) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text("Unknown action: $action"), + duration: const Duration(seconds: 3), + ), + ); + return; + } + + doSSH(action); }); // we do not await generateKey() here, as this is the intended way