Skip to content

Commit

Permalink
Check for MacOS iBridge MAC address and fall back
Browse files Browse the repository at this point in the history
  • Loading branch information
badaix committed Feb 19, 2021
1 parent 66c5331 commit a30ac29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions common/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a30ac29

Please sign in to comment.