From e5a0d335af77d9f98453e794f77b91fb4abcc1e8 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 21 Aug 2025 08:00:29 +0800 Subject: [PATCH] fix osFamily name for sentry, update android-all --- forge-gui-android/pom.xml | 3 +- forge-gui-android/src/forge/app/Main.java | 46 ++++++++++++++++++- .../src/forge/app/GameLauncher.java | 3 +- forge-gui-mobile/src/forge/Forge.java | 26 +++++------ 4 files changed, 61 insertions(+), 17 deletions(-) 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..7ca244e9cf0 100644 --- a/forge-gui-android/src/forge/app/Main.java +++ b/forge-gui-android/src/forge/app/Main.java @@ -208,9 +208,10 @@ public class Main extends AndroidApplication { 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 +872,49 @@ 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 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();