diff --git a/app/build.gradle b/app/build.gradle index ca23ec53..0f9738a8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,14 +62,14 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:d04f40487b' + implementation 'com.github.SimpleMobileTools:Simple-Commons:0907d2e57f' implementation 'org.greenrobot:eventbus:3.3.1' implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61' implementation 'com.github.tibbi:android-smsmms:fe58a74d59' implementation "me.leolin:ShortcutBadger:1.1.22" implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - kapt "androidx.room:room-compiler:2.3.0" - implementation "androidx.room:room-runtime:2.3.0" - annotationProcessor "androidx.room:room-compiler:2.3.0" + kapt "androidx.room:room-compiler:2.4.2" + implementation "androidx.room:room-runtime:2.4.2" + annotationProcessor "androidx.room:room-compiler:2.4.2" } diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt index b1f7d218..8dd7fc19 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt @@ -631,12 +631,14 @@ class ThreadActivity : SimpleActivity() { } var prevDateTime = 0 + var prevSIMId = -2 var hadUnreadItems = false val cnt = messages.size for (i in 0 until cnt) { val message = messages.getOrNull(i) ?: continue - // do not show the date/time above every message, only if the difference between the 2 messages is at least MIN_DATE_TIME_DIFF_SECS - if (message.date - prevDateTime > MIN_DATE_TIME_DIFF_SECS) { + // do not show the date/time above every message, only if the difference between the 2 messages is at least MIN_DATE_TIME_DIFF_SECS, + // or if the message is sent from a different SIM + if (message.date - prevDateTime > MIN_DATE_TIME_DIFF_SECS || prevSIMId != message.subscriptionId) { val simCardID = subscriptionIdToSimId[message.subscriptionId] ?: "?" items.add(ThreadDateTime(message.date, simCardID)) prevDateTime = message.date @@ -660,6 +662,7 @@ class ThreadActivity : SimpleActivity() { if (i == cnt - 1 && (message.type == Telephony.Sms.MESSAGE_TYPE_SENT)) { items.add(ThreadSent(message.id, delivered = message.status == Telephony.Sms.STATUS_COMPLETE)) } + prevSIMId = message.subscriptionId } if (hadUnreadItems) { diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/DirectReplyReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/DirectReplyReceiver.kt index 4cc8470c..b02d72ef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/DirectReplyReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/DirectReplyReceiver.kt @@ -1,22 +1,22 @@ package com.simplemobiletools.smsmessenger.receivers +import android.annotation.SuppressLint import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import android.telephony.SubscriptionManager import androidx.core.app.RemoteInput import com.klinker.android.send_message.Transaction import com.simplemobiletools.commons.extensions.notificationManager import com.simplemobiletools.commons.extensions.showErrorToast import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.smsmessenger.extensions.conversationsDB -import com.simplemobiletools.smsmessenger.extensions.getSendMessageSettings -import com.simplemobiletools.smsmessenger.extensions.markThreadMessagesRead -import com.simplemobiletools.smsmessenger.extensions.removeDiacriticsIfNeeded +import com.simplemobiletools.smsmessenger.extensions.* import com.simplemobiletools.smsmessenger.helpers.REPLY import com.simplemobiletools.smsmessenger.helpers.THREAD_ID import com.simplemobiletools.smsmessenger.helpers.THREAD_NUMBER class DirectReplyReceiver : BroadcastReceiver() { + @SuppressLint("MissingPermission") override fun onReceive(context: Context, intent: Intent) { val address = intent.getStringExtra(THREAD_NUMBER) val threadId = intent.getLongExtra(THREAD_ID, 0L) @@ -25,6 +25,17 @@ class DirectReplyReceiver : BroadcastReceiver() { msg = context.removeDiacriticsIfNeeded(msg) val settings = context.getSendMessageSettings() + if (address != null) { + val availableSIMs = SubscriptionManager.from(context).activeSubscriptionInfoList + if (availableSIMs?.size ?: 0 > 1) { + val currentSIMCardIndex = context.config.getUseSIMIdAtNumber(address) + val wantedId = availableSIMs.getOrNull(currentSIMCardIndex) + if (wantedId != null) { + settings.subscriptionId = wantedId.subscriptionId + } + } + } + val transaction = Transaction(context, settings) val message = com.klinker.android.send_message.Message(msg, address) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt index 17f26eb1..3c58a135 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt @@ -10,6 +10,7 @@ import android.provider.Telephony import com.bumptech.glide.Glide import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.request.RequestOptions +import com.simplemobiletools.commons.extensions.baseConfig import com.simplemobiletools.commons.extensions.getMyContactsCursor import com.simplemobiletools.commons.extensions.isNumberBlocked import com.simplemobiletools.commons.helpers.SimpleContactsHelper @@ -34,6 +35,7 @@ class SmsReceiver : BroadcastReceiver() { val read = 0 val subscriptionId = intent.getIntExtra("subscription", -1) + val privateCursor = context.getMyContactsCursor(false, true) ensureBackgroundThread { messages.forEach { address = it.originatingAddress ?: "" @@ -44,39 +46,53 @@ class SmsReceiver : BroadcastReceiver() { threadId = context.getThreadId(address) } - val bitmap = getPhotoForNotification(address, context) + if (context.baseConfig.blockUnknownNumbers) { + val simpleContactsHelper = SimpleContactsHelper(context) + simpleContactsHelper.exists(address, privateCursor) { exists -> + if (exists) { + handleMessage(context, address, subject, body, date, read, threadId, type, subscriptionId, status) + } + } + } else { + handleMessage(context, address, subject, body, date, read, threadId, type, subscriptionId, status) + } + } + } - Handler(Looper.getMainLooper()).post { + private fun handleMessage( + context: Context, address: String, subject: String, body: String, date: Long, read: Int, threadId: Long, type: Int, subscriptionId: Int, status: Int + ) { + val bitmap = getPhotoForNotification(address, context) + Handler(Looper.getMainLooper()).post { + if (!context.isNumberBlocked(address)) { val privateCursor = context.getMyContactsCursor(false, true) - if (!context.isNumberBlocked(address)) { - ensureBackgroundThread { - val newMessageId = context.insertNewSMS(address, subject, body, date, read, threadId, type, subscriptionId) + ensureBackgroundThread { + val newMessageId = context.insertNewSMS(address, subject, body, date, read, threadId, type, subscriptionId) - val conversation = context.getConversations(threadId).firstOrNull() ?: return@ensureBackgroundThread - try { - context.conversationsDB.insertOrUpdate(conversation) - } catch (ignored: Exception) { - } - - try { - context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations()) - } catch (ignored: Exception) { - } - - val senderName = context.getNameFromAddress(address, privateCursor) - val phoneNumber = PhoneNumber(address, 0, "", address) - val participant = SimpleContact(0, 0, senderName, "", arrayListOf(phoneNumber), ArrayList(), ArrayList()) - val participants = arrayListOf(participant) - val messageDate = (date / 1000).toInt() - - val message = - Message(newMessageId, body, type, status, participants, messageDate, false, threadId, false, null, address, "", subscriptionId) - context.messagesDB.insertOrUpdate(message) - refreshMessages() + val conversation = context.getConversations(threadId).firstOrNull() ?: return@ensureBackgroundThread + try { + context.conversationsDB.insertOrUpdate(conversation) + } catch (ignored: Exception) { } - context.showReceivedMessageNotification(address, body, threadId, bitmap) + try { + context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations()) + } catch (ignored: Exception) { + } + + val senderName = context.getNameFromAddress(address, privateCursor) + val phoneNumber = PhoneNumber(address, 0, "", address) + val participant = SimpleContact(0, 0, senderName, "", arrayListOf(phoneNumber), ArrayList(), ArrayList()) + val participants = arrayListOf(participant) + val messageDate = (date / 1000).toInt() + + val message = + Message(newMessageId, body, type, status, participants, messageDate, false, threadId, false, null, address, "", subscriptionId) + context.messagesDB.insertOrUpdate(message) + refreshMessages() } + + context.showReceivedMessageNotification(address, body, threadId, bitmap) } } } diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml new file mode 100644 index 00000000..88b1121b --- /dev/null +++ b/app/src/main/res/values-az/strings.xml @@ -0,0 +1,99 @@ + + + Simple SMS Messenger + SMS Messenger + Type a message… + Message not sent + Not sent. Touch to retry. + Your message to \'%s\' has not been sent + Add Person + Attachment + No stored conversations have been found + Start a conversation + Reply + Show a character counter at writing messages + Loading messages… + Sender doesn\'t support replies + Draft + Sending… + Pin to the top + Unpin + Forward + Unable to compress image to selected size + + New conversation + Add Contact or Number… + Suggestions + + Received SMS + New message + Mark as Read + Mark as Unread + + Are you sure you want to delete all messages of this conversation? + + + %d conversation + %d conversations + + + + %d message + %d messages + + + Lock screen notification visibility + Sender and message + Sender only + Enable delivery reports + Remove accents and diacritics at sending messages + Resize sent MMS images + No limit + Outgoing messages + Send group messages as MMS + Send long messages as MMS + + Messages + Export messages + Export SMS + Export MMS + Import messages + Import SMS + Import MMS + You have to select at least one item + + Why does the app require access to the internet? + Sadly it is needed for sending MMS attachments. Not being able to send MMS would be a really huge disadvantage compared to other apps, so we decided to go this way. + However, as usually, there are no ads, tracking or analytics whatsoever, the internet is used only for sending MMS. + The other end is not receiving my MMS, is there anything I can do about it? + MMS size is limited by carriers, you can try setting a smaller limit in the app settings. + + + Simple SMS Messenger - Manage messages easily + + An easy and quick way of managing SMS and MMS messages without ads. + + A great way to stay in touch with your relatives, by sending both SMS and MMS messages. The app properly handles group messaging too, just like blocking numbers from Android 7+. + + It offers many date formats to choose from, to make you feel comfortable at using it. You can toggle between 12 and 24 hours time format too. + + It has a really tiny app size compared to the competition, making it really fast to download. + + It comes with material design and dark theme by default, provides great user experience for easy usage. The lack of internet access gives you more privacy, security and stability than other apps. + + Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors. + + Check out the full suite of Simple Tools here: + https://www.simplemobiletools.com + + Facebook: + https://www.facebook.com/simplemobiletools + + Reddit: + https://www.reddit.com/r/SimpleMobileTools + + + diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 3bc4d6b2..28f6dc11 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -18,8 +18,8 @@ Odesílá se… Pin to the top Odepnout konverzaci - Forward - Unable to compress image to selected size + Přeposlat + Nepodařilo se komprimovat obrázek na požadovanou velikost Nová konverzace Přidejte kontakt nebo číslo… @@ -30,43 +30,45 @@ Označit jako přečtené Označit jako nepřečtené - Opravdu chcete smazat všechny zprávy z této konverzace? + Opravdu chcete smazat všechny zprávy v této konverzaci\? - %d conversation - %d conversations + %d konverzace + %d konverzace + %d konverzací - %d message - %d messages + %d zpráva + %d zprávy + %d zpráv - Lock screen notification visibility - Sender and message - Sender only - Enable delivery reports - Remove accents and diacritics at sending messages - Resize sent MMS images - No limit - Outgoing messages - Send group messages as MMS - Send long messages as MMS + Viditelnost upozornění na uzamčené obrazovce + Odesílatel a zpráva + Pouze odesílatel + Povolit oznámení o doručení + Odstranit diakritiku při odesílání zprávy + Změnit velikost odeslaných obrázků MMS + Bez omezení + Odchozí zprávy + Odesílat skupinové zprávy jako MMS + Odesílat dlouhé zprávy jako MMS Export zpráv Messages Export SMS - Export MMS + Exportovat MMS Import zpráv Import SMS - Import MMS - You have to select at least one item + Importovat MMS + Musíte vybrat alespoň jednu položku - Proč aplikace vyžaduje přístup k internetu? + Proč vyžaduje aplikace přístup k internetu\? Je smutné, že je to nutné pro odesílání příloh MMS. Nebýt schopen posílat MMS by byla opravdu obrovská nevýhoda ve srovnání s jinými aplikacemi, proto jsme se rozhodli jít touto cestou. Jako obvykle však neexistují žádné reklamy, sledování ani analytika, internet se používá pouze k odesílání MMS. - The other end is not receiving my MMS, is there anything I can do about it? - MMS size is limited by carriers, you can try setting a smaller limit in the app settings. + Druhá strana nepřijímá mé MMS, je něco, co s tím mohu udělat\? + Velikost MMS je omezena operátory, můžete zkusit nastavit menší limit v nastavení aplikace. Simple SMS Messenger - Snadná správa zpráv diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml new file mode 100644 index 00000000..88b1121b --- /dev/null +++ b/app/src/main/res/values-en-rUS/strings.xml @@ -0,0 +1,99 @@ + + + Simple SMS Messenger + SMS Messenger + Type a message… + Message not sent + Not sent. Touch to retry. + Your message to \'%s\' has not been sent + Add Person + Attachment + No stored conversations have been found + Start a conversation + Reply + Show a character counter at writing messages + Loading messages… + Sender doesn\'t support replies + Draft + Sending… + Pin to the top + Unpin + Forward + Unable to compress image to selected size + + New conversation + Add Contact or Number… + Suggestions + + Received SMS + New message + Mark as Read + Mark as Unread + + Are you sure you want to delete all messages of this conversation? + + + %d conversation + %d conversations + + + + %d message + %d messages + + + Lock screen notification visibility + Sender and message + Sender only + Enable delivery reports + Remove accents and diacritics at sending messages + Resize sent MMS images + No limit + Outgoing messages + Send group messages as MMS + Send long messages as MMS + + Messages + Export messages + Export SMS + Export MMS + Import messages + Import SMS + Import MMS + You have to select at least one item + + Why does the app require access to the internet? + Sadly it is needed for sending MMS attachments. Not being able to send MMS would be a really huge disadvantage compared to other apps, so we decided to go this way. + However, as usually, there are no ads, tracking or analytics whatsoever, the internet is used only for sending MMS. + The other end is not receiving my MMS, is there anything I can do about it? + MMS size is limited by carriers, you can try setting a smaller limit in the app settings. + + + Simple SMS Messenger - Manage messages easily + + An easy and quick way of managing SMS and MMS messages without ads. + + A great way to stay in touch with your relatives, by sending both SMS and MMS messages. The app properly handles group messaging too, just like blocking numbers from Android 7+. + + It offers many date formats to choose from, to make you feel comfortable at using it. You can toggle between 12 and 24 hours time format too. + + It has a really tiny app size compared to the competition, making it really fast to download. + + It comes with material design and dark theme by default, provides great user experience for easy usage. The lack of internet access gives you more privacy, security and stability than other apps. + + Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors. + + Check out the full suite of Simple Tools here: + https://www.simplemobiletools.com + + Facebook: + https://www.facebook.com/simplemobiletools + + Reddit: + https://www.reddit.com/r/SimpleMobileTools + + + diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml new file mode 100644 index 00000000..88b1121b --- /dev/null +++ b/app/src/main/res/values-hr/strings.xml @@ -0,0 +1,99 @@ + + + Simple SMS Messenger + SMS Messenger + Type a message… + Message not sent + Not sent. Touch to retry. + Your message to \'%s\' has not been sent + Add Person + Attachment + No stored conversations have been found + Start a conversation + Reply + Show a character counter at writing messages + Loading messages… + Sender doesn\'t support replies + Draft + Sending… + Pin to the top + Unpin + Forward + Unable to compress image to selected size + + New conversation + Add Contact or Number… + Suggestions + + Received SMS + New message + Mark as Read + Mark as Unread + + Are you sure you want to delete all messages of this conversation? + + + %d conversation + %d conversations + + + + %d message + %d messages + + + Lock screen notification visibility + Sender and message + Sender only + Enable delivery reports + Remove accents and diacritics at sending messages + Resize sent MMS images + No limit + Outgoing messages + Send group messages as MMS + Send long messages as MMS + + Messages + Export messages + Export SMS + Export MMS + Import messages + Import SMS + Import MMS + You have to select at least one item + + Why does the app require access to the internet? + Sadly it is needed for sending MMS attachments. Not being able to send MMS would be a really huge disadvantage compared to other apps, so we decided to go this way. + However, as usually, there are no ads, tracking or analytics whatsoever, the internet is used only for sending MMS. + The other end is not receiving my MMS, is there anything I can do about it? + MMS size is limited by carriers, you can try setting a smaller limit in the app settings. + + + Simple SMS Messenger - Manage messages easily + + An easy and quick way of managing SMS and MMS messages without ads. + + A great way to stay in touch with your relatives, by sending both SMS and MMS messages. The app properly handles group messaging too, just like blocking numbers from Android 7+. + + It offers many date formats to choose from, to make you feel comfortable at using it. You can toggle between 12 and 24 hours time format too. + + It has a really tiny app size compared to the competition, making it really fast to download. + + It comes with material design and dark theme by default, provides great user experience for easy usage. The lack of internet access gives you more privacy, security and stability than other apps. + + Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors. + + Check out the full suite of Simple Tools here: + https://www.simplemobiletools.com + + Facebook: + https://www.facebook.com/simplemobiletools + + Reddit: + https://www.reddit.com/r/SimpleMobileTools + + + diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 61e88cc7..4965e3a5 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -1,3 +1,4 @@ + Jednoduché SMS správy SMS správy @@ -19,35 +20,29 @@ Odopnúť Preposlať Nepodarilo sa zmenšiť obrázok na požadovanú veľkosť - Nová konverzácia Pridať kontakt alebo číslo… Návrhy - Prijatá SMS Nová správa Označiť ako prečítané Označiť ako neprečítané - - Ste si istý, že chcete odstrániť všetky správy tejto konverzácie? - + Ste si istý, že chcete odstrániť všetky správy tejto konverzácie\? %d konverzáciu %d konverzácie %d konverzácií - %d správu %d správy %d správ - Viditeľnosť pripomienky na uzavretej obrazovke Odosielateľ a správa @@ -59,7 +54,6 @@ Odchádzajúce správy Odosielať skupinové správy ako MMS Odosielať dlhé správy ako MMS - Správy Exportovať správy @@ -69,14 +63,12 @@ Importovať SMS Importovať MMS Musíte označiť aspoň jednu možnosť - - Prečo vyžaduje apka prístup na internet? + Prečo vyžaduje apka prístup na internet\? Je to žiaľ nevyhnutné pre odosielanie MMS príloh. Ak by sa ich nedalo odosielať, bola by to obrovská nevýhoda v porovnaní s konkurenciou, preto sme sa rozhodli takto. Ako ale stále, ani v tejto apke nie sú reklamy, sledovanie, ani vôbec žiadne analytiky. Internet sa používa jedine pri odosielaní MMS. Druhá strana nedostáva moje MMS, viem s tým niečo spraviť? Veľkosť MMS je obmedzená operátormi, skúste zvoliť menší limit v nastaveniach apky. - Jednoduché SMS správy - Spravujte správy pohodlne @@ -102,9 +94,8 @@ Reddit: https://www.reddit.com/r/SimpleMobileTools - - + \ No newline at end of file diff --git a/fastlane/metadata/android/bg/full_description.txt b/fastlane/metadata/android/bg/full_description.txt new file mode 100644 index 00000000..114ca976 --- /dev/null +++ b/fastlane/metadata/android/bg/full_description.txt @@ -0,0 +1,16 @@ +Страхотен начин да поддържате връзка с вашите роднини, изпращайки и SMS и MMS съобщения. Програмата също така добре се справя със съобщения до група получатели, както и с блокиране на номера след Android 7+. + +Тя предлага избор от много формати за дата, за да се чувствате удобно при употребата. Също може да се превключва между 12 и 24 часови формати. + +Приложението е с наистина много малък размер в сравнение с конкурентните програми, като по този начин се сваля бързо от интернет. Използва material дизайн и тъмна тема по подразбиране, осигурявайки страхотно потребителско изживяване за лесно употреба. Липсата на достъпване на интернет ви осигурява повече поверителност, сигурност и стабилнот от други програми. + +Не съдържа реклами или ненужни разрешения. Напълно с отворен код е, има сменяеми цветове. + +Вижте пълната колекция на Simple Tools тук: +https://www.simplemobiletools.com + +Фейсбук: +https://www.facebook.com/simplemobiletools + +Редит: +https://www.reddit.com/r/SimpleMobileTools diff --git a/fastlane/metadata/android/bg/short_description.txt b/fastlane/metadata/android/bg/short_description.txt new file mode 100644 index 00000000..3c91eb49 --- /dev/null +++ b/fastlane/metadata/android/bg/short_description.txt @@ -0,0 +1 @@ +Лесен и бърз начин за управление на SMS и MMS съобщения без реклами. diff --git a/fastlane/metadata/android/bg/title.txt b/fastlane/metadata/android/bg/title.txt new file mode 100644 index 00000000..c44be91d --- /dev/null +++ b/fastlane/metadata/android/bg/title.txt @@ -0,0 +1 @@ +Simple SMS Messenger - Лесни съобщения