Skip to content

Commit

Permalink
Temporary workaround for C++ SDK Crash.
Browse files Browse the repository at this point in the history
See firebase/firebase-cpp-sdk#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).
  • Loading branch information
ryanwilson committed Jan 25, 2022
1 parent b3bb0c5 commit bb36f3e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions GoogleUtilities/Logger/GULLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}

Expand Down

0 comments on commit bb36f3e

Please sign in to comment.