diff --git a/Signal/src/util/Pastelog.m b/Signal/src/util/Pastelog.m index ee69b0784..582f244d9 100644 --- a/Signal/src/util/Pastelog.m +++ b/Signal/src/util/Pastelog.m @@ -17,6 +17,7 @@ #import #import #import +#import NS_ASSUME_NONNULL_BEGIN @@ -502,13 +503,33 @@ typedef void (^DebugLogUploadFailure)(DebugLogUploader *uploader, NSError *error { NSString *emailAddress = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"LOGS_EMAIL"]; - NSString *body = [NSString stringWithFormat:@"Log URL: %@ \n Tell us about the issue: ", url]; + NSMutableString *body = [NSMutableString new]; + + [body appendFormat:@"Tell us about the issue: \n\n\n"]; + + size_t size; + sysctlbyname("hw.machine", NULL, &size, NULL, 0); + char *machine = malloc(size); + sysctlbyname("hw.machine", machine, &size, NULL, 0); + NSString *platform = [NSString stringWithUTF8String:machine]; + free(machine); + + [body appendFormat:@"Device: %@ (%@)\n", UIDevice.currentDevice.model, platform]; + [body appendFormat:@"iOS Version: %@ \n", [UIDevice currentDevice].systemVersion]; + [body appendFormat:@"Signal Version: %@ \n", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]; + [body appendFormat:@"Log URL: %@ \n", url]; + NSString *escapedBody = [body stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; NSString *urlString = [NSString stringWithFormat:@"mailto:%@?subject=iOS%%20Debug%%20Log&body=%@", emailAddress, escapedBody]; - [UIApplication.sharedApplication openURL:[NSURL URLWithString:urlString]]; + BOOL success = [UIApplication.sharedApplication openURL:[NSURL URLWithString:urlString]]; + if (!success) { + OWSLogError(@"Could not open Email app."); + [OWSAlerts showErrorAlertWithMessage:NSLocalizedString(@"DEBUG_LOG_COULD_NOT_EMAIL", + @"Error indicating that the app could not launch the Email app.")]; + } } - (void)prepareRedirection:(NSURL *)url completion:(SubmitDebugLogsCompletion)completion diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 263dbcd7b..9757f16ef 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -684,6 +684,9 @@ Title of the debug log alert. */ "DEBUG_LOG_ALERT_TITLE" = "One More Step"; +/* Error indicating that the app could not launch the Email app. */ +"DEBUG_LOG_COULD_NOT_EMAIL" = "Could not open Email app."; + /* Message of the alert before redirecting to GitHub Issues. */ "DEBUG_LOG_GITHUB_ISSUE_ALERT_MESSAGE" = "The gist link was copied in your clipboard. You are about to be redirected to the GitHub issue list."; @@ -1206,9 +1209,6 @@ /* Label for the MIME type of attachments in the 'message metadata' view. */ "MESSAGE_METADATA_VIEW_ATTACHMENT_MIME_TYPE" = "MIME type"; -/* Label for 'not yet downloaded' attachments in the 'message metadata' view. */ -"MESSAGE_METADATA_VIEW_ATTACHMENT_NOT_YET_DOWNLOADED" = "Not yet downloaded"; - /* Status label for messages which are delivered. */ "MESSAGE_METADATA_VIEW_MESSAGE_STATUS_DELIVERED" = "Delivered"; @@ -1904,9 +1904,6 @@ /* Table header for the 'censorship circumvention' section. */ "SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION_HEADER" = "Censorship Circumvention"; -/* Label for setting that enables dark theme. */ -"SETTINGS_ADVANCED_DARK_THEME" = "Dark Theme"; - /* No comment provided by engineer. */ "SETTINGS_ADVANCED_DEBUGLOG" = "Enable Debug Log"; @@ -2171,9 +2168,6 @@ /* Label for button to verify a user's safety number. */ "SYSTEM_MESSAGE_ACTION_VERIFY_SAFETY_NUMBER" = "Verify Safety Number"; -/* No comment provided by engineer. */ -"THEME_SECTION" = "Theme"; - /* {{number of days}} embedded in strings, e.g. 'Alice updated disappearing messages expiration to {{5 days}}'. See other *_TIME_AMOUNT strings */ "TIME_AMOUNT_DAYS" = "%@ days";