Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
53ae1d5
Migrate to new project model
Shivansps Oct 1, 2025
1e8b378
Delete Program.cs
Shivansps Oct 1, 2025
324f490
Inform Android OS
Shivansps Oct 1, 2025
d14d1c2
Update Knossos.NET.Desktop.csproj
Shivansps Oct 5, 2025
ce407bc
Match min android version to fsowrapper
Shivansps Oct 5, 2025
816c364
Add FSOWrapper code and additional android support
Shivansps Oct 7, 2025
9ffeb4e
Handle messagebox and windows on android
Shivansps Oct 9, 2025
af4fe55
Correct knossoswindow overlay and add modcard clicks
Shivansps Oct 10, 2025
a6e9bf4
Correct engine lib path on android
Shivansps Oct 10, 2025
e71557d
correct debug statement
Shivansps Oct 10, 2025
bdbbafc
allow to switch library folder in android
Shivansps Oct 10, 2025
61e0e55
fix included utilities location
Shivansps Oct 10, 2025
0732922
Refactor Fs2RetailInstaller to use IStorageProvider folder/files
Shivansps Oct 10, 2025
f6a8367
enable tts by default
Shivansps Oct 10, 2025
b9415e9
remove touchcontrols, source moved to fsowrapper
Shivansps Nov 28, 2025
f7137c4
move to net10-android
Shivansps Dec 10, 2025
886cec5
update android touchcontrols
Shivansps Jan 5, 2026
e9ad350
Migrate to new project model
Shivansps Oct 1, 2025
5f0e985
Delete Program.cs
Shivansps Oct 1, 2025
279e9ac
Inform Android OS
Shivansps Oct 1, 2025
d5f2c53
Update Knossos.NET.Desktop.csproj
Shivansps Oct 5, 2025
41d96f2
Match min android version to fsowrapper
Shivansps Oct 5, 2025
41449be
Add FSOWrapper code and additional android support
Shivansps Oct 7, 2025
30d729a
Handle messagebox and windows on android
Shivansps Oct 9, 2025
56b7562
Correct knossoswindow overlay and add modcard clicks
Shivansps Oct 10, 2025
b8d501d
Correct engine lib path on android
Shivansps Oct 10, 2025
b259996
correct debug statement
Shivansps Oct 10, 2025
b55c559
allow to switch library folder in android
Shivansps Oct 10, 2025
2c000c1
fix included utilities location
Shivansps Oct 10, 2025
5db0b76
Refactor Fs2RetailInstaller to use IStorageProvider folder/files
Shivansps Oct 10, 2025
db240f0
enable tts by default
Shivansps Oct 10, 2025
0e2c705
remove touchcontrols, source moved to fsowrapper
Shivansps Nov 28, 2025
ce88108
move to net10-android
Shivansps Dec 10, 2025
adbb787
update android touchcontrols
Shivansps Jan 5, 2026
bac4007
Merge branch 'project-migration' of https://github.com/Shivansps/Knos…
Shivansps Feb 11, 2026
7eba44d
upd packages
Shivansps Feb 11, 2026
efaf67e
fix compile
Shivansps Feb 11, 2026
0c26136
fix scroll on mod install
Shivansps Feb 11, 2026
c5cea03
enable/disble modcard button on android
Shivansps Feb 11, 2026
278d311
screen screen on and fullscreen
Shivansps Feb 11, 2026
7546e6d
add libshaderc to loading priorities
Shivansps Mar 13, 2026
f686dd6
Use c# envars to pass workfolder and lib path to fso
Shivansps Mar 15, 2026
1d59334
Revert "move to net10-android"
Shivansps Mar 15, 2026
a8787f1
Revert "Use c# envars to pass workfolder and lib path to fso"
Shivansps Mar 15, 2026
a00de44
Support fso borderless
Shivansps Mar 21, 2026
7786615
Reapply "move to net10-android"
Shivansps Mar 21, 2026
092399a
hide system bars
Shivansps Mar 21, 2026
505fe18
Share files (incomplete)
Shivansps Mar 21, 2026
705dd91
Share files, text and weburls in Android
Shivansps Mar 22, 2026
ace0e0d
Merge branch 'main' into project-migration
Shivansps Mar 26, 2026
786b53b
rebase corrections
Shivansps Mar 26, 2026
65c1d64
Conditional android workload on project dependencies
Shivansps Mar 28, 2026
a38741a
update readme with android dev instructions
Shivansps Mar 28, 2026
5ec5945
Move freespace menu tooltips to an overlay
Shivansps Mar 29, 2026
7b04c1a
Fix anti-stuck not working when there was zero progress
Shivansps Mar 29, 2026
9e30cd1
Add the manual CT to non anti-stuck reads
Shivansps Mar 29, 2026
95e2b55
add missing label
Shivansps Mar 30, 2026
b49f960
Bump to 1.3.4.
Shivansps Mar 30, 2026
9e17420
try to update ci
Shivansps Mar 30, 2026
8b00663
add build-android to build_release
Shivansps Mar 30, 2026
2a3e3aa
ci specify net6 target platform
Shivansps Mar 30, 2026
f5a8e62
CI Include android apk in publish release
Shivansps Mar 30, 2026
b081dc4
ci cleanup by notimaginative
Shivansps Apr 2, 2026
9923efc
suppress tfm support warnings (net6)
Shivansps Apr 2, 2026
1ca5d69
clean java libsdl xml comment param warnings
Shivansps Apr 2, 2026
39ecf20
Suppprt 32 bit android
Shivansps Apr 2, 2026
3d88fc3
(lz4) avoid incomplete stream read.
Shivansps Apr 2, 2026
3ca6775
update android version
Shivansps Apr 2, 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
51 changes: 33 additions & 18 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
ref: '${{ github.ref }}'
Expand All @@ -32,7 +32,7 @@ jobs:
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.0.x'

Expand All @@ -53,7 +53,7 @@ jobs:
tar -czvf win-builds.tgz --exclude='*.pdb' *

- name: Upload build archive
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: win-builds
path: ${{ env.PUBLISH_DIR }}/win-builds.tgz
Expand All @@ -64,7 +64,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
ref: '${{ github.ref }}'
Expand All @@ -76,7 +76,7 @@ jobs:
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.0.x'

Expand All @@ -97,19 +97,19 @@ jobs:
tar -czvf mac-builds.tgz --exclude='*.pdb' *

- name: Upload build archive
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: mac-builds
path: ${{ env.PUBLISH_DIR }}/mac-builds.tgz
retention-days: 5

package_release:
name: Linux builds, package and release
name: Linux/Android builds, package and release
needs: [build-win, build-mac]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
ref: '${{ github.ref }}'
Expand All @@ -131,23 +131,35 @@ jobs:
# nsis for windows installer
run: sudo apt-get update && sudo apt-get install zip nsis

- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.0.x'
dotnet-version: '10.0.x'

- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'

- name: Install Android workload
shell: bash
run: |
dotnet workload install android
dotnet workload list

- name: Publish Linux RIDs
- name: Publish Linux/Android RIDs
shell: bash
run: ./ci/publish_all_host.sh

- name: Download Windows build artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: win-builds
path: ${{ env.PUBLISH_DIR }}

- name: Download macOS build artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: mac-builds
path: ${{ env.PUBLISH_DIR }}
Expand Down Expand Up @@ -175,7 +187,10 @@ jobs:
run: ${{ github.workspace }}/ci/create_appimage.sh

- name: Generate Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: ${{ env.OUTPUT_DIR }}/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} \
--title "${{ github.ref_name }}" \
--draft \
${{ env.OUTPUT_DIR }}/*
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ mono_crash.*
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
Expand Down
30 changes: 30 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project>
<!-- https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management -->
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<!-- Avalonia packages -->
<!-- Important: keep version in sync! -->
<PackageVersion Include="Avalonia" Version="11.3.11" />
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.3.11" />
<PackageVersion Include="Avalonia.Fonts.Inter" Version="11.3.11" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.11" />
<PackageVersion Include="Avalonia.Desktop" Version="11.3.11" />
<PackageVersion Include="Avalonia.iOS" Version="11.3.6" />
<PackageVersion Include="Avalonia.Browser" Version="11.3.6" />
<PackageVersion Include="Avalonia.Android" Version="11.3.11" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0.1" />
<PackageVersion Include="AnimatedImage.Avalonia" Version="1.0.7" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.11" />
<PackageVersion Include="Avalonia.HtmlRenderer" Version="11.2.0" />
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.3.11" />
<PackageVersion Include="ini-parser-netstandard" Version="2.5.3" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.3" />
<PackageVersion Include="ObservableCollections" Version="3.3.4" />
<PackageVersion Include="SharpCompress" Version="0.39.0" />
<PackageVersion Include="WindowsShortcutFactory" Version="1.2.0" />
</ItemGroup>
</Project>
10 changes: 8 additions & 2 deletions IonKiwi.lz4/IonKiwi.lz4.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(BuildAndroid)' == 'true'">
<TargetFrameworks>net10.0-android</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildAndroid)' != 'true'">
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net60</TargetFrameworks>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageId>IonKiwi.lz4.managed</PackageId>
<Version>1.0.7</Version>
Expand Down
4 changes: 3 additions & 1 deletion IonKiwi.lz4/LZ4RawUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ public static unsafe int LZ41_Stream_Decompress(Stream inputStream, Stream outpu
/* The difference in offsets is the size of the block */
int cmpBytes = offsets[currentBlock + 1] - offsets[currentBlock];
byte[] cmpBuf = new byte[lz4.LZ4_compressBound(blockSize)];
inputStream.Read(cmpBuf,0, cmpBytes);
var readBytes = inputStream.Read(cmpBuf,0, cmpBytes);
if (readBytes != cmpBytes)
throw new Exception("Incomplete read from stream");
fixed (byte* cmpPtr = cmpBuf)
{
fixed (byte* decBuf = new byte[blockSize])
Expand Down
Binary file added Knossos.NET.Android/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions Knossos.NET.Android/Knossos.NET.Android.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ApplicationVersion>3</ApplicationVersion>
<AndroidVersionCode>3</AndroidVersionCode>
<ApplicationDisplayVersion>1.3.4</ApplicationDisplayVersion>
<ApplicationId>com.knossosnet.knossosnet</ApplicationId>
<RuntimeIdentifiers>android-arm64;android-x64;android-arm;android-x86</RuntimeIdentifiers>
<TargetFramework>net10.0-android</TargetFramework>
<SupportedOSPlatformVersion>28</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateApplicationManifest>true</GenerateApplicationManifest>
<AndroidUseAapt2>true</AndroidUseAapt2>
<RunAOTCompilation>false</RunAOTCompilation>
</PropertyGroup>

<ItemGroup>
<AndroidNativeLibrary Include="natives\arm64-v8a\*.so" Abi="arm64-v8a" />
<AndroidNativeLibrary Include="natives\armeabi-v7a\*.so" Abi="armeabi-v7a"/>
<AndroidNativeLibrary Include="natives\x86\*.so" Abi="x86" />
<AndroidNativeLibrary Include="natives\x86_64\*.so" Abi="x86_64"/>
</ItemGroup>

<ItemGroup>
<AndroidJavaSource Include="java\**\*.java" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'Release'">
<AvaloniaResource Include="Assets\**" />
</ItemGroup>

<ItemGroup>
<AndroidResource Include="Icon.png">
<Link>Resources\drawable\Icon.png</Link>
</AndroidResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Android" />
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Knossos.NET\Knossos.NET.csproj" />
</ItemGroup>
</Project>
154 changes: 154 additions & 0 deletions Knossos.NET.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
using Android.Content;
using Android.Content.PM;
using Android.Views;
using AndroidX.Core.Content;
using AndroidX.Core.View;
using Avalonia;
using Avalonia.Android;
using Avalonia.Threading;
using Knossos.NET.Classes;
using AndroidNet = global::Android.Net;

namespace Knossos.NET.Android;

[Activity(
Label = "Knossos.NET",
Theme = "@style/MyTheme.NoActionBar",
Icon = "@drawable/icon",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.Orientation
| ConfigChanges.ScreenSize
| ConfigChanges.UiMode,
ScreenOrientation = ScreenOrientation.SensorLandscape)]
public class MainActivity : AvaloniaMainActivity<App>
{
public static MainActivity? Instance { get; private set; }

protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.WithInterFont();
}

private void hideSystemUI()
{
WindowCompat.SetDecorFitsSystemWindows(Window, false);

var windowInsetsController = WindowCompat.GetInsetsController(Window, Window?.DecorView);

if (windowInsetsController != null)
{
// Hide both navigation and status bars
windowInsetsController.Hide(WindowInsetsCompat.Type.SystemBars());

// Or only navigation bars:
//windowInsetsController.Hide(WindowInsetsCompat.Type.NavigationBars());

// Set behavior to show bars temporarily on swipe
windowInsetsController.SystemBarsBehavior = WindowInsetsControllerCompat.BehaviorShowTransientBarsBySwipe;
}
}

public override void OnWindowFocusChanged(bool hasFocus)
{
base.OnWindowFocusChanged(hasFocus);
if(hasFocus)
hideSystemUI();
}

protected override void OnCreate(Bundle? savedInstanceState)
{
Window?.AddFlags(WindowManagerFlags.KeepScreenOn);
//Window?.AddFlags(WindowManagerFlags.Fullscreen);

base.OnCreate(savedInstanceState);
Instance = this;
AndroidHelper.ShareTextAsyncFunc = ShareTextFileAndroidAsync;
AndroidHelper.ShareFileAsyncFunc = OpenFileExternalApp;
AndroidHelper.OpenUrlAsyncFunc = OpenExternalURLAsync;
hideSystemUI();
}

protected override void OnResume()
{
base.OnResume();
hideSystemUI();
}

private static async Task ShareTextFileAndroidAsync(string texto)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
if (Instance == null) return;

var intent = new Intent(Intent.ActionSend);
intent.SetType("text/plain");
intent.PutExtra(Intent.ExtraText, texto);
intent.AddFlags(ActivityFlags.NewTask);

try
{
var chooser = Intent.CreateChooser(intent, "Open text with...");
Instance.StartActivity(chooser);
}
catch (Exception ex)
{
Log.Add(Log.LogSeverity.Error, "MainActivity.ShareTextFileAndroidAsync", ex);
}
});
}

private static async Task OpenFileExternalApp(string fullPath, string mimetype)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
if (!System.IO.File.Exists(fullPath) || Instance == null)
return;

try
{
var javaFile = new Java.IO.File(fullPath);
string authority = $"{Instance.PackageName}.fileprovider";

var uri = FileProvider.GetUriForFile(Instance, authority, javaFile);

var intent = new Intent(Intent.ActionView);
intent.SetDataAndType(uri, mimetype);
intent.AddFlags(ActivityFlags.GrantReadUriPermission);
intent.AddFlags(ActivityFlags.NewTask);

Instance.StartActivity(Intent.CreateChooser(intent, "Open file with..."));
}
catch (Exception ex)
{
Log.Add(Log.LogSeverity.Error, "MainActivity.OpenFileExternalApp", ex);
}
});
}

private static async Task OpenExternalURLAsync(string url)
{
if (string.IsNullOrWhiteSpace(url)) return;

await Dispatcher.UIThread.InvokeAsync(() =>
{
if (Instance == null) return;

try
{
if (!url.StartsWith("http", StringComparison.OrdinalIgnoreCase))
url = "https://" + url.Trim();

var uri = AndroidNet.Uri.Parse(url);
var intent = new Intent(Intent.ActionView, uri);
intent.AddFlags(ActivityFlags.NewTask);

Instance.StartActivity(intent);
}
catch (Exception ex)
{
Log.Add(Log.LogSeverity.Error, "MainActivity.OpenExternalURLAsync", ex);
}
});
}
}
Loading