Skip to content

Commit fb2f750

Browse files
committed
Temporary workaround for C++ SDK Crash.
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).
1 parent 8c4fcf6 commit fb2f750

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

GoogleUtilities/Logger/GULLogger.m

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ void GULLoggerEnableSTDERR(void) {
8484
}
8585

8686
void GULLoggerForceDebug(void) {
87+
#warning Return instead of doing anything to avoid the App Store check.
88+
return;
89+
8790
// We should enable debug mode if we're not running from App Store.
88-
if (![GULAppEnvironmentUtil isFromAppStore]) {
89-
sGULLoggerDebugMode = YES;
90-
GULSetLoggerLevel(GULLoggerLevelDebug);
91-
}
91+
// if (![GULAppEnvironmentUtil isFromAppStore]) {
92+
// sGULLoggerDebugMode = YES;
93+
// GULSetLoggerLevel(GULLoggerLevelDebug);
94+
// }
9295
}
9396

9497
__attribute__((no_sanitize("thread"))) void GULSetLoggerLevel(GULLoggerLevel loggerLevel) {
@@ -98,8 +101,10 @@ void GULLoggerForceDebug(void) {
98101
return;
99102
}
100103
GULLoggerInitializeASL();
104+
#warning Ensure nothing below Notice is set to avoid the App Store check.
101105
// We should not raise the logger level if we are running from App Store.
102-
if (loggerLevel >= GULLoggerLevelNotice && [GULAppEnvironmentUtil isFromAppStore]) {
106+
// if (loggerLevel >= GULLoggerLevelNotice && [GULAppEnvironmentUtil isFromAppStore]) {
107+
if (loggerLevel >= GULLoggerLevelNotice) {
103108
return;
104109
}
105110

0 commit comments

Comments
 (0)