Commit graph

2393 commits

Author SHA1 Message Date
Tom Levy
99cea602c8 Fix deletion of random SMS when trying to update threads
Commit 44c540b9 (Fixed updating last message after deleting (#167),
2021-09-04) introduced a hack to update the conversation snippet,
however there is a bug in that code: it tries to delete by thread ID,
but the condition is applied to the SMS table, not to the threads
table.[1] So instead of deleting the thread with that ID, it deletes
whichever SMS happens to have that ID.

The fix is to change the condition to an always-false condition, so
that no messages will be deleted. The threads will still get
updated.[2]

Fixes #148.

[1] https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/android14-release/src/com/android/providers/telephony/MmsSmsProvider.java#1405
[2] https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/android14-release/src/com/android/providers/telephony/MmsSmsProvider.java#1409
2024-05-20 01:43:25 +00:00
Tom Levy
a7edeae6f3 Use streams to encode and decode the JSON backups
This significantly reduces memory usage.

(We buffer the OutputStream because kotlinx.serialization flushes its
internal buffers excessively[1]. We also buffer the InputStream for
consistency, even though kotlinx.serialization uses adequate
buffering; there is no performance impact because BufferedInputStream
cascades harmlessly[2].)

The functions encodeToStream() and decodeFromStream() are marked as
experimental, but this is a pretty fundamental use case so surely it
will continue to be supported in the future (maybe with minor
changes).

Fixes #6.

[1] https://github.com/Kotlin/kotlinx.serialization/blob/v1.6.3/formats/json/jvmMain/src/kotlinx/serialization/json/internal/JvmJsonStreams.kt#L46
[2] https://github.com/openjdk/jdk/blob/jdk-23%2B14/src/java.base/share/classes/java/io/BufferedInputStream.java#L339
2024-05-20 01:43:25 +00:00
Tom Levy
b18e8aa11e Allow importing files with MIME type "application/octet-stream"
Sometimes Android reports the MIME type as "application/octet-stream"
even if the file has a .json extension (specifically, on Android 8 and
9 for backups exported outside the Download folder). Previously, such
files could not be selected in the file picker when importing.

As a workaround, allow files with that MIME type.

Fixes #88.
2024-05-20 01:43:25 +00:00
Tom Levy
7e2202b64a Fix missing .json file extension when exporting messages
Very similar to FossifyOrg/Notes#14 (which has a more detailed commit
message). Basically, some file pickers don't automatically append the
extension, so we should do it ourselves. It doesn't cause problems.

Reported in #88.
2024-05-20 01:43:25 +00:00
Tom Levy
dd2cc7f0e2 Refactor extensions/Context.kt slightly
No behaviour change.

- Simplify insertOrUpdateConversation(), since the previous code was long and
  hard to follow.

- Inline constants into selection queries instead of using '?' arguments.
2024-05-20 01:43:25 +00:00
Tom Levy
9534a1031a Delete exported file on error
If ActivityResultContracts.CreateDocument launches the native Files
app (com.android.documentsui), then it will create the file before the
Uri is returned to us.

So if we don't complete the export (due to an exception or because
there are no messages) we should delete the file, otherwise there will
be an empty/incomplete file left behind.
2024-05-20 01:43:25 +00:00
Tom Levy
1198a8c495 Report OutOfMemoryError when importing and exporting messages
When importing/exporting large files we can run out of memory, in
which case we should display a toast to the user (as we do for other
exceptions). Previously, the OutOfMemoryError was not caught because
it inherits from Error, not from Exception.

(We have to manually call .toString() because Context.showErrorToast()
from Commons takes an Exception or a String, not Throwable.)
2024-05-20 01:43:25 +00:00
Umut Solmz
c35819c52d
Translated using Weblate (Turkish)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/tr/
2024-05-19 22:30:54 +02:00
lucasmz
4c0214c4a2
Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/pt_BR/
2024-05-19 22:30:52 +02:00
Ali Najafi
f071c1a07c
Translated using Weblate (Persian)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/fa/
2024-05-19 22:30:51 +02:00
A
76e6097431
Translated using Weblate (Finnish)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/fi/
2024-05-19 22:30:49 +02:00
張可揚
5dcfe45ef8
Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/zh_Hant/
2024-05-19 22:30:48 +02:00
Josep M. Ferrer
a0abab71c8
Translated using Weblate (Catalan)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/ca/
2024-05-19 22:30:48 +02:00
Argo Carpathians
f90f5f77d4
Translated using Weblate (Indonesian)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/id/
2024-05-19 22:30:47 +02:00
Argo Carpathians
202f58ad37
Translated using Weblate (Indonesian)
Currently translated at 83.1% (89 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/id/
2024-05-19 22:30:46 +02:00
Anonymous
9c4b0a666c
Translated using Weblate (Danish)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/da/
2024-05-19 22:30:45 +02:00
Guillaume
ce8dff6fd6
Translated using Weblate (Dutch)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/nl/
2024-05-19 22:30:43 +02:00
Igor Sorocean
3328ec66b0
Translated using Weblate (Romanian)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/ro/
2024-05-19 22:30:42 +02:00
ngocanhtve
6d83eb01fd
Translated using Weblate (Vietnamese)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/vi/
2024-05-19 22:30:41 +02:00
Mbuni21
371813f893
Translated using Weblate (Hebrew)
Currently translated at 61.6% (66 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/he/
2024-05-19 22:30:41 +02:00
Flavio F. M
ca6c59c98b
Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/pt_BR/
2024-05-19 22:30:36 +02:00
Gabriel Canaple
e9a54eded9
Translated using Weblate (French)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/fr/
2024-05-19 22:30:35 +02:00
SalaryTheft
08669048d3
Translated using Weblate (Korean)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/ko/
2024-05-19 22:30:35 +02:00
Dan
24e1a5ba16
Translated using Weblate (Ukrainian)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/uk/
2024-05-19 22:30:33 +02:00
lianergoist
9c55964923
Translated using Weblate (Danish)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/da/
2024-05-19 22:30:32 +02:00
jorge2000x
6956d75de4
Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/pt_BR/
2024-05-19 22:30:31 +02:00
Tom Levy
7ece8fe97d Use a unique app name for debug builds
This matches the other Fossify apps. It helps avoid confusion when a
user installs both an official release and a debug version.
2024-05-19 11:36:57 +00:00
ronniedroid
c53f537b63 switched to using ActivityResultContracts 2024-04-29 12:01:17 +03:00
lianergoist
de4733334a
Update danish strings.xml 2024-02-10 11:15:26 +01:00
lianergoist
465e528b07
Merge branch 'FossifyOrg:master' into patch-1 2024-02-10 00:01:24 +01:00
lianergoist
f563d187a3
Update strings.xml 2024-02-09 23:59:24 +01:00
Software In Interlingua
70586b12c0
Translated using Weblate (Interlingua)
Currently translated at 2.8% (3 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/ia/
2024-02-09 02:40:13 +01:00
Nitin Khalia
b04bbf915e
Translated using Weblate (Hindi)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/hi/
2024-02-08 17:57:07 +01:00
Daniel
9512853136
Translated using Weblate (Romanian)
Currently translated at 53.2% (57 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/ro/
2024-02-08 17:57:07 +01:00
Ghost of Sparta
0ddffe409b
Translated using Weblate (Hungarian)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/hu/
2024-02-08 17:57:07 +01:00
Scrambled777
32d433fa4e
Translated using Weblate (Hindi)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/hi/
2024-02-08 17:57:07 +01:00
Hosted Weblate
c774cdd304
Update translation files
Updated by "Remove blank strings" hook in Weblate.

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/
2024-02-08 17:57:07 +01:00
pt22
0fc62a22ad
Translated using Weblate (Portuguese (Portugal))
Currently translated at 73.8% (79 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/pt_PT/
2024-02-08 17:57:07 +01:00
Josep M. Ferrer
a40d371d3d
Translated using Weblate (Catalan)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/ca/
2024-02-08 17:57:07 +01:00
Ziiga
aab5e035fc
Translated using Weblate (Slovenian)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/sl/
2024-02-08 17:57:07 +01:00
Aanarcho
e8b706f75b
Translated using Weblate (Portuguese)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/pt/
2024-02-08 17:57:07 +01:00
Alexander Gabilondo
9bca6a193c
Translated using Weblate (Basque)
Currently translated at 8.4% (9 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/eu/
2024-02-08 17:57:07 +01:00
Dan
1b6890cd38
Translated using Weblate (Ukrainian)
Currently translated at 98.1% (105 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/uk/
2024-02-08 17:57:07 +01:00
VfBFan
7961649344
Translated using Weblate (German)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/de/
2024-02-08 17:57:07 +01:00
Naveen Singh
c3dedf8403
Merge pull request #58 from Aga-C/limit-message-box-size
Added limit to the message box size (#55)
2024-02-08 22:27:03 +05:30
Agnieszka C
3ab91c94f7 Increased max lines to 8 2024-02-08 16:33:13 +01:00
Naveen Singh
55973d87c0
Merge pull request #53 from Aga-C/fix-padding
Reduced padding between conversations (#51)
2024-02-08 20:20:47 +05:30
lianergoist
e0e92f0aa4
Update danish strings.xml 2024-01-31 21:21:36 +01:00
ronniedroid
958644b290 FEATURE: Import and export blocked keywords 2024-01-30 15:42:42 +03:00
Milo Ivir
3b885c5d34
Translated using Weblate (Croatian)
Currently translated at 100.0% (107 of 107 strings)

Translation: Fossify/Messages
Translate-URL: https://hosted.weblate.org/projects/fossify/sms-messenger/hr/
2024-01-28 15:50:10 +01:00