diff --git a/docs/architecture.md b/docs/architecture.md index 39ae1eb..9a3b581 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -160,17 +160,19 @@ Gesetzt in `rinkplanner/project.godot`: | Plattform | Renderer | | :--- | :--- | -| Desktop | `forward_plus` | -| Mobile | `mobile` | -| Web (Wasm) | `gl_compatibility` | +| Desktop (Linux/Windows/macOS) | `forward_plus` | +| Android | `mobile` | + +Ziele sind ausschließlich native Builds; einen Web-Export gibt es nicht +mehr. Details und Befehle: `docs/builds.md`. ### UI-Skalierung (Touch-first) -`window/stretch/mode="disabled"`: Die Oberfläche wird in realen Fenster- bzw. -CSS-Pixeln gelayoutet. Zusätzlich setzt der Controller -`Window.content_scale_factor` auf die Bildschirm-Skalierung -(`DisplayServer.screen_get_scale()`). Damit entspricht eine Layout-Einheit auf -Tablets einem CSS-Pixel und wird trotzdem in Gerätepixeln gerendert: +`window/stretch/mode="disabled"`: Die Oberfläche wird in realen Fensterpixeln +gelayoutet. Zusätzlich setzt der Controller `Window.content_scale_factor` auf +die Bildschirm-Skalierung (`DisplayServer.screen_get_scale()`). Auf dem +Tablet (DPR ≈ 2,6) entspricht eine Layout-Einheit damit einem CSS-Pixel und +wird trotzdem in Gerätepixeln gerendert: - Ein 56-px-Button ist auf dem Tablet wirklich 56 CSS-Pixel groß, statt durch eine feste Designauflösung kleingerechnet zu werden. @@ -185,7 +187,7 @@ Tablets einem CSS-Pixel und wird trotzdem in Gerätepixeln gerendert: Werkzeug-Label entfallen, das Sections-Panel wird 260 statt 300 px breit. - Die Timing-Leiste ist ein `HFlowContainer` und bricht bei Bedarf um, statt seitlich abgeschnitten zu werden. -- Geprüfte Landschaftsbreiten: 1024 px (iPad-Landscape) und 1400 px +- Geprüfte Landschaftsbreiten: 1024 px (kleine Tablets) und 1400 px (Galaxy Tab S9+). Hochformat ist noch nicht gestaltet. ### Zeichen-Cache @@ -224,11 +226,14 @@ ggf. eines nach `touchend` (300-ms-Guard). - **Autosave** schreibt nach 1,5 s Inaktivität nach `user://autosave.tres` und wird beim Start automatisch wiederhergestellt. Der Dirty-State wird im Fenstertitel als `*` angezeigt. Beim Verlassen wird zusätzlich gespeichert. -- **Web:** `FileAccess` schreibt in den IndexedDB-Speicher. Im echten - Chrome-Touch-Test auf einem 1024-px- und einem 1400-px-Layout (DPR 2) - überlebt die Kür einen Browser-Reload. -- **Web-Build:** `tools/export_web.sh` exportiert nach `build/web/` - (single-threaded, kein COOP/COEP nötig). Details in `docs/web-test.md`. +- **Builds:** Linux, Windows, macOS und Android über + `tools/export_*.sh`; Presets in `rinkplanner/export_presets.cfg`. + Android nutzt das Template-Export-Verfahren ohne Gradle-Projekt, + `arm64-v8a`, `minSdk 24`, `targetSdk 36`, Landscape und Immersive Mode. + Details in `docs/builds.md`. +- **Lokale Daten:** `user://` liegt pro Plattform getrennt (Linux + `~/.local/share/godot/app_userdata/Rinkplanner/`, Android im + app-internen Speicher). Ein Kontosync ist noch nicht implementiert. ## 7. Tests @@ -300,8 +305,9 @@ Viewport-Screenshot; sie ersetzen die headless Tests nicht. rotierende Backups oder Versionen pro Speichervorgang nötig sind, zeigt sich im Praxisbetrieb. 9. **Dateinamen:** Die Normalisierung ersetzt Leerzeichen und entfernt - Pfadzeichen, transliteriert aber keine Umlaute. Für Web/Windows ist zu - prüfen, ob eine ASCII-Normalisierung robuster ist. + Pfadzeichen, transliteriert aber keine Umlaute. Für Windows und den + geplanten FTP-Sync ist zu prüfen, ob eine ASCII-Normalisierung robuster + ist. 10. **Snapshot-Clone:** `_clone_routine()` kopiert die Modellfelder manuell. Neue Felder am Modell müssen dort ergänzt werden, sonst fehlen sie in Undo/Redo-Snapshots. diff --git a/docs/builds.md b/docs/builds.md new file mode 100644 index 0000000..51b43fe --- /dev/null +++ b/docs/builds.md @@ -0,0 +1,144 @@ +# Builds: Desktop und Android + +Rinkplanner wird als **Desktop-Anwendung** (Linux/Windows/macOS) und als +**Android-App** gebaut. Einen Web-Build gibt es nicht mehr: Die App braucht +lokalen Dateizugriff, ein eigenes Fenster und später einen Kontosync, der +nicht von Browser-Speicherlimits abhängt. + +## Übersicht + +| Ziel | Preset | Ausgabe | Größe (ca.) | +| :--- | :--- | :--- | :--- | +| Linux x86_64 | `Linux` | `build/linux/rinkplanner.x86_64` | 77 MB | +| Windows x86_64 | `Windows` | `build/windows/rinkplanner.exe` | 113 MB | +| macOS universal | `macOS` | `build/macos/rinkplanner.zip` | 64 MB | +| Android arm64 | `Android` | `build/android/rinkplanner-debug.apk` | 31 MB | + +Die PCK ist bei Linux und Windows **eingebettet** (eine Datei zum +Weitergeben). `build/` ist nicht versioniert. + +## Voraussetzungen + +- Godot **4.7.2** (oder `GODOT=/pfad/zu/godot` setzen) +- Export-Templates derselben Version unter + `~/.local/share/godot/export_templates/4.7.2.stable/` +- Für Android zusätzlich JDK 17 + Android SDK (siehe unten) + +## Desktop bauen + +```bash +./tools/export_linux.sh +./tools/export_windows.sh +./tools/export_macos.sh +``` + +**Windows:** Icon und Versionsinformationen sind deaktiviert +(`application/modify_resources=false`), damit der Export ohne `rcedit` auf +Linux läuft. Wer das will, installiert `rcedit` und schaltet die Option im +Preset ein. + +**macOS:** Das Bundle ist ad-hoc signiert, aber **nicht notarisiert**. Beim +ersten Start auf einem Mac: + +```bash +xattr -cr Rinkplanner.app +open Rinkplanner.app # ggf. Rechtsklick → Öffnen +``` + +Für eine verteilbare App ist eine Signierung mit Developer ID und +Notarisierung auf einem Mac nötig (Preset: `codesign/codesign=3`). + +## Android + +### Einmalig: Toolchain einrichten + +```bash +./tools/setup_android.sh +``` + +Das Skript (idempotent, ca. 1,6 GB Download): + +1. Temurin **JDK 17** → `~/.jdks/temurin-17` +2. Android **command-line tools** → `~/Android/Sdk` +3. `platform-tools`, `build-tools;36.0.0`, `build-tools;35.0.0`, + `platforms;android-36` +4. Godot-**4.7.2-Export-Templates** +5. **Debug-Keystore** → `~/.local/share/godot/keystores/debug.keystore` +6. Trägt `java_sdk_path`, `android_sdk_path` und `debug_keystore` in + `~/.config/godot/editor_settings-4.7.tres` ein (Backup als `.bak`) + +### APK bauen + +```bash +./tools/export_android.sh # Debug-APK +./tools/export_android.sh debug --install # bauen + per adb installieren +``` + +Ausgabe: `build/android/rinkplanner-debug.apk` + +Prüfen (Paketname, Version, SDK-Stufen, ABI, Landscape, Signatur): + +```bash +./tools/verify_apk.sh +``` + +`aapt2` warnt beim Debug-APK über ein ungenutztes `mipmap/themed_icon` aus +dem Godot-Template. Das Manifest referenziert nur `@mipmap/icon`; die Warnung +ist folgenlos. + +- Paket: `de.rinkplanner.app`, Label „Rinkplanner“, Version 0.1.0 +- App-Icon aus `rinkplanner/icon.svg` (Launcher-Icons unter + `rinkplanner/assets/icons/android/`) +- `minSdk 24`, `targetSdk 36`, ABI **arm64-v8a** (Galaxy Tab S9+) +- Landscape, Immersive Mode, `resizeableActivity=true` +- Berechtigung `INTERNET` (für den späteren Sync) +- Template-Export ohne Gradle-Projekt (`gradle_build/use_gradle_build=false`) + +### Auf dem Tablet installieren + +1. Auf dem Tablet: Einstellungen → Info zu Tablet → 7× „Buildnummer“ → + Entwickleroptionen → **USB-Debugging** an +2. Tablet per USB anschließen, „Dateizugriff zulassen“ bestätigen +3. `adb devices` prüfen, dann + +```bash +~/Android/Sdk/platform-tools/adb install -r build/android/rinkplanner-debug.apk +``` + +Alternativ die APK direkt aufs Tablet kopieren und dort öffnen +(„Unbekannte Quellen“ erlauben). + +### Wo liegen die Daten? + +Godot schreibt `user://` pro Plattform getrennt: + +| Plattform | Pfad | +| :--- | :--- | +| Linux | `~/.local/share/godot/app_userdata/Rinkplanner/` | +| Windows | `%APPDATA%\Godot\app_userdata\Rinkplanner\` | +| macOS | `~/Library/Application Support/Godot/app_userdata/Rinkplanner/` | +| Android | App-interner Speicher (`/data/data/de.rinkplanner.app/files/`) | + +Dort liegen `routines/`, `autosave.tres` und `exports/`. Die Android-Daten +sind ohne Root nicht direkt sichtbar – der Export-Dialog der App schreibt +nach `user://exports/`, von dort kann man Dateien über einen Dateimanager +mit App-Zugriff oder `adb pull` holen: + +```bash +adb shell run-as de.rinkplanner.app ls files/ +adb exec-out run-as de.rinkplanner.app cat files/routines/kuer.tres > kuer.tres +``` + +## Release-Builds + +- **Android Release:** eigener Keystore nötig; im Preset + `keystore/release*` setzen und `./tools/export_android.sh release` bauen. + Der Debug-Keystore ist nur zum Testen. +- **Windows/macOS:** siehe Hinweise oben (rcedit, Codesign/Notarization). + +## Nächster Schritt: Kontosync + +Geplant ist ein manueller Sync über FTP: Ein Button lädt die neuesten +`.tres`-Dateien je Kür hoch bzw. herunter, Konflikte bleiben als Kopien mit +Zeitstempel erhalten. Zugangsdaten liegen in den App-Einstellungen +(`user://`), nicht im Repository. diff --git a/docs/roadmap.md b/docs/roadmap.md index 2f88996..d7b7291 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -50,16 +50,30 @@ Voraussetzung für Phase 1. - [x] Export-Tests: Geometrie, Section-Reihenfolge, Sichtbarkeit - [x] Export-Dialog mit Dateiname, Format und Umfang -### Nächster Schritt: Touch-/Tablet-/Web-Härtung +### Erledigt: Builds -- [x] Web-Export mit Compatibility-Renderer (`tools/export_web.sh`) -- [x] Touch-Ziele auf 56 px erhöht, Chrome-Doppel-Segment-Guard -- [x] Kleine Displays (1024 px) und kompakte Leiste geprüft -- [x] Performance bei vielen Segmenten und Sections (Cache + Stresstest) -- [x] Persistenz auf Web/IndexedDB verifizieren (Reload-Test) +- [x] Linux-, Windows- und macOS-Preset plus `tools/export_*.sh` +- [x] Android-Toolchain-Setup (`tools/setup_android.sh`), Debug-Keystore +- [x] Signiertes Android-Debug-APK (arm64-v8a, Landscape, minSdk 24) +- [x] Web-Export entfernt; Zielplattformen sind nur noch Desktop + Android - [ ] Test auf echtem Tablet (Galaxy Tab S9+) - [ ] Hochformat-Layout (nur prüfen, falls benötigt) -- [ ] Optional: iPad/Safari-Test +- [ ] Release-Keystore für ein verteilbares APK + +### Erledigt: Touch-/Tablet-Härtung + +- [x] Touch-Ziele auf 56 px erhöht, Guard gegen emulierte Maus-Events +- [x] UI-Skalierung in CSS-Pixeln (DPR-korrekt), kompakte Leiste < 1280 px +- [x] Kleine Displays (1024 px) geprüft +- [x] Performance bei vielen Segmenten und Sections (Cache + Stresstest) + +### Nächster Schritt: Kontosync (Desktop ↔ Tablet) + +- [ ] Sync-Einstellungen in der App (FTP-Host, Port, Benutzer, Passwort, + Verzeichnis), Zugangsdaten unter `user://`, nicht im Repo +- [ ] Manueller Sync: neueste `.tres` je Kür laden/hochladen +- [ ] Konflikte als Kopien mit Zeitstempel behalten +- [ ] Automatischer Sync und Sync-Status in der Oberfläche (später) ### Danach: Element-Marker @@ -81,8 +95,8 @@ Voraussetzung für Phase 1. - [ ] Optional: Segment-Verknüpfung beim Verschieben von Endpunkten - [ ] Optional: Section-Timeline mit Zeitproportionen -Die Reihenfolge ist bewusst: erst Touch-/Web-Basis, dann sichtbare -Element-Marker, dann die vollständige ISU-Logik. +Die Reihenfolge ist bewusst: erst native Builds und Datenaustausch, dann +sichtbare Element-Marker, dann die vollständige ISU-Logik. ## Querschnittsaufgaben diff --git a/docs/web-test.md b/docs/web-test.md deleted file mode 100644 index f059f75..0000000 --- a/docs/web-test.md +++ /dev/null @@ -1,95 +0,0 @@ -# Web-/Tablet-Test - -Zielgerät: **Samsung Galaxy Tab S9+**, Android, Chrome, Landscape. -Zusätzlich geprüft: **1024 × 768 CSS-Pixel** (iPad-Landscape-Größe) und -Desktop-Chromium. - -## 1. Voraussetzungen - -- Godot 4.7.2 (oder eine kompatible 4.x-Version) mit installierten - **Web-Export-Templates** derselben Version. -- Auf diesem Rechner waren bei der Einrichtung nur die 4.6-Web-Templates - installiert; der erste Testbuild lief deshalb mit Godot 4.6. Für den - finalen Build die 4.7.2-Templates über den Godot-Editor installieren - (`Editor → Manage Export Templates`). - -## 2. Web-Build erzeugen - -```bash -./tools/export_web.sh -``` - -Das Skript importiert das Projekt und schreibt den Build nach: - -``` -build/web/index.html -``` - -`build/` ist nicht versioniert. Der Export ist **single-threaded** und braucht -keine COOP/COEP-Header. Der Web-Renderer ist `gl_compatibility` (WebGL 2). - -## 3. Lokal testen - -```bash -python3 -m http.server 8000 --directory build/web -``` - -Auf dem Tablet im gleichen WLAN öffnen: - -``` -http://:8000/ -``` - -Die IP z. B. mit `ip addr` oder `hostname -I` ermitteln. - -## 4. Testcheckliste auf dem Tablet - -- [ ] Start im Landscape-Modus, Canvas füllt den Bildschirm -- [ ] Ein-Finger-Ziehen zeichnet genau ein Segment (kein Doppel-Segment) -- [ ] Zwei-Finger-Ziehen pannt -- [ ] Pinch zoomt -- [ ] Tippen im Modus „Auswählen“ wählt ein Segment -- [ ] Start-/Endpunkt- und Bogen-Griffe lassen sich mit dem Finger ziehen -- [ ] Richtung/Kante über die Toolbar ändern -- [ ] Sections anlegen, wechseln, umbenennen, sortieren -- [ ] Timing-Leiste: Dauer/Tempo ändern, Profil wählen, Kalibrieren -- [ ] Playback: Start/Pause/Reset, Timeline-Scrub, Geschwindigkeit -- [ ] Speichern/Laden über das Datei-Menü -- [ ] Autosave: Seite neu laden → Kür ist wieder da -- [ ] SVG- und PNG-Export erzeugen und Datei öffnen -- [ ] Keine abgeschnittenen Buttons, kein horizontales Scrollen - -## 5. UI-Skalierung im Browser - -Der Web-Build läuft mit `window/stretch/mode="disabled"`. Godot legt das -Canvas in Gerätepixeln an (bei DPR 2 also 2800 × 1580 für 1400 × 790 CSS). -Der Controller setzt deshalb `Window.content_scale_factor` auf -`DisplayServer.screen_get_scale()` (im Browser = `devicePixelRatio`). Damit -gilt: - -- Layout-Einheit = CSS-Pixel; ein 56-px-Button ist 56 CSS-Pixel groß. -- Rendering bleibt scharf (2× Backing Store auf dem Tablet). -- Ab 1280 CSS-Pixel erscheinen die vollen Beschriftungen, darunter die - kompakte Leiste („Undo“, „Redo“, „Kalib.“, ohne Titel). - -## 6. Bereits geprüft (Chromium, echtes Touch-Event) - -- WebGL2/Compatibility-Renderer startet ohne Konsolenfehler -- Ein Chrome-Touch-Drag erzeugt genau **ein** Segment; das synthetische - Maus-Event vor `touchstart` wird verworfen, ein spätes nach `touchend` - ebenfalls (300-ms-Guard) -- Autosave/IndexedDB: Reload stellt die Kür wieder her (1024 und 1400 px) -- Layout bei 1024 × 768 (kompakt) und 1400 × 790 (voll) ohne Abschneiden -- Touch-Ziele 56 × 56 px; Menü/Undo/Redo sind Textbuttons, damit - Web-Font-Fallbacks keine Kästchen erzeugen -- Performance: 480 Segmente / 12 Sections ≈ 7–10 ms pro Redraw (headless, - ohne GPU-Zeichnung) - -## 7. Bekannte Grenzen - -- **Hochformat** (< 1024 px Breite) ist noch nicht gestaltet; die - Werkzeugleiste wäre dort zu breit. Ziel bleibt Landscape. -- Safari/iOS ist noch nicht getestet. Der Build ist thread-frei und nutzt - WebGL2, also grundsätzlich lauffähig; separat zu prüfen sind - Touch-Event-Reihenfolge, IndexedDB-Limits und Safe-Area im Landscape. -- Audio wird in Phase 1 nicht genutzt. diff --git a/rinkplanner/assets/icons/android/ic_launcher_192.png b/rinkplanner/assets/icons/android/ic_launcher_192.png new file mode 100644 index 0000000..6e3295a Binary files /dev/null and b/rinkplanner/assets/icons/android/ic_launcher_192.png differ diff --git a/rinkplanner/assets/icons/android/ic_launcher_192.png.import b/rinkplanner/assets/icons/android/ic_launcher_192.png.import new file mode 100644 index 0000000..8654bc0 --- /dev/null +++ b/rinkplanner/assets/icons/android/ic_launcher_192.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d06bt70xkax03" +path="res://.godot/imported/ic_launcher_192.png-bf2726f5b980b65f80fa0eeaf07ba5e9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/android/ic_launcher_192.png" +dest_files=["res://.godot/imported/ic_launcher_192.png-bf2726f5b980b65f80fa0eeaf07ba5e9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/rinkplanner/assets/icons/android/ic_launcher_background_432.png b/rinkplanner/assets/icons/android/ic_launcher_background_432.png new file mode 100644 index 0000000..4e8b06f Binary files /dev/null and b/rinkplanner/assets/icons/android/ic_launcher_background_432.png differ diff --git a/rinkplanner/assets/icons/android/ic_launcher_background_432.png.import b/rinkplanner/assets/icons/android/ic_launcher_background_432.png.import new file mode 100644 index 0000000..2158acd --- /dev/null +++ b/rinkplanner/assets/icons/android/ic_launcher_background_432.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://yuttphwqfflf" +path="res://.godot/imported/ic_launcher_background_432.png-80a806c1ddb97ef9722ce866b3f2d588.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/android/ic_launcher_background_432.png" +dest_files=["res://.godot/imported/ic_launcher_background_432.png-80a806c1ddb97ef9722ce866b3f2d588.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/rinkplanner/assets/icons/android/ic_launcher_foreground_432.png b/rinkplanner/assets/icons/android/ic_launcher_foreground_432.png new file mode 100644 index 0000000..2ed74ae Binary files /dev/null and b/rinkplanner/assets/icons/android/ic_launcher_foreground_432.png differ diff --git a/rinkplanner/assets/icons/android/ic_launcher_foreground_432.png.import b/rinkplanner/assets/icons/android/ic_launcher_foreground_432.png.import new file mode 100644 index 0000000..b191074 --- /dev/null +++ b/rinkplanner/assets/icons/android/ic_launcher_foreground_432.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c0d7mguqq6kk" +path="res://.godot/imported/ic_launcher_foreground_432.png-ebc040957ccc6bf7d78ed1c41a90b48f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/android/ic_launcher_foreground_432.png" +dest_files=["res://.godot/imported/ic_launcher_foreground_432.png-ebc040957ccc6bf7d78ed1c41a90b48f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/rinkplanner/assets/icons/android/ic_launcher_monochrome_432.png b/rinkplanner/assets/icons/android/ic_launcher_monochrome_432.png new file mode 100644 index 0000000..b49a278 Binary files /dev/null and b/rinkplanner/assets/icons/android/ic_launcher_monochrome_432.png differ diff --git a/rinkplanner/assets/icons/android/ic_launcher_monochrome_432.png.import b/rinkplanner/assets/icons/android/ic_launcher_monochrome_432.png.import new file mode 100644 index 0000000..becbe56 --- /dev/null +++ b/rinkplanner/assets/icons/android/ic_launcher_monochrome_432.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c3abde7a6bm12" +path="res://.godot/imported/ic_launcher_monochrome_432.png-c720e8f4bde84f80d7d53d25a508e39d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/android/ic_launcher_monochrome_432.png" +dest_files=["res://.godot/imported/ic_launcher_monochrome_432.png-c720e8f4bde84f80d7d53d25a508e39d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/rinkplanner/assets/icons/icon_foreground.svg b/rinkplanner/assets/icons/icon_foreground.svg new file mode 100644 index 0000000..fb2e96c --- /dev/null +++ b/rinkplanner/assets/icons/icon_foreground.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/rinkplanner/assets/icons/icon_foreground.svg.import b/rinkplanner/assets/icons/icon_foreground.svg.import new file mode 100644 index 0000000..dd6ed88 --- /dev/null +++ b/rinkplanner/assets/icons/icon_foreground.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c57tr8h4rw10t" +path="res://.godot/imported/icon_foreground.svg-9362c3bcea0c351cf11ae5f264f1c60b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/icon_foreground.svg" +dest_files=["res://.godot/imported/icon_foreground.svg-9362c3bcea0c351cf11ae5f264f1c60b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/rinkplanner/assets/images/checkboard.png.import b/rinkplanner/assets/images/checkboard.png.import index 062124c..0b65633 100644 --- a/rinkplanner/assets/images/checkboard.png.import +++ b/rinkplanner/assets/images/checkboard.png.import @@ -4,15 +4,16 @@ importer="texture" type="CompressedTexture2D" uid="uid://d2f4ue6f2152o" path.s3tc="res://.godot/imported/checkboard.png-60f6db393233dd01fdd8b7cd558c6460.s3tc.ctex" +path.etc2="res://.godot/imported/checkboard.png-60f6db393233dd01fdd8b7cd558c6460.etc2.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], +"imported_formats": ["s3tc_bptc", "etc2_astc"], "vram_texture": true } [deps] source_file="res://assets/images/checkboard.png" -dest_files=["res://.godot/imported/checkboard.png-60f6db393233dd01fdd8b7cd558c6460.s3tc.ctex"] +dest_files=["res://.godot/imported/checkboard.png-60f6db393233dd01fdd8b7cd558c6460.s3tc.ctex", "res://.godot/imported/checkboard.png-60f6db393233dd01fdd8b7cd558c6460.etc2.ctex"] [params] diff --git a/rinkplanner/export_presets.cfg b/rinkplanner/export_presets.cfg index e7c7704..e79fbe9 100644 --- a/rinkplanner/export_presets.cfg +++ b/rinkplanner/export_presets.cfg @@ -1,15 +1,15 @@ [preset.0] -name="Web" -platform="Web" +name="Linux" +platform="Linux" runnable=true advanced_options=false dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" -exclude_filter="" -export_path="build/web/index.html" +exclude_filter="tests/*,prototype/*,docs/*,addons/*,assets/models/*" +export_path="build/linux/rinkplanner.x86_64" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -20,16 +20,264 @@ script_export_mode=2 [preset.0.options] +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="" +ssh_remote_deploy/cleanup_script="" +binary_format/embed_pck=true + +[preset.1] + +name="Windows" +platform="Windows Desktop" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="tests/*,prototype/*,docs/*,addons/*,assets/models/*" +export_path="build/windows/rinkplanner.exe" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.1.options] + +binary_format/architecture="x86_64" +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=false +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="Rinkplanner" +application/file_description="2D-Whiteboard fuer Eiskunstlauf" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="" +ssh_remote_deploy/cleanup_script="" +binary_format/embed_pck=true + +[preset.2] + +name="macOS" +platform="macOS" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="tests/*,prototype/*,docs/*,addons/*,assets/models/*" +export_path="build/macos/rinkplanner.zip" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.2.options] + +export/distribution_type=1 +binary_format/architecture="universal" custom_template/debug="" custom_template/release="" -variant/extensions_support=false -variant/thread_support=false -vram_texture_compression/for_desktop=false -vram_texture_compression/for_mobile=false -html/export_icon=true -html/custom_html_shell="" -html/head_include="" -html/canvas_resize_policy=2 -html/focus_canvas_on_start=true -html/experimental_virtual_keyboard=false -progressive_web_app/enabled=false +debug/export_console_wrapper=1 +application/liquid_glass_icon="" +application/icon="" +application/icon_interpolation=4 +application/bundle_identifier="de.rinkplanner.app" +application/signature="" +application/app_category="Education" +application/short_version="" +application/version="" +application/copyright="" +application/copyright_localized={} +application/min_macos_version_x86_64="11.00" +application/min_macos_version_arm64="13.00" +application/export_angle=0 +display/high_res=true +shader_baker/enabled=false +application/additional_plist_content="" +xcode/platform_build="14C18" +xcode/sdk_version="13.1" +xcode/sdk_build="22C55" +xcode/sdk_name="macosx13.1" +xcode/xcode_version="1420" +xcode/xcode_build="14C18" +codesign/codesign=1 +codesign/installer_identity="" +codesign/apple_team_id="" +codesign/identity="" +codesign/certificate_file="" +codesign/certificate_password="" +codesign/provisioning_profile="" +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +codesign/entitlements/app_sandbox/device_usb=false +codesign/entitlements/app_sandbox/device_bluetooth=false +codesign/entitlements/app_sandbox/files_downloads=0 +codesign/entitlements/app_sandbox/files_pictures=0 +codesign/entitlements/app_sandbox/files_music=0 +codesign/entitlements/app_sandbox/files_movies=0 +codesign/entitlements/app_sandbox/files_user_selected=0 +codesign/entitlements/app_sandbox/helper_executables=[] +codesign/entitlements/additional="" +codesign/custom_options=PackedStringArray() +notarization/notarization=0 +notarization/apple_id_name="" +notarization/apple_id_password="" +notarization/api_uuid="" +notarization/api_key="" +notarization/api_key_id="" +privacy/microphone_usage_description="" +privacy/microphone_usage_description_localized={} +privacy/camera_usage_description="" +privacy/camera_usage_description_localized={} +privacy/location_usage_description="" +privacy/location_usage_description_localized={} +privacy/address_book_usage_description="" +privacy/address_book_usage_description_localized={} +privacy/calendar_usage_description="" +privacy/calendar_usage_description_localized={} +privacy/photos_library_usage_description="" +privacy/photos_library_usage_description_localized={} +privacy/desktop_folder_usage_description="" +privacy/desktop_folder_usage_description_localized={} +privacy/documents_folder_usage_description="" +privacy/documents_folder_usage_description_localized={} +privacy/downloads_folder_usage_description="" +privacy/downloads_folder_usage_description_localized={} +privacy/network_volumes_usage_description="" +privacy/network_volumes_usage_description_localized={} +privacy/removable_volumes_usage_description="" +privacy/removable_volumes_usage_description_localized={} +privacy/tracking_enabled=false +privacy/tracking_domains=PackedStringArray() +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="" +ssh_remote_deploy/cleanup_script="" + +[preset.3] + +name="Android" +platform="Android" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="tests/*,prototype/*,docs/*,addons/*,assets/models/*" +export_path="build/android/rinkplanner.apk" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.3.options] + +custom_template/debug="" +custom_template/release="" +gradle_build/use_gradle_build=false +gradle_build/gradle_build_directory="" +gradle_build/android_source_template="" +gradle_build/compress_native_libraries=false +gradle_build/export_format=0 +gradle_build/min_sdk="" +gradle_build/target_sdk="" +gradle_build/custom_theme_attributes={} +keystore/debug="" +keystore/debug_user="" +keystore/debug_password="" +keystore/release="" +keystore/release_user="" +keystore/release_password="" +version/code=1 +version/name="0.1.0" +package/unique_name="de.rinkplanner.app" +package/name="Rinkplanner" +package/signed=true +package/app_category=6 +package/retain_data_on_uninstall=false +package/exclude_from_recents=false +package/show_in_android_tv=false +package/show_in_app_library=true +package/show_as_launcher_app=false +graphics/opengl_debug=false +shader_baker/enabled=false +xr_features/xr_mode=0 +gesture/swipe_to_dismiss=false +screen/immersive_mode=true +screen/edge_to_edge=false +screen/support_small=true +screen/support_normal=true +screen/support_large=true +screen/support_xlarge=true +screen/background_color=Color(0, 0, 0, 1) +user_data_backup/allow=true +command_line/extra_args="" +permissions/custom_permissions=PackedStringArray() +architectures/arm64-v8a=true +architectures/armeabi-v7a=false +architectures/x86_64=false +architectures/x86=false +launcher_icons/main_192x192="res://assets/icons/android/ic_launcher_192.png" +launcher_icons/adaptive_foreground_432x432="res://assets/icons/android/ic_launcher_foreground_432.png" +launcher_icons/adaptive_background_432x432="res://assets/icons/android/ic_launcher_background_432.png" +launcher_icons/adaptive_monochrome_432x432="res://assets/icons/android/ic_launcher_monochrome_432.png" +splash_screen/disable_godot_boot_splash=false +splash_screen/icon="" +splash_screen/branding_image="" +splash_screen/background_color=Color(0, 0, 0, 1) +permissions/internet=true diff --git a/rinkplanner/icon.svg b/rinkplanner/icon.svg index 9d8b7fa..5155529 100644 --- a/rinkplanner/icon.svg +++ b/rinkplanner/icon.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + diff --git a/rinkplanner/project.godot b/rinkplanner/project.godot index ab73937..8173750 100644 --- a/rinkplanner/project.godot +++ b/rinkplanner/project.godot @@ -40,7 +40,7 @@ window/stretch/mode="disabled" window/stretch/aspect="expand" [rendering] +textures/vram_compression/import_etc2_astc=true renderer/rendering_method="forward_plus" renderer/rendering_method.mobile="mobile" -renderer/rendering_method.web="gl_compatibility" diff --git a/tools/_export_common.sh b/tools/_export_common.sh new file mode 100644 index 0000000..cd6fe60 --- /dev/null +++ b/tools/_export_common.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# Gemeinsame Helfer für die Export-Skripte. Wird gesourct, nicht direkt +# ausgeführt. + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +PROJECT_DIR="$REPO_ROOT/rinkplanner" +GODOT="${GODOT:-/opt/godot/Godot_v4.7.2-stable_linux.x86_64}" + +require_godot() { + if [[ ! -x "$GODOT" ]]; then + echo "Godot-Binary nicht gefunden: $GODOT" >&2 + echo "Setze GODOT=/pfad/zu/godot" >&2 + exit 1 + fi +} + +# build_preset +build_preset() { + local preset="$1" mode="$2" relative="$3" + local out="$REPO_ROOT/$relative" + + require_godot + mkdir -p "$(dirname "$out")" + + "$GODOT" --headless --path "$PROJECT_DIR" --import >/dev/null + + if [[ "$mode" == "debug" ]]; then + "$GODOT" --headless --path "$PROJECT_DIR" \ + --export-debug "$preset" "$out" + else + "$GODOT" --headless --path "$PROJECT_DIR" \ + --export-release "$preset" "$out" + fi + + if [[ ! -e "$out" ]]; then + echo "Export fehlgeschlagen: $out" >&2 + exit 1 + fi + + echo "Build: $out" +} diff --git a/tools/export_android.sh b/tools/export_android.sh new file mode 100755 index 0000000..4494efc --- /dev/null +++ b/tools/export_android.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# Baut das Android-APK (arm64-v8a) nach build/android/. +# +# ./tools/export_android.sh # Debug-APK (Debug-Keystore) +# ./tools/export_android.sh release # Release-APK (Release-Keystore nötig) +# ./tools/export_android.sh debug --install +# +# Voraussetzung: ./tools/setup_android.sh wurde einmal ausgeführt. +set -euo pipefail +source "$(dirname "${BASH_SOURCE[0]}")/_export_common.sh" + +MODE="${1:-debug}" +INSTALL="${2:-}" +SDK_DIR="${SDK_DIR:-$HOME/Android/Sdk}" + +case "$MODE" in + debug) relative="build/android/rinkplanner-debug.apk" ;; + release) relative="build/android/rinkplanner-release.apk" ;; + *) echo "Unbekannter Modus: $MODE (debug|release)" >&2; exit 1 ;; +esac + +if [[ ! -d "$SDK_DIR/build-tools" ]]; then + echo "Android SDK nicht gefunden unter $SDK_DIR" >&2 + echo "Bitte zuerst ./tools/setup_android.sh ausführen." >&2 + exit 1 +fi + +build_preset "Android" "$MODE" "$relative" + +APK="$REPO_ROOT/$relative" +ADB="$SDK_DIR/platform-tools/adb" + +if [[ "$INSTALL" == "--install" ]]; then + if [[ ! -x "$ADB" ]]; then + echo "adb nicht gefunden: $ADB" >&2 + exit 1 + fi + "$ADB" install -r "$APK" + echo "Auf dem Tablet gestartet werden kann es über das App-Symbol 'Rinkplanner'." +else + echo "Installieren mit:" + echo " $ADB install -r \"$APK\"" +fi diff --git a/tools/export_linux.sh b/tools/export_linux.sh new file mode 100755 index 0000000..ca5181f --- /dev/null +++ b/tools/export_linux.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Baut das Linux-Desktop-Binary (x86_64, PCK eingebettet) nach build/linux/. +set -euo pipefail +source "$(dirname "${BASH_SOURCE[0]}")/_export_common.sh" +build_preset "Linux" release "build/linux/rinkplanner.x86_64" +chmod +x "$REPO_ROOT/build/linux/rinkplanner.x86_64" 2>/dev/null || true diff --git a/tools/export_macos.sh b/tools/export_macos.sh new file mode 100755 index 0000000..3bf5a55 --- /dev/null +++ b/tools/export_macos.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Baut das macOS-Bundle (universal, ad-hoc signiert) als ZIP nach build/macos/. +# Hinweis: Für eine verteilbare App ist zusätzlich Signierung/Notarisierung +# auf einem Mac nötig. +set -euo pipefail +source "$(dirname "${BASH_SOURCE[0]}")/_export_common.sh" +build_preset "macOS" release "build/macos/rinkplanner.zip" diff --git a/tools/export_web.sh b/tools/export_web.sh deleted file mode 100755 index 1559c6b..0000000 --- a/tools/export_web.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -PROJECT_DIR="$REPO_ROOT/rinkplanner" -BUILD_DIR="$REPO_ROOT/build/web" -GODOT="${GODOT:-/opt/godot/Godot_v4.7.2-stable_linux.x86_64}" - -if [[ ! -x "$GODOT" ]]; then - echo "Godot binary not found: $GODOT" >&2 - echo "Set GODOT=/path/to/godot" >&2 - exit 1 -fi - -"$GODOT" --headless --path "$PROJECT_DIR" --import >/dev/null -mkdir -p "$BUILD_DIR" - -if ! "$GODOT" --headless --path "$PROJECT_DIR" \ - --export-release "Web" "$BUILD_DIR/index.html"; then - echo "Web export failed." >&2 - echo "Check that the Web export templates for this Godot version are installed" >&2 - echo "(Editor -> Manage Export Templates)." >&2 - exit 1 -fi - -if [[ ! -f "$BUILD_DIR/index.html" ]]; then - echo "Web export produced no index.html." >&2 - exit 1 -fi - -echo "Web build: $BUILD_DIR/index.html" -echo "Serve it with:" -echo " python3 -m http.server 8000 --directory \"$BUILD_DIR\"" diff --git a/tools/export_windows.sh b/tools/export_windows.sh new file mode 100755 index 0000000..7d33e80 --- /dev/null +++ b/tools/export_windows.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Baut die Windows-Desktop-EXE (x86_64, PCK eingebettet) nach build/windows/. +set -euo pipefail +source "$(dirname "${BASH_SOURCE[0]}")/_export_common.sh" +build_preset "Windows" release "build/windows/rinkplanner.exe" diff --git a/tools/setup_android.sh b/tools/setup_android.sh new file mode 100755 index 0000000..8ea18fa --- /dev/null +++ b/tools/setup_android.sh @@ -0,0 +1,172 @@ +#!/usr/bin/env bash +# Richtet die Android-Toolchain für Godot ein (JDK, Android SDK, Templates, +# Debug-Keystore) und trägt die Pfade in die Godot-Editor-Settings ein. +# +# Aufruf: +# ./tools/setup_android.sh +# +# Das Skript ist idempotent: bereits vorhandene Teile werden übersprungen. +# Es lädt ca. 1,6 GB und braucht ca. 3 GB Plattenplatz. +# +# Getestete Versionen: +# Godot 4.7.2, Temurin JDK 17, Android command-line tools 12.0, +# build-tools 36.0.0/35.0.0, platforms;android-36 +set -euo pipefail + +GODOT_VERSION="${GODOT_VERSION:-4.7.2}" +TEMPLATE_VERSION="${GODOT_VERSION}.stable" + +JDK_DIR="${JDK_DIR:-$HOME/.jdks/temurin-17}" +SDK_DIR="${SDK_DIR:-$HOME/Android/Sdk}" +TPL_DIR="${TPL_DIR:-$HOME/.local/share/godot/export_templates/$TEMPLATE_VERSION}" +KEYSTORE="${KEYSTORE:-$HOME/.local/share/godot/keystores/debug.keystore}" +DOWNLOAD_DIR="${DOWNLOAD_DIR:-$HOME/.cache/rinkplanner-setup}" + +JDK_URL="https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse" +CMDLINE_TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" +TEMPLATES_URL="https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_export_templates.tpz" + +BUILD_TOOLS_VERSIONS=("36.0.0" "35.0.0") + +log() { printf '\n==> %s\n' "$*"; } +need() { command -v "$1" >/dev/null 2>&1 || { echo "Fehlt: $1" >&2; exit 1; }; } + +need curl +need unzip +need tar +need python3 + +mkdir -p "$DOWNLOAD_DIR" + +download() { + local url="$1" target="$2" + if [[ -s "$target" ]]; then + echo "vorhanden: $target" + return + fi + echo "lade: $url" + curl -fL --retry 3 --progress-bar -o "$target.part" "$url" + mv "$target.part" "$target" +} + +# --- JDK --------------------------------------------------------------------- +if [[ -x "$JDK_DIR/bin/java" ]]; then + log "JDK vorhanden: $JDK_DIR" +else + log "Installiere Temurin JDK 17 nach $JDK_DIR" + archive="$DOWNLOAD_DIR/temurin17.tar.gz" + download "$JDK_URL" "$archive" + tmp="$(mktemp -d)" + tar -xzf "$archive" -C "$tmp" + rm -rf "$JDK_DIR" + mkdir -p "$(dirname "$JDK_DIR")" + mv "$tmp"/* "$JDK_DIR" + rm -rf "$tmp" +fi +"$JDK_DIR/bin/java" -version + +# --- Android SDK ------------------------------------------------------------- +if [[ -x "$SDK_DIR/platform-tools/adb" ]]; then + log "Android SDK vorhanden: $SDK_DIR" +else + log "Installiere Android command-line tools nach $SDK_DIR" + archive="$DOWNLOAD_DIR/commandlinetools.zip" + download "$CMDLINE_TOOLS_URL" "$archive" + rm -rf "$SDK_DIR/cmdline-tools" + mkdir -p "$SDK_DIR/cmdline-tools" + tmp="$(mktemp -d)" + unzip -q "$archive" -d "$tmp" + mv "$tmp/cmdline-tools" "$SDK_DIR/cmdline-tools/latest" + rm -rf "$tmp" +fi + +SDKMANAGER="$SDK_DIR/cmdline-tools/latest/bin/sdkmanager" +export JAVA_HOME="$JDK_DIR" +export ANDROID_HOME="$SDK_DIR" +export ANDROID_SDK_ROOT="$SDK_DIR" + +if [[ ! -x "$SDK_DIR/platform-tools/adb" ]]; then + log "Akzeptiere Android-Lizenzen" + yes | "$SDKMANAGER" --sdk_root="$SDK_DIR" --licenses >/dev/null || true + + log "Installiere Platform-Tools, Build-Tools und Platform" + packages=("platform-tools" "platforms;android-36") + for version in "${BUILD_TOOLS_VERSIONS[@]}"; do + packages+=("build-tools;$version") + done + "$SDKMANAGER" --sdk_root="$SDK_DIR" "${packages[@]}" +fi + +"$SDK_DIR/platform-tools/adb" version | head -1 + +# --- Godot-Export-Templates -------------------------------------------------- +if [[ -f "$TPL_DIR/android_debug.apk" ]]; then + log "Godot-Export-Templates vorhanden: $TPL_DIR" +else + log "Installiere Godot-$GODOT_VERSION-Export-Templates" + archive="$DOWNLOAD_DIR/export_templates.tpz" + download "$TEMPLATES_URL" "$archive" + rm -rf "$TPL_DIR" + mkdir -p "$TPL_DIR" + tmp="$(mktemp -d)" + unzip -q "$archive" -d "$tmp" + cp -a "$tmp/templates/." "$TPL_DIR/" + rm -rf "$tmp" +fi +ls "$TPL_DIR" | sed -n '1,6p' + +# --- Debug-Keystore ---------------------------------------------------------- +if [[ -f "$KEYSTORE" ]]; then + log "Debug-Keystore vorhanden: $KEYSTORE" +else + log "Erzeuge Debug-Keystore" + mkdir -p "$(dirname "$KEYSTORE")" + "$JDK_DIR/bin/keytool" -genkeypair -keyalg RSA -keysize 2048 -validity 10000 \ + -keystore "$KEYSTORE" -storetype PKCS12 -storepass android -alias androiddebugkey \ + -keypass android -dname "CN=Android Debug,O=Android,C=US" >/dev/null +fi + +# --- Godot Editor-Settings --------------------------------------------------- +log "Trage Pfade in die Godot-Editor-Settings ein" +python3 - "$JDK_DIR" "$SDK_DIR" "$KEYSTORE" <<'PY' +import configparser +import pathlib +import re +import shutil +import sys + +java_path, sdk_path, keystore = sys.argv[1:4] +for name in ("editor_settings-4.7.tres", "editor_settings-4.6.tres"): + path = pathlib.Path.home() / ".config" / "godot" / name + if not path.exists(): + continue + text = path.read_text() + shutil.copy2(path, path.with_suffix(path.suffix + ".bak")) + replacements = { + "export/android/java_sdk_path": java_path, + "export/android/android_sdk_path": sdk_path, + "export/android/debug_keystore": keystore, + } + for key, value in replacements.items(): + line = f'{key} = "{value}"' + if re.search(rf'^{re.escape(key)} = .*$', text, flags=re.M): + text = re.sub(rf'^{re.escape(key)} = .*$', line, text, flags=re.M) + else: + text = text.rstrip() + "\n" + line + "\n" + path.write_text(text) + print(f"aktualisiert: {path} (Backup: {path}.bak)") +PY + +log "Fertig" +cat <&2; exit 1; } +[[ -x "$BUILD_TOOLS/aapt2" ]] || { echo "aapt2 fehlt: $BUILD_TOOLS" >&2; exit 1; } + +fail=0 +expect() { + local pattern="$1" label="$2" haystack="$3" + if grep -qE "$pattern" <<<"$haystack"; then + echo "ok $label" + else + echo "FAIL $label (erwartet: $pattern)" >&2 + fail=1 + fi +} + +badging="$("$BUILD_TOOLS/aapt2" dump badging "$APK")" +echo "APK: $APK" +expect "^package: name='de\.rinkplanner\.app'" "Paketname" "$badging" +expect "versionName='[0-9]+\.[0-9]+\.[0-9]+'" "Version" "$badging" +expect "minSdkVersion:'24'" "minSdk 24" "$badging" +expect "native-code: 'arm64-v8a'" "ABI arm64-v8a" "$badging" +expect "application-label:'Rinkplanner'" "App-Label" "$badging" + +features="$("$BUILD_TOOLS/aapt2" dump xmltree --file AndroidManifest.xml "$APK" 2>/dev/null)" +expect "screenOrientation.*=0" "Landscape" "$features" + +if [[ -d "$JDK_DIR/bin" ]]; then + export PATH="$JDK_DIR/bin:$PATH" + if "$BUILD_TOOLS/apksigner" verify "$APK" >/dev/null 2>&1; then + echo "ok Signatur" + else + echo "FAIL Signatur" >&2 + fail=1 + fi +else + echo "skip Signatur (JDK nicht gefunden: $JDK_DIR)" +fi + +if [[ "$fail" -ne 0 ]]; then + echo "APK-Prüfung fehlgeschlagen." >&2 + exit 1 +fi +echo "APK-Prüfung bestanden."