Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
270c15b
docs: add modernization development policy
thomasbonsirven Oct 6, 2026
d911e6a
docs: define modernization development phases
thomasbonsirven Oct 6, 2026
fa83ec0
docs: add AI development agent rules
thomasbonsirven Oct 6, 2026
4a1fd10
docs: add modernization project status
thomasbonsirven Oct 6, 2026
dba08e9
docs: redefine fork purpose and modernization roadmap
thomasbonsirven Oct 6, 2026
e661a9f
fix(build): allow local debug build without google services
thomasbonsirven Oct 6, 2026
7ab3d3c
docs(build): document verified Windows assembleDebug baseline
thomasbonsirven Oct 6, 2026
46725e1
fix(android): disable Firebase Perf and Play Games on community builds
thomasbonsirven Oct 6, 2026
1bdfed3
docs: record Firebase Perf community crash cause and device verification
thomasbonsirven Oct 6, 2026
9df05fd
docs: add CorsixTH 0.70.1 Android migration matrix
thomasbonsirven Oct 6, 2026
6fdd483
build: enforce ARM64 C++17 ndk-build toolchain for Phase 3
thomasbonsirven Oct 6, 2026
acb5f0b
docs: note local-only CorsixTH submodule tip for Phase 3
thomasbonsirven Oct 6, 2026
a606085
chore(release): backup Phases 4-7 + soft keyboard as 0.70.1-pre-release
thomasbonsirven Oct 7, 2026
f72b9d1
ci: use Windows powershell shell on self-hosted GAMING runner
thomasbonsirven Oct 7, 2026
042b82d
fix(ci): ignore empty RELEASE_STORE_FILE from Actions secrets
thomasbonsirven Oct 7, 2026
017233a
ci: locate Android SDK on self-hosted GAMING for pre-release builds
thomasbonsirven Oct 7, 2026
f6372e0
ci: build pre-release via short C:\cth-pr junction on GAMING
thomasbonsirven Oct 7, 2026
e48576f
ci: copy workspace to C:\cth-pr for short ndk-build paths
thomasbonsirven Oct 7, 2026
2df0fa8
ci: grant contents:write so GAMING can update GitHub pre-releases
thomasbonsirven Oct 7, 2026
93da49b
Release phases 8-9 community pre-release (not fully tested).
thomasbonsirven Oct 7, 2026
3cf1134
ci: bump pre-release BUILD_NUMBER above local SNAPSHOT default
thomasbonsirven Oct 7, 2026
d65a018
ci: fix pre-release tag globs and BUILD_NUMBER for -2 releases
thomasbonsirven Oct 7, 2026
1bc0bd1
ci: harden pre-release publish step after softprops failure
thomasbonsirven Oct 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,18 @@ on:

jobs:
build:

runs-on: ubuntu-latest
# Runner GAMING labels: self-hosted, Windows, X64
runs-on: [self-hosted, Windows, X64]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: set up JDK 18
uses: actions/setup-java@v3
- name: set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '18'
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Decode Google Services Info
uses: timheuer/[email protected]
with:
fileName: 'google-services.json'
fileDir: '.'
encodedString: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build App bundle
run: ./gradlew bundleRelease
- name: Build APKS
run: ./gradlew assembleRelease
- name: Build debug APK (community-safe)
shell: powershell
run: .\gradlew.bat createGameZip assembleCommunityDebug --no-daemon
61 changes: 30 additions & 31 deletions .github/workflows/build_and_sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ on:

jobs:
build:

runs-on: ubuntu-latest
# Runner GAMING labels: self-hosted, Windows, X64
runs-on: [self-hosted, Windows, X64]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: set up JDK 18
uses: actions/setup-java@v3
- name: set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '18'
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Decode Keystore
id: decode_keystore
Expand All @@ -35,48 +34,48 @@ jobs:
fileDir: '.'
encodedString: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: Set snapshot
run: |
echo "IS_SNAPSHOT=true" >> "$GITHUB_ENV"
if: github.ref == 'refs/heads/dev'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
shell: powershell
run: |
"IS_SNAPSHOT=true" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Build APK and app bundle
run: ./gradlew bundleRelease assembleRelease
shell: powershell
run: .\gradlew.bat bundlePlaystoreRelease assemblePlaystoreRelease --no-daemon
env:
RELEASE_STORE_FILE: ${{ steps.decode_keystore.outputs.filePath }}
RELEASE_STORE_PASSWORD : ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS : ${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASSWORD : ${{ secrets.RELEASE_KEY_PASSWORD }}
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
BUILD_NUMBER: ${{ github.run_number }}
- name: Upload crashlytics symbols
run: ./gradlew uploadCrashlyticsSymbolFileRelease
shell: powershell
run: .\gradlew.bat uploadCrashlyticsSymbolFilePlaystoreRelease --no-daemon
- name: Upload Artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4
with:
name: AppBundle
path: build/outputs/bundle/release/*
path: build/outputs/bundle/playstoreRelease/*
- name: Upload Artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4
with:
name: APK
path: build/outputs/apk/release/*
path: build/outputs/apk/playstore/release/*
- name: Set version variables
shell: powershell
run: |
VER=$(cat version.txt)
echo "VERSION=$VER" >> $GITHUB_ENV
$ver = (Get-Content version.txt -Raw).Trim()
"VERSION=$ver" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Create/Update Github Snapshot Release
uses: mini-bomba/create-github-release@v1.1.3
uses: softprops/action-gh-release@v2
if: github.ref == 'refs/heads/dev'
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.VERSION }}
body: 'Snapshot release'
files: |
build/outputs/apk/release/*.apk
README.md
clear_attachments: true
prerelease: true
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
prerelease: true
body: 'Snapshot release (self-hosted GAMING)'
files: build/outputs/apk/release/*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Snapshot to Play Store
uses: swootte/[email protected]
if: github.ref == 'refs/heads/dev'
Expand Down
147 changes: 147 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Pre-release APK on the self-hosted GAMING runner (Windows / X64).
name: Pre-release APK

on:
push:
tags:
- 'v*-pre-release'
- 'v*-pre-release-*'
workflow_dispatch:
inputs:
build_version:
description: 'BUILD_VERSION / release name (e.g. 0.70.1-pre-release-2)'
required: true
default: '0.70.1-pre-release-2'

permissions:
contents: write

jobs:
build-and-release:
# Labels on runner GAMING: self-hosted, Windows, X64
runs-on: [self-hosted, Windows, X64]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'

- name: Resolve Android SDK (self-hosted)
shell: powershell
run: |
$sdk = $env:ANDROID_HOME
if ([string]::IsNullOrWhiteSpace($sdk)) { $sdk = $env:ANDROID_SDK_ROOT }
if ([string]::IsNullOrWhiteSpace($sdk)) {
$candidates = @(
"$env:LOCALAPPDATA\Android\Sdk",
"$env:USERPROFILE\AppData\Local\Android\Sdk",
"E:\000-lastBeacon_ia\android-sdk",
"C:\Android\Sdk",
"E:\Android\Sdk"
)
foreach ($c in $candidates) {
if ((Test-Path "$c\platform-tools") -or (Test-Path "$c\platforms")) {
$sdk = $c
break
}
}
}
if ([string]::IsNullOrWhiteSpace($sdk) -or -not (Test-Path $sdk)) {
throw "Android SDK not found. Set ANDROID_HOME on the GAMING runner."
}
"ANDROID_HOME=$sdk" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"ANDROID_SDK_ROOT=$sdk" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
# local.properties uses escaped backslashes (Gradle Properties format).
$escaped = ($sdk -replace '\\', '/')
"sdk.dir=$escaped" | Set-Content -Path local.properties -Encoding ascii
Write-Host "ANDROID_HOME=$sdk"

- name: Resolve version
shell: powershell
run: |
$ver = "${{ github.event.inputs.build_version }}"
if ([string]::IsNullOrWhiteSpace($ver)) {
$tag = "${{ github.ref_name }}"
if ($tag.StartsWith("v")) {
$ver = $tag.Substring(1)
} elseif ("${{ github.event_name }}" -eq "workflow_dispatch") {
$ver = "0.70.1-pre-release-2"
} else {
$ver = $tag
}
}
$runNumber = [int]"${{ github.run_number }}"
$buildNumber = 1000000 + $runNumber
"BUILD_VERSION=$ver" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"RELEASE_TAG=v$ver" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"BUILD_NUMBER=$buildNumber" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
Write-Host "BUILD_VERSION=$ver BUILD_NUMBER=$buildNumber"

- name: Build release APK (short path)
shell: powershell
run: |
# Windows ndk-build hits CreateProcess error 87 when the link line is too
# long under GithubActions_Runner\_work\... Copy into a short real path.
$short = "C:\cth-pr"
if (Test-Path $short) { Remove-Item -Recurse -Force $short }
New-Item -ItemType Directory -Path $short | Out-Null
robocopy "$env:GITHUB_WORKSPACE" $short /E /NFL /NDL /NJH /NJS /nc /ns /np
# robocopy exit codes 0-7 are success/partial
if ($LASTEXITCODE -ge 8) { throw "robocopy failed with code $LASTEXITCODE" }
"SHORT_WORKSPACE=$short" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
Set-Location $short
# Refresh local.properties for the copied tree
$sdk = $env:ANDROID_HOME
"sdk.dir=$($sdk -replace '\\','/')" | Set-Content -Path local.properties -Encoding ascii
.\gradlew.bat createGameZip assembleCommunityRelease --no-daemon
env:
BUILD_VERSION: ${{ env.BUILD_VERSION }}
IS_SNAPSHOT: 'false'
# Set in "Resolve version" (1000000 + run_number) above SNAPSHOT default.
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}

- name: Stage APK artifact
shell: powershell
run: |
$root = if ($env:SHORT_WORKSPACE) { $env:SHORT_WORKSPACE } else { $env:GITHUB_WORKSPACE }
Set-Location $root
New-Item -ItemType Directory -Force -Path distribution/pre-release | Out-Null
$src = Get-ChildItem -Recurse build/outputs/apk/community/release/*.apk | Select-Object -First 1
if (-not $src) {
$src = Get-ChildItem -Recurse build/outputs/apk/**/release/*.apk | Select-Object -First 1
}
if (-not $src) { throw "No release APK found" }
$dest = "distribution/pre-release/CorsixTH-Android-$($env:BUILD_VERSION).apk"
Copy-Item $src.FullName $dest -Force
Write-Host "Staged $dest ($($src.Length) bytes)"

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: CorsixTH-Android-${{ env.BUILD_VERSION }}
path: |
distribution/pre-release/CorsixTH-Android-${{ env.BUILD_VERSION }}.apk
distribution/pre-release/0.70.1-pre-release.md

- name: Publish / update GitHub pre-release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_TAG }}
name: ${{ env.BUILD_VERSION }}
prerelease: true
generate_release_notes: false
body_path: distribution/pre-release/0.70.1-pre-release.md
files: |
distribution/pre-release/CorsixTH-Android-${{ env.BUILD_VERSION }}.apk
distribution/pre-release/0.70.1-pre-release.md
fail_on_unmatched_files: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "jni/CorsixTH"]
path = jni/CorsixTH
url = https://github.com/alanwoolley/CorsixTH.git
branch = Android
url = https://github.com/thomasbonsirven/CorsixTH-android-0.70.1.git
branch = feature/android-phase4-0.70.1
38 changes: 33 additions & 5 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,35 @@
android:smallScreens="false"
android:xlargeScreens="true" />

<!-- Explicit network permissions (demo download / optional reporting). -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- No broad READ/WRITE_EXTERNAL_STORAGE — Theme Hospital import uses SAF. -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />

<!-- Package visibility (Android 11+): privacy policy / external https viewers. -->
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
</intent>
</queries>

<application
android:name="uk.co.armedpineapple.cth.CTHApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:pageSizeCompat="enabled"
android:theme="@style/Theme.AppTheme"
android:gwpAsanMode="always"
tools:targetApi="r">
tools:targetApi="36">

<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id"/>
Expand All @@ -33,6 +53,11 @@
android:name="SDL_ENV.SDL_TOUCH_MOUSE_EVENTS"
android:value="false" />

<!-- Trap Android back into SDL as AC Back (mapped to Escape in Lua) instead of finishing. -->
<meta-data
android:name="SDL_ENV.SDL_ANDROID_TRAP_BACK_BUTTON"
android:value="true" />

<!-- Don't enable crashlytics or analytics collection by default. Opt-in is used instead. -->
<meta-data
android:name="firebase_crashlytics_collection_enabled"
Expand All @@ -56,11 +81,11 @@
android:name="uk.co.armedpineapple.cth.GameActivity"
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:exported="true"
android:immersive="true"
android:launchMode="singleInstance"
android:preferMinimalPostProcessing="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
tools:targetApi="r">
android:windowSoftInputMode="adjustResize"
tools:targetApi="36">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand All @@ -70,18 +95,21 @@
<activity
android:name="uk.co.armedpineapple.cth.setup.SetupActivity"
android:excludeFromRecents="true"
android:exported="false" />
android:exported="false"
android:enableOnBackInvokedCallback="true" />

<activity
android:name="uk.co.armedpineapple.cth.settings.SettingsActivity"
android:excludeFromRecents="true"
android:exported="false"
android:enableOnBackInvokedCallback="true"
android:label="@string/title_activity_settings"
android:theme="@style/Theme.SettingsTheme" />

<activity
android:name="uk.co.armedpineapple.cth.files.SaveActivity"
android:exported="false"
android:enableOnBackInvokedCallback="true"
android:label="@string/save"
android:theme="@style/Theme.SaveTheme" />

Expand Down
Loading