From bb36f3e24ffce06bbed2bdaddc2b0f894ab6782a Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Tue, 25 Jan 2022 09:31:59 -0500 Subject: [PATCH] Temporary workaround for C++ SDK Crash. See https://github.com/firebase/firebase-cpp-sdk/issues/700. If GULLogger checks for the App Store Receipt URL too early in the app's lifecycle, the app will crash. This is a workaround to disable debug logging entirely (bypassing the check). --- GoogleUtilities/Logger/GULLogger.m | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/GoogleUtilities/Logger/GULLogger.m b/GoogleUtilities/Logger/GULLogger.m index c5f6f1d1..62b0a98d 100644 --- a/GoogleUtilities/Logger/GULLogger.m +++ b/GoogleUtilities/Logger/GULLogger.m @@ -84,11 +84,14 @@ void GULLoggerEnableSTDERR(void) { } void GULLoggerForceDebug(void) { +#warning Return instead of doing anything to avoid the App Store check. + return; + // We should enable debug mode if we're not running from App Store. - if (![GULAppEnvironmentUtil isFromAppStore]) { - sGULLoggerDebugMode = YES; - GULSetLoggerLevel(GULLoggerLevelDebug); - } + // if (![GULAppEnvironmentUtil isFromAppStore]) { + // sGULLoggerDebugMode = YES; + // GULSetLoggerLevel(GULLoggerLevelDebug); + // } } __attribute__((no_sanitize("thread"))) void GULSetLoggerLevel(GULLoggerLevel loggerLevel) { @@ -98,8 +101,10 @@ void GULLoggerForceDebug(void) { return; } GULLoggerInitializeASL(); +#warning Ensure nothing below Notice is set to avoid the App Store check. // We should not raise the logger level if we are running from App Store. - if (loggerLevel >= GULLoggerLevelNotice && [GULAppEnvironmentUtil isFromAppStore]) { + // if (loggerLevel >= GULLoggerLevelNotice && [GULAppEnvironmentUtil isFromAppStore]) { + if (loggerLevel >= GULLoggerLevelNotice) { return; }