Add http action type and Sonar mute toggle (chatCapture, media channels)

This commit is contained in:
2026-08-25 02:41:02 +02:00
parent 9797cd7e79
commit a6dc2b6230
8 changed files with 227 additions and 33 deletions
@@ -0,0 +1,43 @@
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Text.Json;
public static class SonarAddressResolver
{
private static readonly HttpClient Client = CreateInsecureClient();
private static HttpClient CreateInsecureClient()
{
var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (msg, cert, chain, errors) => true
};
return new HttpClient(handler);
}
public static async Task<string?> GetSonarAddressAsync()
{
var corePropsPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
"SteelSeries", "SteelSeries Engine 3", "coreProps.json");
if (!File.Exists(corePropsPath))
return null;
using var coreDoc = JsonDocument.Parse(File.ReadAllText(corePropsPath));
if (!coreDoc.RootElement.TryGetProperty("ggEncryptedAddress", out var ggAddr))
return null;
var subAppsJson = await Client.GetStringAsync($"https://{ggAddr.GetString()}/subApps");
using var subAppsDoc = JsonDocument.Parse(subAppsJson);
var webServerAddress = subAppsDoc.RootElement
.GetProperty("subApps")
.GetProperty("sonar")
.GetProperty("metadata")
.GetProperty("webServerAddress")
.GetString();
return webServerAddress?.Replace("http://", "").Replace("https://", "");
}
}