From a87f33f88f2c5d8e21f8fda2381a55ba326ea784 Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 19 Sep 2023 23:41:54 +0530 Subject: [PATCH 1/4] Reset database on app update (again) --- .../com/simplemobiletools/smsmessenger/extensions/Context.kt | 1 + .../com/simplemobiletools/smsmessenger/helpers/Constants.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt index 442aebce..3902bcd6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt @@ -988,6 +988,7 @@ fun Context.getFileSizeFromUri(uri: Uri): Long { // fix a glitch at enabling Release version minifying from 5.12.3 // reset messages in 5.14.3 again, as PhoneNumber is no longer minified +// reset messages in 5.19.1 again, as SimpleContact is no longer minified fun Context.clearAllMessagesIfNeeded() { if (!config.wasDbCleared) { ensureBackgroundThread { diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt index 390ee5b6..a32d6883 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Constants.kt @@ -34,7 +34,7 @@ const val XML_MIME_TYPE = "text/xml" const val TXT_MIME_TYPE = "text/plain" const val IMPORT_SMS = "import_sms" const val IMPORT_MMS = "import_mms" -const val WAS_DB_CLEARED = "was_db_cleared_2" +const val WAS_DB_CLEARED = "was_db_cleared_3" const val EXTRA_VCARD_URI = "vcard" const val SCHEDULED_MESSAGE_ID = "scheduled_message_id" const val SOFT_KEYBOARD_HEIGHT = "soft_keyboard_height" From b63d904dfeb68b459844689786f701723a43b420 Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 19 Sep 2023 23:43:41 +0530 Subject: [PATCH 2/4] Remove unused kotlin-parcelize plugin --- app/build.gradle.kts | 1 - build.gradle.kts | 1 - gradle/libs.versions.toml | 1 - 3 files changed, 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f10ba1da..e5040028 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,7 +6,6 @@ plugins { alias(libs.plugins.android) alias(libs.plugins.kotlinAndroid) alias(libs.plugins.kotlinSerialization) - alias(libs.plugins.parcelize) alias(libs.plugins.ksp) base } diff --git a/build.gradle.kts b/build.gradle.kts index 9b58ac03..46e23adf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,6 @@ plugins { alias(libs.plugins.android).apply(false) alias(libs.plugins.kotlinAndroid).apply(false) - alias(libs.plugins.parcelize).apply(false) alias(libs.plugins.kotlinSerialization).apply(false) alias(libs.plugins.ksp).apply(false) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f6b82ae0..8ed7d753 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -60,5 +60,4 @@ room = [ android = { id = "com.android.application", version.ref = "gradlePlugins-agp" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlinSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } -parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } From 3ffc6874cb99569b9de720baf58d4a26ad4f3da0 Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 19 Sep 2023 23:52:31 +0530 Subject: [PATCH 3/4] Add proguard rules for `SimpleContact` --- app/proguard-rules.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 2c52942d..5dd8dc61 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -28,3 +28,6 @@ public static <1> INSTANCE; kotlinx.serialization.KSerializer serializer(...); } + +# Commons +-keep class com.simplemobiletools.commons.models.SimpleContact { *; } From 50198b189857c545fa7d6d226cb9d845c6afb2c3 Mon Sep 17 00:00:00 2001 From: Naveen Date: Wed, 20 Sep 2023 00:36:14 +0530 Subject: [PATCH 4/4] Add proguard rules for `Attachment` --- app/proguard-rules.pro | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 5dd8dc61..1ae3546f 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -29,5 +29,7 @@ kotlinx.serialization.KSerializer serializer(...); } -# Commons +# Gson -keep class com.simplemobiletools.commons.models.SimpleContact { *; } +-keep class com.simplemobiletools.smsmessenger.models.Attachment { *; } +-keep class com.simplemobiletools.smsmessenger.models.MessageAttachment { *; }