From c9177663cab4bcf235994993ef3e1cbc0076f5b0 Mon Sep 17 00:00:00 2001 From: marc-n-dream Date: Tue, 28 Oct 2025 16:11:22 +0100 Subject: [PATCH 1/2] . F: Add support to override the game version from adb for native builds without rebuilding This enables rapid testing of controllers and the AirConsole platform without requiring native rebuilds, enabling impact and risk assessment with android native builds. --- Assets/AirConsole/scripts/Runtime/AirConsole.cs | 3 ++- .../scripts/Runtime/Plugin/Android/AndroidUnityUtils.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/AirConsole/scripts/Runtime/AirConsole.cs b/Assets/AirConsole/scripts/Runtime/AirConsole.cs index 3cf459b4..b8a22afb 100644 --- a/Assets/AirConsole/scripts/Runtime/AirConsole.cs +++ b/Assets/AirConsole/scripts/Runtime/AirConsole.cs @@ -6,7 +6,6 @@ using System.Collections.ObjectModel; using System; using System.Diagnostics; -using System.Threading; using NDream.AirConsole.Android.Plugin; using WebSocketSharp.Server; using Newtonsoft.Json.Linq; @@ -2115,6 +2114,8 @@ private void CreateAndroidWebview(string connectionUrl) { url += $"&bundle-version={GetAndroidBundleVersionCode()}"; } + androidGameVersion = AndroidIntentUtils.GetIntentExtraString("game_version", androidGameVersion); + url += "&game-id=" + Application.identifier; url += "&game-version=" + androidGameVersion; url += "&unity-version=" + Application.unityVersion; diff --git a/Assets/AirConsole/scripts/Runtime/Plugin/Android/AndroidUnityUtils.cs b/Assets/AirConsole/scripts/Runtime/Plugin/Android/AndroidUnityUtils.cs index 2d7d5cec..1bfcf6d8 100644 --- a/Assets/AirConsole/scripts/Runtime/Plugin/Android/AndroidUnityUtils.cs +++ b/Assets/AirConsole/scripts/Runtime/Plugin/Android/AndroidUnityUtils.cs @@ -11,7 +11,7 @@ public static string GetIntentExtraString(string key, string defaultValue) { using (AndroidJavaClass unityPlayer = new("com.unity3d.player.UnityPlayer")) { AndroidJavaObject currentActivity = unityPlayer.GetStatic("currentActivity"); AndroidJavaObject intent = currentActivity.Call("getIntent"); - return intent.Call("getStringExtra", key); + return intent.Call("getStringExtra", key) ?? defaultValue; } } catch (System.Exception e) { AirConsoleLogger.LogWarning(() => "Error getting intent extra: " + e); From a4790c9ad2923a767fc67e895aab409777b02a66 Mon Sep 17 00:00:00 2001 From: marc-n-dream Date: Tue, 28 Oct 2025 16:16:02 +0100 Subject: [PATCH 2/2] d: Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b3bcb51..52ed8b1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ This includes security related updates like requiring fixed Unity versions and i - **Unity API:** `OnMaximumVolumeChanged` event to notify when the games maximum volume must be changed. - **Android:** After the last device disconnects, the webview is reset along the game state. +- **Android:** Add support to override the game version used in a previously built android game through intent extras with adb. ### Removed