From 15743748c7d55693761a8f36970c0595424a649f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger?= Date: Sun, 13 Dec 2015 22:42:06 +0100 Subject: [PATCH] Minor fix in fake USB detection Updated version --- Installer/ScpToolkit Setup.aip | 42 +++++++++---------- ScpCleanWipe/Properties/CommonInfo.cs | 4 +- ScpControl/Properties/CommonInfo.cs | 4 +- ScpControl/ScpControl.csproj | 2 +- ScpControl/Usb/Ds3/UsbDs3.cs | 10 +++-- .../Utilities/PhysicalAddressExtensions.cs | 21 ++++++++++ .../Properties/CommonInfo.cs | 4 +- ScpDriverInstaller/Properties/CommonInfo.cs | 4 +- ScpGamepadAnalyzer/Properties/CommonInfo.cs | 4 +- ScpMonitor/Properties/CommonInfo.cs | 4 +- ScpPair/Properties/CommonInfo.cs | 4 +- ScpProfiler/Properties/CommonInfo.cs | 4 +- ScpServer/Properties/CommonInfo.cs | 4 +- ScpService/Properties/CommonInfo.cs | 4 +- ScpSettings/Properties/CommonInfo.cs | 4 +- ScpXInputBridge/Properties/CommonInfo.cs | 4 +- 16 files changed, 73 insertions(+), 50 deletions(-) create mode 100644 ScpControl/Utilities/PhysicalAddressExtensions.cs diff --git a/Installer/ScpToolkit Setup.aip b/Installer/ScpToolkit Setup.aip index d116e4fb..b2052916 100644 --- a/Installer/ScpToolkit Setup.aip +++ b/Installer/ScpToolkit Setup.aip @@ -14,10 +14,10 @@ - + - + @@ -178,26 +178,26 @@ - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/ScpCleanWipe/Properties/CommonInfo.cs b/ScpCleanWipe/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpCleanWipe/Properties/CommonInfo.cs +++ b/ScpCleanWipe/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpControl/Properties/CommonInfo.cs b/ScpControl/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpControl/Properties/CommonInfo.cs +++ b/ScpControl/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpControl/ScpControl.csproj b/ScpControl/ScpControl.csproj index bed4142f..3fa5079e 100644 --- a/ScpControl/ScpControl.csproj +++ b/ScpControl/ScpControl.csproj @@ -23,7 +23,7 @@ AssemblyVersionAttribute - 1.6.201.15347 + 1.6.202.15347 true diff --git a/ScpControl/Usb/Ds3/UsbDs3.cs b/ScpControl/Usb/Ds3/UsbDs3.cs index 3c95f1a2..34185035 100644 --- a/ScpControl/Usb/Ds3/UsbDs3.cs +++ b/ScpControl/Usb/Ds3/UsbDs3.cs @@ -120,15 +120,13 @@ public override bool Open(string devicePath) Log.InfoFormat("Successfully opened device with MAC address {0}", DeviceAddress); - if (!IniConfig.Instance.Hci.GenuineMacAddresses.Any(m => DeviceAddress.ToString().StartsWith(m.Replace(":", string.Empty)))) + if (!IniConfig.Instance.Hci.GenuineMacAddresses.Any(m => DeviceAddress.AsFriendlyName().StartsWith(m))) { Log.WarnFormat("Fake DualShock 3 detected [{0}]", DeviceAddress); var bthCompany = IniConfig.Instance.BthChipManufacturers.FirstOrDefault( m => - DeviceAddress.ToString() - .ToUpper() - .StartsWith(m.PartialMacAddress.ToUpper().Replace(":", string.Empty))); + DeviceAddress.AsFriendlyName().StartsWith(m.PartialMacAddress.ToUpper())); if (bthCompany != null && bthCompany.Name.Equals("AirohaTechnologyCorp")) { @@ -140,6 +138,10 @@ public override bool Open(string devicePath) IsFake = true; } } + else + { + Log.Info("Genuine Sony DualShock 3 detected"); + } } return State == DsState.Reserved; diff --git a/ScpControl/Utilities/PhysicalAddressExtensions.cs b/ScpControl/Utilities/PhysicalAddressExtensions.cs new file mode 100644 index 00000000..5d44be08 --- /dev/null +++ b/ScpControl/Utilities/PhysicalAddressExtensions.cs @@ -0,0 +1,21 @@ +using System.Net.NetworkInformation; + +namespace ScpControl.Utilities +{ + public static class PhysicalAddressExtensions + { + public static string AsFriendlyName(this PhysicalAddress address) + { + if (address == null) + return string.Empty; + + if (address.Equals(PhysicalAddress.None)) + return "00:00:00:00:00:00"; + + var bytes = address.GetAddressBytes(); + + return string.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}", + bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5]); + } + } +} diff --git a/ScpDebugInfoCollector/Properties/CommonInfo.cs b/ScpDebugInfoCollector/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpDebugInfoCollector/Properties/CommonInfo.cs +++ b/ScpDebugInfoCollector/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpDriverInstaller/Properties/CommonInfo.cs b/ScpDriverInstaller/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpDriverInstaller/Properties/CommonInfo.cs +++ b/ScpDriverInstaller/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpGamepadAnalyzer/Properties/CommonInfo.cs b/ScpGamepadAnalyzer/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpGamepadAnalyzer/Properties/CommonInfo.cs +++ b/ScpGamepadAnalyzer/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpMonitor/Properties/CommonInfo.cs b/ScpMonitor/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpMonitor/Properties/CommonInfo.cs +++ b/ScpMonitor/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpPair/Properties/CommonInfo.cs b/ScpPair/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpPair/Properties/CommonInfo.cs +++ b/ScpPair/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpProfiler/Properties/CommonInfo.cs b/ScpProfiler/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpProfiler/Properties/CommonInfo.cs +++ b/ScpProfiler/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpServer/Properties/CommonInfo.cs b/ScpServer/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpServer/Properties/CommonInfo.cs +++ b/ScpServer/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpService/Properties/CommonInfo.cs b/ScpService/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpService/Properties/CommonInfo.cs +++ b/ScpService/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpSettings/Properties/CommonInfo.cs b/ScpSettings/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpSettings/Properties/CommonInfo.cs +++ b/ScpSettings/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file diff --git a/ScpXInputBridge/Properties/CommonInfo.cs b/ScpXInputBridge/Properties/CommonInfo.cs index f5c6024f..bb0ec45a 100644 --- a/ScpXInputBridge/Properties/CommonInfo.cs +++ b/ScpXInputBridge/Properties/CommonInfo.cs @@ -12,5 +12,5 @@ [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.6.201.15347")] -[assembly: AssemblyFileVersion("1.6.201.15347")] \ No newline at end of file +[assembly: AssemblyVersion("1.6.202.15347")] +[assembly: AssemblyFileVersion("1.6.202.15347")] \ No newline at end of file