Files
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00
..

YourPart Native Android

Native Android-App fuer YourPart als paralleler Aufbau zur bestehenden Capacitor-App.

Entscheidungen

  • Pfad: /android/native
  • Sprache: Kotlin
  • UI: Jetpack Compose
  • App-ID Debug/Local: de.yourpart.nativeapp.local.debug
  • App-ID Production Release: de.yourpart.nativeapp
  • minSdk: 26
  • compileSdk/targetSdk: 36
  • Flavors: local, staging, production
  • Build Types: debug, release
  • Feature Flags im Build: FEATURE_ADMIN, FEATURE_ADULT, FEATURE_3D, FEATURE_MINIGAMES, FEATURE_PUSH

Kommandos

cd android/native
../android/gradlew -p . :app:assembleLocalDebug
../android/gradlew -p . :app:installLocalDebug
./scripts/assemble-local-debug.sh

Emulator-Backend

Der Android-Emulator erreicht den Host-Rechner ueber 10.0.2.2.

Der local Flavor nutzt:

  • API: http://10.0.2.2:2020
  • Socket.IO: http://10.0.2.2:2020
  • Daemon: ws://10.0.2.2:2021

Security

  • Debug erlaubt Cleartext nur fuer 10.0.2.2 und localhost.
  • Release verbietet Cleartext komplett.
  • Release-Builds pruefen automatisch, dass keine lokalen oder unverschluesselten URLs in staging oder production verwendet werden.

Firebase Push

  1. Die registrierte Produktions-App de.yourpart.nativeapp als app/google-services.json ablegen. Die Beispieldatei app/google-services.json.example ist kein gültiger Ersatz.
  2. Push ist ausschließlich in productionRelease aktiviert. local und staging verwenden abweichende Paketnamen und bleiben absichtlich pushfrei, bis dafür eigene Firebase-Apps registriert sind.
  3. Im Backend eine Firebase-Service-Account-Datei außerhalb des Repositories bereitstellen und FIREBASE_SERVICE_ACCOUNT_PATH=/sicherer/pfad/firebase-service-account.json setzen. Alternativ kann FIREBASE_SERVICE_ACCOUNT_JSON mit dem JSON-Inhalt gesetzt werden. Ohne eine dieser Variablen werden keine Pushes versendet, die App und die API bleiben aber funktionsfähig.

Das Google-Services-Plugin wird nur für productionRelease mit vorhandener echter Konfigurationsdatei angewendet; lokale Builds bleiben dadurch reproduzierbar.