From b35391c35cf4ed695cb6c86d8360aae21fc7106e Mon Sep 17 00:00:00 2001 From: Mihail Mitrofanov Date: Tue, 27 Aug 2024 12:53:12 +0200 Subject: [PATCH] fix: Exclude parent logs/ directory from exported zip archive Problem: Currently, the exported file has the following structure: * logs.zip/logs/app.log * logs.zip/logs/logcat.log The logs/ folder is unnecessary. This issue is tracked here: https://github.com/organicmaps/organicmaps/issues/6219 Solution: Now, the zip archive will contain only the files and folders inside the /logs/ directory, but not the directory itself. Signed-off-by: Mikhail Mitrofanov --- .../app/src/main/java/app/organicmaps/util/log/ZipLogsTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/app/organicmaps/util/log/ZipLogsTask.java b/android/app/src/main/java/app/organicmaps/util/log/ZipLogsTask.java index 9471bf79e2..6a51dd40df 100644 --- a/android/app/src/main/java/app/organicmaps/util/log/ZipLogsTask.java +++ b/android/app/src/main/java/app/organicmaps/util/log/ZipLogsTask.java @@ -51,7 +51,7 @@ class ZipLogsTask implements Runnable FileOutputStream dest = new FileOutputStream(toLocation, false); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest))) { - zipSubFolder(out, sourceFile, sourceFile.getParent().length()); + zipSubFolder(out, sourceFile, sourceFile.getPath().length()); } catch (Exception e) {