diff --git a/forge-gui-android/pom.xml b/forge-gui-android/pom.xml
index 1f02f1c236b..2447d905457 100644
--- a/forge-gui-android/pom.xml
+++ b/forge-gui-android/pom.xml
@@ -96,7 +96,8 @@
org.robolectric
android-all
- 15-robolectric-12468137
+
+ 15-robolectric-12650502
provided
diff --git a/forge-gui-android/src/forge/app/Main.java b/forge-gui-android/src/forge/app/Main.java
index d5bd2345faf..ad95dac3349 100644
--- a/forge-gui-android/src/forge/app/Main.java
+++ b/forge-gui-android/src/forge/app/Main.java
@@ -70,12 +70,7 @@ import org.apache.commons.lang3.tuple.Pair;
import org.jupnp.DefaultUpnpServiceConfiguration;
import org.jupnp.android.AndroidUpnpServiceConfiguration;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
+import java.io.*;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Date;
@@ -203,14 +198,14 @@ public class Main extends AndroidApplication {
device.setBrand(Build.BRAND);
device.setManufacturer(Build.MANUFACTURER);
device.setMemorySize(memInfo.totalMem);
- String cpuDesc = Build.VERSION.SDK_INT > Build.VERSION_CODES.R ? Build.SOC_MANUFACTURER + " " + Build.SOC_MODEL : Build.UNKNOWN;
- device.setCpuDescription(cpuDesc);
+ device.setCpuDescription(getCpuName());
device.setChipset(Build.HARDWARE + " " + Build.BOARD);
// OS Info
OperatingSystem os = new OperatingSystem();
- os.setName("Android " + Build.VERSION.RELEASE);
+ os.setName("Android");
os.setVersion(Build.VERSION.RELEASE);
os.setBuild(Build.DISPLAY);
+ os.setRawDescription(getAndroidOSName());
initForge(Gadapter, new HWInfo(device, os), permissiongranted, totalMemory, isTabletDevice(getContext()));
}
@@ -871,6 +866,75 @@ public class Main extends AndroidApplication {
return gameControllerDeviceIds;
}
+ public final String getAndroidOSName() {
+ final String codename;
+ switch (Build.VERSION.SDK_INT) {
+ case Build.VERSION_CODES.O:
+ codename = "Android 8 (Oreo)";
+ break;
+ case Build.VERSION_CODES.O_MR1:
+ codename = "Android 8.1 (Oreo)";
+ break;
+ case Build.VERSION_CODES.P:
+ codename = "Android 9 (Pie)";
+ break;
+ case Build.VERSION_CODES.Q:
+ codename = "Android 10 (Quince Tart)";
+ break;
+ case Build.VERSION_CODES.R:
+ codename = "Android 11 (Red Velvet)";
+ break;
+ case Build.VERSION_CODES.S:
+ codename = "Android 12 (Snow Cone)";
+ break;
+ case Build.VERSION_CODES.S_V2:
+ codename = "Android 12L (Snow Cone V2)";
+ break;
+ case Build.VERSION_CODES.TIRAMISU:
+ codename = "Android 13 (Tiramisu)";
+ break;
+ case Build.VERSION_CODES.UPSIDE_DOWN_CAKE:
+ codename = "Android 14 (Upside Down Cake)";
+ break;
+ case Build.VERSION_CODES.VANILLA_ICE_CREAM:
+ codename = "Android 15 (Vanilla Ice Cream)";
+ break;
+ case 36:
+ codename = "Android 16 (Baklava)";
+ break;
+ default:
+ codename = "Android " + Build.VERSION.SDK_INT;
+ break;
+ }
+ return codename;
+ }
+
+ public String getCpuName() {
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R)
+ return Build.SOC_MANUFACTURER + " " + Build.SOC_MODEL;
+ try {
+ FileReader fr = new FileReader("/proc/cpuinfo");
+ BufferedReader br = new BufferedReader(fr);
+ String line;
+ String cpuName = null;
+
+ while ((line = br.readLine()) != null) {
+ if (line.contains("Processor") || line.contains("model name")) {
+ // Extract the part after the colon and trim whitespace
+ String[] parts = line.split(":", 2);
+ if (parts.length > 1) {
+ cpuName = parts[1].trim();
+ break; // Found the CPU name, no need to read further
+ }
+ }
+ }
+ br.close();
+ return capitalize(cpuName);
+ } catch (IOException e) {
+ return Build.UNKNOWN;
+ }
+ }
+
public String getDeviceName() {
String manufacturer = Build.MANUFACTURER;
String model = Build.BRAND + " - " + Build.MODEL;
diff --git a/forge-gui-mobile-dev/src/forge/app/GameLauncher.java b/forge-gui-mobile-dev/src/forge/app/GameLauncher.java
index 90008d6db7b..08950da1eca 100644
--- a/forge-gui-mobile-dev/src/forge/app/GameLauncher.java
+++ b/forge-gui-mobile-dev/src/forge/app/GameLauncher.java
@@ -46,9 +46,10 @@ public class GameLauncher {
device.setCpuDescription(si.getHardware().getProcessor().getProcessorIdentifier().getName());
// OS Info
OperatingSystem os = new OperatingSystem();
- os.setName(si.getOperatingSystem() + " x" + si.getOperatingSystem().getBitness());
+ os.setName(si.getOperatingSystem().getFamily());
os.setVersion(si.getOperatingSystem().getVersionInfo().getVersion());
os.setBuild(si.getOperatingSystem().getVersionInfo().getBuildNumber());
+ os.setRawDescription(si.getOperatingSystem() + " x" + si.getOperatingSystem().getBitness());
totalRAM = Math.round(si.getHardware().getMemory().getTotal() / 1024f / 1024f);
hw = new HWInfo(device, os);
} catch (Exception e) {
diff --git a/forge-gui-mobile/src/forge/Forge.java b/forge-gui-mobile/src/forge/Forge.java
index 65c731b1084..d04cb4c62d8 100644
--- a/forge-gui-mobile/src/forge/Forge.java
+++ b/forge-gui-mobile/src/forge/Forge.java
@@ -170,20 +170,18 @@ public class Forge implements ApplicationListener {
//install our error handler
ExceptionHandler.registerErrorHandling();
//init hwInfo to log
- Gdx.app.postRunnable(() -> {
- HWInfo info = GuiBase.getHWInfo();
- if (info != null) {
- System.out.println(
- "---------------------------------------\n" +
- "APP: Forge v." + GuiBase.getInterface().getCurrentVersion() + " (" + GuiBase.getInterface() + ")" +
- "\nDEV: " + info.device().getName() +
- "\nCPU: " + info.device().getCpuDescription() +
- "\nRAM: " + GuiBase.getDeviceRAM() + " MB" +
- "\nOS: " + info.os().getName() +
- "\n---------------------------------------"
- );
- }
- });
+ HWInfo info = GuiBase.getHWInfo();
+ if (info != null) {
+ System.out.println(
+ "##########################################\n" +
+ "APP: Forge v." + GuiBase.getInterface().getCurrentVersion() +
+ "\nDEV: " + info.device().getName() +
+ "\nCPU: " + info.device().getCpuDescription() +
+ "\nRAM: " + GuiBase.getDeviceRAM() + " MB" +
+ "\nOS: " + info.os().getRawDescription() +
+ "\n##########################################"
+ );
+ }
// closeSplashScreen() is called early on non-Windows OS so it will not crash, LWJGL3 bug on AWT Splash.
if (OperatingSystem.isWindows())
getDeviceAdapter().closeSplashScreen();