diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf80df..87bc03d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,14 @@ Alle nennenswerten Änderungen an diesem Projekt. Format nach ## [Unreleased] +### Changed +- (sim) `MAX_HP` 100 -> 150 (laengere, taktischere Matches); `SIM_VERSION` 0.2.0 +- (app) Version 0.6.0 (6), HP-Balken gegen `kTankMaxHp` + ### Added +- (build) Release-Skript mit ABI-abhängigem Alignment-Check, native-debug-symbols.zip, AAB +- (build) R8/ProGuard-Regeln, `key.properties`-Support mit Debug-Fallback +- (store) Icon 512, Feature-Graphic 1024x500, 4 Geraete-Screenshots, `store/listing.md` - (ffi) Replay-Export (`iron_arc_replay_json`), Playback-Handle, `iron_arc_state_hash` - (app) HTTP-Client, Offline-Queue, MatchSession mit Desync-Erkennung und Replay-Playback - (app) Layout mit getrenntem Spielfeld und Bedienleiste diff --git a/app/android/app/build.gradle.kts b/app/android/app/build.gradle.kts index 38a279b..71e9cdd 100644 --- a/app/android/app/build.gradle.kts +++ b/app/android/app/build.gradle.kts @@ -1,9 +1,19 @@ +import java.io.FileInputStream +import java.util.Properties + 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") } +// Optional release signing; without key.properties the build falls back to debug keys. +val keystoreProperties = Properties() +val keystorePropertiesFile = rootProject.file("key.properties") +if (keystorePropertiesFile.exists()) { + FileInputStream(keystorePropertiesFile).use { keystoreProperties.load(it) } +} + android { namespace = "com.ironarc.iron_arc" compileSdk = 36 @@ -15,25 +25,38 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.ironarc.iron_arc" - // You can update the following values to match your application needs. - // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = 24 targetSdk = 36 - // 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 (keystorePropertiesFile.exists()) { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String + keyPassword = keystoreProperties["keyPassword"] as String + storeFile = 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 (keystorePropertiesFile.exists()) { + signingConfigs.getByName("release") + } else { + // Local/dev builds only - a real upload key is required for Play. + signingConfigs.getByName("debug") + } + isMinifyEnabled = true + isShrinkResources = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) } } } diff --git a/app/android/app/proguard-rules.pro b/app/android/app/proguard-rules.pro new file mode 100644 index 0000000..f6377eb --- /dev/null +++ b/app/android/app/proguard-rules.pro @@ -0,0 +1,14 @@ +# Iron Arc R8 rules. +# +# The app talks to Rust through dart:ffi (no JNI, no reflection), so only the +# Flutter engine entry points need to survive shrinking; the Flutter Gradle +# plugin contributes its own consumer rules for that. +-keep class io.flutter.** { *; } +-keep class io.flutter.plugins.** { *; } + +# Keep annotations used by shared_preferences' platform channel. +-keepattributes *Annotation* + +# Do not warn about optional Flutter/AndroidX classes. +-dontwarn io.flutter.embedding.** +-dontwarn androidx.** diff --git a/app/android/key.properties.example b/app/android/key.properties.example new file mode 100644 index 0000000..3d98a4c --- /dev/null +++ b/app/android/key.properties.example @@ -0,0 +1,6 @@ +# Copy to app/android/key.properties and fill in for a signed release build. +# The file is git-ignored; without it the release build falls back to debug keys. +storePassword=CHANGE_ME +keyPassword=CHANGE_ME +keyAlias=ironarc +storeFile=/absolute/path/to/ironarc-upload.jks diff --git a/app/lib/src/game/iron_arc_game.dart b/app/lib/src/game/iron_arc_game.dart index fa4a990..61789d5 100644 --- a/app/lib/src/game/iron_arc_game.dart +++ b/app/lib/src/game/iron_arc_game.dart @@ -12,6 +12,9 @@ const double kWorldWidth = 2048; const double kWorldHeight = 1152; const int kSamplePx = 2; +/// Must match `sim::state::MAX_HP`. +const int kTankMaxHp = 150; + /// Immutable HUD snapshot, only replaced when something actually changed. @immutable class HudState { @@ -380,7 +383,7 @@ class IronArcGame extends FlameGame { ); // Health bar. - final hp = _match.tankHp(player).clamp(0, 100) / 100.0; + final hp = _match.tankHp(player).clamp(0, kTankMaxHp) / kTankMaxHp; final barRect = RRect.fromRectAndRadius( Rect.fromLTWH(x - 30, y - 46, 60, 8), const Radius.circular(4), diff --git a/app/pubspec.yaml b/app/pubspec.yaml index c532f06..eaf4e22 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 0.6.0+6 environment: sdk: ^3.13.4 diff --git a/app/test/fake_match.dart b/app/test/fake_match.dart index 0cd30d1..cad1566 100644 --- a/app/test/fake_match.dart +++ b/app/test/fake_match.dart @@ -90,7 +90,7 @@ class FakeMatch extends MatchSource { int tankY(int player) => _heights[tankX(player) ~/ 2]; @override - int tankHp(int player) => player == 0 ? 100 : 62; + int tankHp(int player) => player == 0 ? 150 : 93; @override int get terrainVersion => _terrainVersion; diff --git a/build/native-debug-symbols.zip b/build/native-debug-symbols.zip new file mode 100644 index 0000000..8709f73 Binary files /dev/null and b/build/native-debug-symbols.zip differ diff --git a/build/native-symbols/arm64-v8a/libffi.so b/build/native-symbols/arm64-v8a/libffi.so new file mode 100755 index 0000000..af560c6 Binary files /dev/null and b/build/native-symbols/arm64-v8a/libffi.so differ diff --git a/build/native-symbols/armeabi-v7a/libffi.so b/build/native-symbols/armeabi-v7a/libffi.so new file mode 100755 index 0000000..bb4dbf6 Binary files /dev/null and b/build/native-symbols/armeabi-v7a/libffi.so differ diff --git a/crates/content/assets/content.json b/crates/content/assets/content.json index dca1303..2e988b7 100644 --- a/crates/content/assets/content.json +++ b/crates/content/assets/content.json @@ -60,28 +60,28 @@ { "id": "vanguard", "name": "Vanguard", - "hp": 100, + "hp": 150, "passive": "shield_recharge", "ultimate": "overdrive" }, { "id": "longshot", "name": "Longshot", - "hp": 100, + "hp": 150, "passive": "range_bonus", "ultimate": "target_marker" }, { "id": "bulwark", "name": "Bulwark", - "hp": 110, + "hp": 165, "passive": "damage_reduction", "ultimate": "dome" }, { "id": "sapper", "name": "Sapper", - "hp": 95, + "hp": 142, "passive": "dig_depth", "ultimate": "emp" } diff --git a/crates/content/src/lib.rs b/crates/content/src/lib.rs index 6c18733..af0ebe0 100644 --- a/crates/content/src/lib.rs +++ b/crates/content/src/lib.rs @@ -206,7 +206,7 @@ mod tests { assert_eq!(c.weapon(1).unwrap().name, "Baby Shell"); assert_eq!(c.weapon(1).unwrap().ammo, UNLIMITED_AMMO); assert!(c.weapon(99).is_none()); - assert_eq!(c.tank("vanguard").unwrap().hp, 100); + assert_eq!(c.tank("vanguard").unwrap().hp, 150); } #[test] diff --git a/crates/ffi/src/lib.rs b/crates/ffi/src/lib.rs index 95dd333..7ed5281 100644 --- a/crates/ffi/src/lib.rs +++ b/crates/ffi/src/lib.rs @@ -61,7 +61,7 @@ mod tests { #[test] fn version_code_is_packed() { - assert_eq!(iron_arc_sim_version_code(), 100); + assert_eq!(iron_arc_sim_version_code(), 200); } #[test] diff --git a/crates/sim/src/lib.rs b/crates/sim/src/lib.rs index 702249b..4797dce 100644 --- a/crates/sim/src/lib.rs +++ b/crates/sim/src/lib.rs @@ -21,7 +21,7 @@ pub mod terrain; pub mod trig_table; /// Version of the simulation. Bumped on any formula/balance change. -pub const SIM_VERSION: &str = "0.1.0"; +pub const SIM_VERSION: &str = "0.2.0"; /// Fixed simulation tick rate in Hz. pub const TICK_HZ: u32 = 60; diff --git a/crates/sim/src/state.rs b/crates/sim/src/state.rs index 64d87f0..048d70d 100644 --- a/crates/sim/src/state.rs +++ b/crates/sim/src/state.rs @@ -10,7 +10,7 @@ use crate::TICK_HZ; use content::Content; /// Maximum hit points per tank. -pub const MAX_HP: i32 = 100; +pub const MAX_HP: i32 = 150; /// Ticks per turn (25 s). pub const TURN_TICKS: u32 = 25 * TICK_HZ; /// Hard match limit in turns. diff --git a/docs/compliance-play-store.md b/docs/compliance-play-store.md index e1c2fe4..10b04ae 100644 --- a/docs/compliance-play-store.md +++ b/docs/compliance-play-store.md @@ -14,14 +14,26 @@ Legende: `[ ]` offen · `[x]` erledigt · `[~]` teilweise/geplant mit Owner | Status | Anforderung | Detail | Phase | |---|---|---|---| -| `[ ]` | **`targetSdk 36`** | Pflicht für neue Apps & Updates ab **31.08.2026**; `minSdk 24` | M0 | -| `[ ]` | **16-KB-Page-Size** | Native Libs müssen 16-KB-aligned sein (NDK r28+); Prüfung: `zipalign -c -P 16 -v 4 app.aab` + `readelf -lW libffi.so` | M6 | -| `[ ]` | **AAB** statt APK | Play App Signing aktivieren, Upload-Key sicher verwahren (nicht im Repo!) | M6 | -| `[ ]` | **64-bit** | `arm64-v8a` Pflicht, `armeabi-v7a` optional; `x86_64` nur für Emulator-Builds | M0 | -| `[ ]` | **Native Debug-Symbole** | `native-debug-symbols.zip` beim Release hochladen, sonst sind Rust-Crashes unlesbar | M6 | -| `[ ]` | **R8/ProGuard Keep-Rules** | frb/JNI-Klassen und `GeneratedPluginRegistrant` nicht wegoptimieren | M6 | +| `[x]` | **`targetSdk 36`** | Pflicht für neue Apps & Updates ab **31.08.2026**; `minSdk 24` | M0 | +| `[x]` | **16-KB-Page-Size** | Native Libs müssen 16-KB-aligned sein (NDK r28+); Prüfung: `zipalign -c -P 16 -v 4 app.aab` + `readelf -lW libffi.so` | M6 | +| `[x]` | **AAB** statt APK | Play App Signing aktivieren, Upload-Key sicher verwahren (nicht im Repo!) | M6 | +| `[x]` | **64-bit** | `arm64-v8a` Pflicht, `armeabi-v7a` optional; `x86_64` nur für Emulator-Builds | M0 | +| `[x]` | **Native Debug-Symbole** | `native-debug-symbols.zip` beim Release hochladen, sonst sind Rust-Crashes unlesbar | M6 | +| `[x]` | **R8/ProGuard Keep-Rules** | frb/JNI-Klassen und `GeneratedPluginRegistrant` nicht wegoptimieren | M6 | | `[ ]` | Play Integrity API | Ranked-Requests serverseitig prüfen (ab M5) | M5 | +## 1a. Nachweis (M6, 2026-10-24) + +| Punkt | Messwert | +|---|---| +| App Bundle | `app-release.aab` = **49.319.554 Bytes** (49,3 MB) | +| Release-APK (arm64, minifiziert) | **18.710.576 Bytes** (18,7 MB) | +| 16-KB-Alignment | arm64-v8a `0x4000` ✅ · armeabi-v7a `0x1000` (32-bit braucht 4 KB) ✅ | +| Native Symbole | `build/native-debug-symbols.zip` = 527.231 Bytes | +| Manifest | `versionCode=6`, `versionName=0.6.0`, `minSdk 24`, `targetSdk 36` | +| R8/Minify | aktiv; Release-APK auf Gerät installiert, Match gespielt, keine Crashes | +| Signing | `key.properties`-Support mit Debug-Fallback; echtes Upload-Zertifikat **fehlt noch** | + ## 2. App-Inhalte (Play Console) | Status | Feld | Antwort/Plan | diff --git a/store/assets/feature_1024x500.png b/store/assets/feature_1024x500.png new file mode 100644 index 0000000..9e1350b Binary files /dev/null and b/store/assets/feature_1024x500.png differ diff --git a/store/assets/icon_512.png b/store/assets/icon_512.png new file mode 100644 index 0000000..887e652 Binary files /dev/null and b/store/assets/icon_512.png differ diff --git a/store/listing.md b/store/listing.md new file mode 100644 index 0000000..8692f19 --- /dev/null +++ b/store/listing.md @@ -0,0 +1,85 @@ +# Store-Listing (Entwurf) + +| Feld | Wert | +|---|---| +| Paket | `com.ironarc.iron_arc` | +| Version | 0.6.0 (versionCode 6) | +| Zielgruppe | 13+, **nicht** im Families-Programm | +| Enthält Werbung | Ja (ab M7 aktiv, aktuell noch keine Ad-SDKs im Build) | +| In-App-Käufe | Ja (geplant ab M7) | + +## Titel (max. 30 Zeichen) + +| Sprache | Text | Länge | +|---|---|---| +| DE | `Iron Arc: Panzerduell` | 22 | +| EN | `Iron Arc: Artillery Duel` | 24 | + +## Kurzbeschreibung (max. 80 Zeichen) + +| Sprache | Text | +|---|---| +| DE | `Rundenbasierte Panzer-Duelle mit zerstörbarer Landschaft. Sieg in 3 Minuten.` | +| EN | `Turn-based tank artillery duels with destructible terrain. Win in 3 minutes.` | + +## Vollbeschreibung (DE) + +``` +Ein Duell in der Mittagspause: 60 Sekunden bis zum ersten Schuss, jede Runde ein neuer Krater. + +IRON ARC ist ein rundenbasiertes Artillerie-Duell mit zerstörbarer Landschaft, Wind und +einem Arsenal, das von der Baby-Shell bis zum Digger alles bietet. Zieh, ziele, lass los – +und sieh zu, wie der Berg unter deinem Gegner verschwindet. + +WAS DICH ERWARTET +• Zerstörbare Landschaft: Sand rutscht nach, Fels splittert, Lava steigt +• Wind und Schwerkraft: jede Runde eine neue Herausforderung +• Waffen mit Charakter: Roller, Digger, MIRV, Schild – jede mit eigener Taktik +• Kurze Duelle: 3 Minuten, jederzeit unterbrechbar +• Offline spielbar, Ergebnisse werden später geprüft + +FAIR BLEIBT FAIR +Kein Kauf von Stärke. Wer gewinnt, entscheidet über Winkel, Wind und Timing – nicht über +den Kontostand. + +EHRLICHE TECHNIK +Jedes Match wird als Replay aufgezeichnet. Der Server rechnet es nach: gleiche Eingaben, +gleiches Ergebnis. Wer manipuliert, fällt durch. +``` + +## Vollbeschreibung (EN, Kurzfassung) + +``` +A duel in your lunch break: 60 seconds to the first shot, a new crater every round. + +IRON ARC is a turn-based artillery duel with destructible terrain, wind and an arsenal +from Baby Shell to Digger. Drag, aim, release - and watch the hill under your opponent vanish. + +• Destructible terrain, sliding sand, rising lava +• Short duels, playable offline, verified later +• No pay-to-win: skill decides, not your wallet +``` + +## Assets + +| Asset | Status | Datei | +|---|---|---| +| Icon 512×512 | ✅ Platzhalter | `store/assets/icon_512.png` | +| Feature-Graphic 1024×500 | ✅ Platzhalter | `store/assets/feature_1024x500.png` | +| Screenshots (min. 4) | ✅ echte Geräteaufnahmen | `store/screenshots/01..04` (1080×2400) | +| Promo-Video 30 s | ❌ offen (Aufnahme auf Gerät nötig) | – | +| Tablet-Screenshots (7", 10") | ❌ offen | – | + +## Data-Safety-Antworten (Entwurf) + +| Frage | Antwort | +|---|---| +| Werden Daten erhoben? | Ja: Geräte-ID (App-Funktion), Absturzprotokolle (ab Crashlytics), ungefährer Standort aus IP (Ads) | +| Werden Daten geteilt? | Ja, mit Google (Ads/Analytics) | +| Verschlüsselte Übertragung? | Ja (HTTPS im Release; Debug nutzt lokales HTTP nur via `adb reverse`) | +| Löschung möglich? | Ja, in-app + Web-URL (ab M7 implementiert) | + +## ASO-Keywords (nicht im Titel wiederholen) + +`artillery`, `tank duel`, `panzer spiel`, `rundenbasiert`, `worms`, `scorched`, `strategie`, +`duell`, `kanone`, `zerstörbare landschaft` diff --git a/store/screenshots/01_gameplay_release.png b/store/screenshots/01_gameplay_release.png new file mode 100644 index 0000000..65818c7 Binary files /dev/null and b/store/screenshots/01_gameplay_release.png differ diff --git a/store/screenshots/02_crater.png b/store/screenshots/02_crater.png new file mode 100644 index 0000000..3714e50 Binary files /dev/null and b/store/screenshots/02_crater.png differ diff --git a/store/screenshots/03_online_status.png b/store/screenshots/03_online_status.png new file mode 100644 index 0000000..f6c003d Binary files /dev/null and b/store/screenshots/03_online_status.png differ diff --git a/store/screenshots/04_replay_start.png b/store/screenshots/04_replay_start.png new file mode 100644 index 0000000..dee2a02 Binary files /dev/null and b/store/screenshots/04_replay_start.png differ diff --git a/tools/build_release.sh b/tools/build_release.sh new file mode 100755 index 0000000..7161e38 --- /dev/null +++ b/tools/build_release.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# Builds a Play-ready App Bundle plus the native debug symbols. +set -euo pipefail +cd "$(dirname "$0")/.." +export ANDROID_NDK_HOME="${ANDROID_NDK_HOME:-$HOME/Android/Sdk/ndk/28.2.13676358}" + +echo '==> Rust release libraries' +cargo ndk --platform 24 -t arm64-v8a -t armeabi-v7a -o app/android/app/src/main/jniLibs build --release -p ffi + +for abi in arm64-v8a armeabi-v7a; do + so="app/android/app/src/main/jniLibs/$abi/libffi.so" + # 16 KB pages are mandatory for 64-bit ABIs; 32-bit ARM still uses 4 KB. + case "$abi" in + arm64-v8a|x86_64) expect=0x4000 ;; + *) expect=0x1000 ;; + esac + if readelf -lW "$so" | awk -v e="$expect" '$1=="LOAD" && $NF!=e {found=1} END{exit !found}'; then + echo "ERROR: $abi is not aligned to $expect" >&2 + exit 1 + fi + echo "OK: $abi aligned to $expect ($(stat -c%s "$so") bytes)" +done + +echo '==> Native debug symbols (unstripped)' +rm -rf build/native-symbols +mkdir -p build/native-symbols +for abi in arm64-v8a armeabi-v7a; do + mkdir -p "build/native-symbols/$abi" + cp "app/android/app/src/main/jniLibs/$abi/libffi.so" "build/native-symbols/$abi/" +done +(cd build/native-symbols && zip -qr ../native-debug-symbols.zip .) +echo "symbols: $(stat -c%s build/native-debug-symbols.zip) bytes" + +echo '==> Flutter bundle (AAB)' +(cd app && flutter build appbundle --release) + +AAB=app/build/app/outputs/bundle/release/app-release.aab +echo "aab: $(stat -c%s "$AAB") bytes" +unzip -l "$AAB" | grep -E 'lib/|AndroidManifest' | head -8 + +echo '==> Release APK for device smoke test' +(cd app && flutter build apk --release --target-platform android-arm64) +echo "apk: $(stat -c%s app/build/app/outputs/flutter-apk/app-release.apk) bytes" diff --git a/tools/build_rust_android.sh b/tools/build_rust_android.sh index ffdc0a1..80defb2 100755 --- a/tools/build_rust_android.sh +++ b/tools/build_rust_android.sh @@ -9,9 +9,15 @@ cargo ndk --platform 24 \ build --release -p ffi for abi in arm64-v8a armeabi-v7a x86_64; do so="app/android/app/src/main/jniLibs/$abi/libffi.so" - if readelf -lW "$so" | awk '$1=="LOAD" && $NF!="0x4000" {found=1} END{exit !found}'; then - echo "ERROR: $abi not 16 KB aligned" >&2 + # 16 KB pages are mandatory for 64-bit ABIs; 32-bit ARM still uses 4 KB. + case "$abi" in + arm64-v8a|x86_64) expect=0x4000 ;; + *) expect=0x1000 ;; + esac + if readelf -lW "$so" | awk -v e="$expect" '$1=="LOAD" && $NF!=e {found=1} END{exit !found}'; then + echo "ERROR: $abi is not aligned to $expect" >&2 exit 1 fi + echo "OK: $abi aligned to $expect ($(stat -c%s "$so") bytes)" done echo 'OK: all ABIs 16 KB aligned'