From a30ac29fb4b9e3ced0a7106e2658f6aba543251a Mon Sep 17 00:00:00 2001 From: badaix Date: Fri, 19 Feb 2021 09:06:51 +0100 Subject: [PATCH] Check for MacOS iBridge MAC address and fall back --- common/utils.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/utils.hpp b/common/utils.hpp index 680273e9..2d3d0268 100644 --- a/common/utils.hpp +++ b/common/utils.hpp @@ -421,9 +421,11 @@ static std::string getHostId(const std::string defaultId = "") { std::string result = strutils::trim_copy(defaultId); - /// the Android API will return "02:00:00:00:00:00" for WifiInfo.getMacAddress(). - /// Maybe this could also happen with native code - if (!result.empty() && (result != "02:00:00:00:00:00") && (result != "00:00:00:00:00:00")) + if (!result.empty() // default provided + && (result != "00:00:00:00:00:00") // default mac returned by getMaxAddress if it fails + && (result != "02:00:00:00:00:00") // the Android API will return "02:00:00:00:00:00" for WifiInfo.getMacAddress() + && (result != "ac:de:48:00:11:22") // iBridge interface on new MacBook Pro (later 2016) + ) return result; #ifdef MACOS