From 1be757788bd7ff3adbb51b50535a2d7cd1b53e86 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 9 Nov 2018 15:06:17 -0500 Subject: [PATCH] Prevent long version strings from being scrubbed in the logs. --- SignalServiceKit/src/Util/AppVersion.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SignalServiceKit/src/Util/AppVersion.m b/SignalServiceKit/src/Util/AppVersion.m index faef959ac..503c60420 100755 --- a/SignalServiceKit/src/Util/AppVersion.m +++ b/SignalServiceKit/src/Util/AppVersion.m @@ -68,11 +68,16 @@ NSString *const kNSUserDefaults_LastCompletedLaunchAppVersion_SAE [[NSUserDefaults appUserDefaults] setObject:self.currentAppVersion forKey:kNSUserDefaults_LastAppVersion]; [[NSUserDefaults appUserDefaults] synchronize]; + // The long version string looks like an IPv4 address. + // To prevent the log scrubber from scrubbing it, + // we replace . with _. + NSString *longVersionString = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] + stringByReplacingOccurrencesOfString:@"." + withString:@"_"]; + OWSLogInfo(@"firstAppVersion: %@", self.firstAppVersion); OWSLogInfo(@"lastAppVersion: %@", self.lastAppVersion); - OWSLogInfo(@"currentAppVersion: %@ (%@)", - self.currentAppVersion, - [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]); + OWSLogInfo(@"currentAppVersion: %@ (%@)", self.currentAppVersion, longVersionString); OWSLogInfo(@"lastCompletedLaunchAppVersion: %@", self.lastCompletedLaunchAppVersion); OWSLogInfo(@"lastCompletedLaunchMainAppVersion: %@", self.lastCompletedLaunchMainAppVersion);