From 65749cbac01bed1a2b5b2d7b848f38ee44f3c406 Mon Sep 17 00:00:00 2001 From: Nikunj-Aggarwal Date: Wed, 8 Jan 2025 00:14:35 +0530 Subject: [PATCH 1/2] ErrorActivity: Use a proper zoned ISO timestamp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Will have a timezone offset and be parsable as valid ISO8601 timestamp. Also change the label in the UI to just say “Timestamp” --- .../java/org/schabi/newpipe/error/ErrorActivity.java | 10 ++++------ app/src/main/res/values/strings.xml | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java b/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java index 2f607b4876a..0e0a74cca84 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java @@ -26,7 +26,7 @@ import org.schabi.newpipe.util.ThemeHelper; import org.schabi.newpipe.util.external_communication.ShareUtils; -import java.time.LocalDateTime; +import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.stream.Collectors; @@ -67,10 +67,6 @@ public class ErrorActivity extends AppCompatActivity { public static final String ERROR_GITHUB_ISSUE_URL = "https://github.com/TeamNewPipe/NewPipe/issues"; - public static final DateTimeFormatter CURRENT_TIMESTAMP_FORMATTER = - DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); - - private ErrorInfo errorInfo; private String currentTimeStamp; @@ -107,7 +103,9 @@ protected void onCreate(final Bundle savedInstanceState) { // important add guru meditation addGuruMeditation(); - currentTimeStamp = CURRENT_TIMESTAMP_FORMATTER.format(LocalDateTime.now()); + // print current time, as zoned ISO8601 timestamp + final ZonedDateTime now = ZonedDateTime.now(); + currentTimeStamp = now.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); activityErrorBinding.errorReportEmailButton.setOnClickListener(v -> openPrivacyPolicyDialog(this, "EMAIL")); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 766491d538a..2c27e6cbb76 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -266,7 +266,7 @@ Report Info: What happened: - What:\\nRequest:\\nContent Language:\\nContent Country:\\nApp Language:\\nService:\\nGMT Time:\\nPackage:\\nVersion:\\nOS version: + What:\\nRequest:\\nContent Language:\\nContent Country:\\nApp Language:\\nService:\\nTimestamp:\\nPackage:\\nVersion:\\nOS version: Your comment (in English): Details: From edd19641ac0166d2761ebf901716d835f7c86f16 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 21 Jan 2025 16:25:54 +0100 Subject: [PATCH 2/2] ErrorActivity: add Timestamp and Package/Service to markdown export These were displayed in the UI, but not added into the markdown export string. --- app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java b/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java index 0e0a74cca84..b5dd37fdd6f 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java @@ -248,6 +248,9 @@ private String buildMarkdown() { .append("\n* __Content Language:__ ").append(getContentLanguageString()) .append("\n* __App Language:__ ").append(getAppLanguage()) .append("\n* __Service:__ ").append(errorInfo.getServiceName()) + .append("\n* __Timestamp:__ ").append(currentTimeStamp) + .append("\n* __Package:__ ").append(getPackageName()) + .append("\n* __Service:__ ").append(errorInfo.getServiceName()) .append("\n* __Version:__ ").append(BuildConfig.VERSION_NAME) .append("\n* __OS:__ ").append(getOsString()).append("\n");