From 88b7ad43b7d8fa89c1ab002466c78a53fef1bca5 Mon Sep 17 00:00:00 2001 From: Max Golovanov Date: Fri, 26 Apr 2019 12:59:35 -0700 Subject: [PATCH 1/2] UUID on Mac must follow Common Schema Device IDs spec (u: prefix is required for UUID) --- lib/api/ContextFieldsProvider.cpp | 1 + lib/pal/posix/sysinfo_sources.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/api/ContextFieldsProvider.cpp b/lib/api/ContextFieldsProvider.cpp index 2a618956..bb534b08 100644 --- a/lib/api/ContextFieldsProvider.cpp +++ b/lib/api/ContextFieldsProvider.cpp @@ -174,6 +174,7 @@ namespace ARIASDK_NS_BEGIN { size_t len = strlen(deviceId); if (len >= 2 && deviceId[1] == ':' && ( + deviceId[0] == 'u' || // u: Mac OS X UUID deviceId[0] == 'a' || // a: Android ID deviceId[0] == 's' || // s: SQM ID deviceId[0] == 'x')) // x: XBox One hardware ID diff --git a/lib/pal/posix/sysinfo_sources.cpp b/lib/pal/posix/sysinfo_sources.cpp index 2409a108..abdbcc64 100644 --- a/lib/pal/posix/sysinfo_sources.cpp +++ b/lib/pal/posix/sysinfo_sources.cpp @@ -259,10 +259,11 @@ public: if (!get("devId").compare("")) { #ifdef __APPLE__ - // std::string contents = Exec("ioreg -d2 -c IOPlatformExpertDevice | awk -F\" '/IOPlatformUUID/{print $(NF-1)}'"); - char deviceId[512] = { 0 }; - get_platform_uuid(deviceId, sizeof(deviceId)); - cache["devId"] = MAT::GUID_t(deviceId).to_string(); // TODO: [MG] - do we need to prepend i:{...} here? + // std::string contents = Exec("ioreg -d2 -c IOPlatformExpertDevice | awk -F\" '/IOPlatformUUID/{print $(NF-1)}'"); + char deviceId[512] = { 0 }; + get_platform_uuid(deviceId, sizeof(deviceId)); + cache["devId"] = "u:"; + cache["devId"] += MAT::GUID_t(deviceId).to_string(); #else // We were unable to obtain Device Id using standard means. // Try to use hash of blkid + hostname instead. Both blkid From 64ccd04630b3c7a2404dd47ec507a458565e4421 Mon Sep 17 00:00:00 2001 From: Max Golovanov Date: Fri, 26 Apr 2019 15:38:39 -0700 Subject: [PATCH 2/2] Fix Edge build failures on Mac due to new compiler warnings introduced in some recent commits --- lib/api/ContextFieldsProvider.hpp | 2 +- lib/api/IRuntimeConfig.hpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/api/ContextFieldsProvider.hpp b/lib/api/ContextFieldsProvider.hpp index b0d70993..2d00a31b 100644 --- a/lib/api/ContextFieldsProvider.hpp +++ b/lib/api/ContextFieldsProvider.hpp @@ -24,7 +24,7 @@ namespace ARIASDK_NS_BEGIN ContextFieldsProvider(ContextFieldsProvider* parent); ContextFieldsProvider(ContextFieldsProvider const& copy); ContextFieldsProvider& operator=(ContextFieldsProvider const& copy); - virtual ~ContextFieldsProvider(); + virtual ~ContextFieldsProvider() noexcept; virtual void SetCommonField(const std::string& name, const EventProperty& value) override; void writeToRecord(::CsProtocol::Record& record, bool commonOnly = false); diff --git a/lib/api/IRuntimeConfig.hpp b/lib/api/IRuntimeConfig.hpp index 78871e2b..3aa5cbb6 100644 --- a/lib/api/IRuntimeConfig.hpp +++ b/lib/api/IRuntimeConfig.hpp @@ -181,6 +181,8 @@ namespace ARIASDK_NS_BEGIN /// /// Provider Group Id virtual const char* GetProviderGroupId() = 0; + + virtual ~IRuntimeConfig() {}; }; /// @endcond