From 9fccd0917d55d00eb711255f328b637fc55ee386 Mon Sep 17 00:00:00 2001 From: SUPYROW Date: Sun, 26 Feb 2023 00:48:46 +0100 Subject: [PATCH 1/6] Update Constants.kt --- .../com/simplemobiletools/calendar/pro/helpers/Constants.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt index 195a98df0..03a9b2ba8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt @@ -159,7 +159,8 @@ const val LAST_MODIFIED = "LAST-MODIFIED" const val DTSTAMP = "DTSTAMP:" const val DURATION = "DURATION:" const val SUMMARY = "SUMMARY" -const val DESCRIPTION = "DESCRIPTION:" +const val DESCRIPTION = "DESCRIPTION" +val DESCRIPTION_REGEX = Regex("""DESCRIPTION(?:;[^:]*="[^"]*")*:(.*(?:\r?\n(?!\s).*)*)""") const val UID = "UID:" const val ACTION = "ACTION:" const val TRANSP = "TRANSP:" From fd61c19995b7972234228b383fb4865985bdabb6 Mon Sep 17 00:00:00 2001 From: SUPYROW Date: Sun, 26 Feb 2023 00:50:21 +0100 Subject: [PATCH 2/6] Update IcsImporter.kt --- .../simplemobiletools/calendar/pro/helpers/IcsImporter.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt index 4af4311e6..ae67f5842 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt @@ -115,7 +115,10 @@ class IcsImporter(val activity: SimpleActivity) { curTitle = line.substring(SUMMARY.length) curTitle = getTitle(curTitle).replace("\\n", "\n").replace("\\,", ",") } else if (line.startsWith(DESCRIPTION) && !isNotificationDescription) { - curDescription = line.substring(DESCRIPTION.length).replace("\\n", "\n").replace("\\,", ",") + val match = DESCRIPTION_REGEX.matchEntire(line) + if (match != null) { + curDescription = match.groups[1]?.value?.replace("\\n", "\n")?.replace("\\,", ",") ?: "" + } if (curDescription.trim().isEmpty()) { curDescription = "" } From acaa5910a6ef9956bc3649dcbb990ef1e9717772 Mon Sep 17 00:00:00 2001 From: SUPYROW Date: Wed, 1 Mar 2023 14:14:46 +0100 Subject: [PATCH 3/6] Update IcsExporter.kt on the emulator, this works. and DESCRIPTION is correct in the file. from MY tests. in helpers/IcsExporter.kt line 90: writeLn("$DESCRIPTION_EXPORT$reminderLabel") line 121: out.writeLn("$DESCRIPTION_EXPORT$substring") in helpers/Constants.kt add const val DESCRIPTION_EXPORT = "DESCRIPTION:" on the actual phone. no dice. i get an export file with 0 bytes. emulator works great, i think i'll just use the emulator instead. i don't know what to make of this now. any ideas, on why my phone and probably many other will not work correctly? or is my phone the problem?? not sure what to work on. let me know your findings, please? --- .../com/simplemobiletools/calendar/pro/helpers/IcsExporter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsExporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsExporter.kt index 1c4969b8b..7f4673268 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsExporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsExporter.kt @@ -87,7 +87,7 @@ class IcsExporter(private val activity: BaseSimpleActivity) { val reminder = it out.apply { writeLn(BEGIN_ALARM) - writeLn("$DESCRIPTION$reminderLabel") + writeLn("$DESCRIPTION_EXPORT$reminderLabel") if (reminder.type == REMINDER_NOTIFICATION) { writeLn("$ACTION$DISPLAY") } else { @@ -118,7 +118,7 @@ class IcsExporter(private val activity: BaseSimpleActivity) { while (index < description.length) { val substring = description.substring(index, Math.min(index + MAX_LINE_LENGTH, description.length)) if (isFirstLine) { - out.writeLn("$DESCRIPTION$substring") + out.writeLn("$DESCRIPTION_EXPORT$substring") } else { out.writeLn("\t$substring") } From 90e2b5295cf99e39d47b44ef625ba3e31cf44d6f Mon Sep 17 00:00:00 2001 From: SUPYROW Date: Wed, 1 Mar 2023 14:16:08 +0100 Subject: [PATCH 4/6] Update Constants.kt on the emulator, this works. and DESCRIPTION is correct in the file. from MY tests. in `helpers/IcsExporter.kt` line 90: `writeLn("$DESCRIPTION_EXPORT$reminderLabel")` line 121: `out.writeLn("$DESCRIPTION_EXPORT$substring")` in `helpers/Constants.kt` add `const val DESCRIPTION_EXPORT = "DESCRIPTION:"` on the actual phone. no dice. i get an export file with 0 bytes. emulator works great, i think i'll just use the emulator instead. i don't know what to make of this now. any ideas, on why my phone and probably many other will not work correctly? or is my phone the problem?? not sure what to work on. let me know your findings, please? --- .../com/simplemobiletools/calendar/pro/helpers/Constants.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt index 03a9b2ba8..501862617 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt @@ -160,6 +160,7 @@ const val DTSTAMP = "DTSTAMP:" const val DURATION = "DURATION:" const val SUMMARY = "SUMMARY" const val DESCRIPTION = "DESCRIPTION" +const val DESCRIPTION_EXPORT = "DESCRIPTION:" val DESCRIPTION_REGEX = Regex("""DESCRIPTION(?:;[^:]*="[^"]*")*:(.*(?:\r?\n(?!\s).*)*)""") const val UID = "UID:" const val ACTION = "ACTION:" From 0eb77c2e130762d91d0ffa0dd77eca491f9eb026 Mon Sep 17 00:00:00 2001 From: SUPYROW Date: Thu, 16 Mar 2023 09:55:50 +0100 Subject: [PATCH 5/6] Update Constants.kt val DESCRIPTION_REGEX = Regex("""DESCRIPTION(?:(?:;[^:;]*="[^"]*")*;?(?:;LANGUAGE=[^:;]*)?(?:;[^:;]*="[^"]*")*)*:(.*(?:\r?\n\s+.*)*)""") --- .../com/simplemobiletools/calendar/pro/helpers/Constants.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt index 501862617..a30b78306 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt @@ -161,7 +161,7 @@ const val DURATION = "DURATION:" const val SUMMARY = "SUMMARY" const val DESCRIPTION = "DESCRIPTION" const val DESCRIPTION_EXPORT = "DESCRIPTION:" -val DESCRIPTION_REGEX = Regex("""DESCRIPTION(?:;[^:]*="[^"]*")*:(.*(?:\r?\n(?!\s).*)*)""") +val DESCRIPTION_REGEX = Regex("""DESCRIPTION(?:(?:;[^:;]*="[^"]*")*;?(?:;LANGUAGE=[^:;]*)?(?:;[^:;]*="[^"]*")*)*:(.*(?:\r?\n\s+.*)*)""") const val UID = "UID:" const val ACTION = "ACTION:" const val TRANSP = "TRANSP:" From cc7b17da86d3548ae199d44e66ee0f0f1b4beba4 Mon Sep 17 00:00:00 2001 From: SUPYROW Date: Thu, 16 Mar 2023 09:57:41 +0100 Subject: [PATCH 6/6] Update IcsImporter.kt --- .../com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt index ae67f5842..c7161c859 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt @@ -117,7 +117,7 @@ class IcsImporter(val activity: SimpleActivity) { } else if (line.startsWith(DESCRIPTION) && !isNotificationDescription) { val match = DESCRIPTION_REGEX.matchEntire(line) if (match != null) { - curDescription = match.groups[1]?.value?.replace("\\n", "\n")?.replace("\\,", ",") ?: "" + curDescription = match.groups[1]!!.value.replace("\\n", "\n").replace("\\,", ",") ?: "" } if (curDescription.trim().isEmpty()) { curDescription = ""