From df7bb5e18170305da62e225dd25a19b6c1d38ac7 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 7 Sep 2026 15:23:52 +0200 Subject: [PATCH] Added Android Permissions --- CLAUDE.md | 5 +++++ ac_web/android/app/src/main/AndroidManifest.xml | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 89cb08f..32b9f1c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -68,6 +68,11 @@ Notes that are easy to get wrong: The backend host/port is configured once in `lib/main.dart` via `AcApi.configure(const ApiConfig(host: 'localhost', port: 5118))`. Plain http is intentional — the API is only reached inside a trusted network. There is no environment/config file; changing the backend address means editing `main.dart`. +On android two things in `android/app/src/main/AndroidManifest.xml` have to stay in place for that to work, and both only bite the **release** apk: + +- `` — flutter ships this permission only in `src/debug` and `src/profile`, which a release build does not merge. Without it every request fails with `SocketException: Connection failed (OS Error: Operation not permitted)`, because the app may not open a socket at all. +- `android:usesCleartextTraffic="true"` on `` — android blocks plain http since api 28 (the app targets 36). Without it requests fail with `CLEARTEXT communication to not permitted`. Remove the attribute once the backend speaks https. + ## Architecture ### API layer (`lib/Api/`) diff --git a/ac_web/android/app/src/main/AndroidManifest.xml b/ac_web/android/app/src/main/AndroidManifest.xml index 16270b7..66490de 100644 --- a/ac_web/android/app/src/main/AndroidManifest.xml +++ b/ac_web/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,20 @@ + + + + android:icon="@mipmap/ic_launcher" + android:usesCleartextTraffic="true"> +