feat: add iSphere live probe recorder
This commit is contained in:
@@ -9,6 +9,11 @@ namespace ISphereWinHelper
|
||||
[STAThread]
|
||||
private static int Main(string[] args)
|
||||
{
|
||||
if (ShouldRunLiveProbeRecorder(args))
|
||||
{
|
||||
return LiveProbeRecorder.Run(args);
|
||||
}
|
||||
|
||||
string requestText = Console.In.ReadToEnd();
|
||||
Dictionary<string, object> request;
|
||||
string requestId = "";
|
||||
@@ -39,6 +44,9 @@ namespace ISphereWinHelper
|
||||
case "dump_uia":
|
||||
response = UiaDumper.Dump(requestId, op, opArgs);
|
||||
break;
|
||||
case "probe_client_runtime":
|
||||
response = HelperProtocol.Success(requestId, op, RuntimeProbe.ProbeClientRuntime(opArgs));
|
||||
break;
|
||||
default:
|
||||
response = HelperProtocol.Failure(requestId, op, "UNSUPPORTED_OP", "unsupported op: " + op);
|
||||
break;
|
||||
@@ -55,12 +63,26 @@ namespace ISphereWinHelper
|
||||
}
|
||||
}
|
||||
|
||||
private static bool ShouldRunLiveProbeRecorder(string[] args)
|
||||
{
|
||||
foreach (string arg in args)
|
||||
{
|
||||
if (string.Equals(arg, "--record-live-probe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
string exeName = Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName);
|
||||
return exeName != null && exeName.IndexOf("LiveProbeRecorder", StringComparison.OrdinalIgnoreCase) >= 0;
|
||||
}
|
||||
|
||||
private static Dictionary<string, object> VersionData()
|
||||
{
|
||||
return new Dictionary<string, object>
|
||||
{
|
||||
{ "helper_name", "ISphereWinHelper" },
|
||||
{ "helper_version", "0.1.0" },
|
||||
{ "helper_version", "0.3.0" },
|
||||
{ "protocol", HelperProtocol.Protocol },
|
||||
{ "runtime", ".NET Framework " + Environment.Version }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user