Commit graph

25 commits

Author SHA1 Message Date
Naveen Singh
188e8f9ea4
Merge branch 'master' into json-streams 2024-12-25 18:10:09 +05:30
Naveen Singh
29520d5a2d
Construct import mime type based on API level
Format code.
2024-12-25 18:01:03 +05:30
Naveen Singh
8d306941a0
Merge branch 'master' into fix-import-binary-mime-type 2024-12-25 17:20:44 +05:30
Agnieszka C
48dcb05554 Added sorting blocked keywords (#256) 2024-12-08 09:50:49 +01:00
Naveen Singh
15a521df7c
Merge pull request #210 from gardener2/mms-blocking-fix
Implemented blocking logic on MMS received
2024-11-29 19:02:16 +05:30
Naveen Singh
826a7d684c
Merge pull request #136 from tom93/fix-export-missing-file-extension
Fix missing .json file extension when exporting messages
2024-11-29 18:47:51 +05:30
gardener2
23080debfe Implemented blocking logic on MMS received, for both unknown numbers and keyword filtering 2024-08-24 17:43:39 -06: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
Naveen
bc99df1ac8
Update app store metadata 2024-01-22 19:29:46 +05:30
Naveen
0bd9168f23
Remove "More apps from us" from menu 2024-01-20 00:28:56 +05:30
Naveen
7ed5f8fa90
Update notification id 2024-01-19 22:01:15 +05:30
Naveen
6157bc5689
Update contacts package name 2024-01-19 21:59:59 +05:30
Naveen
e2f83f49da
Rename package to org.fossify.messages 2024-01-18 01:05:03 +05:30
Naveen
1d675a1be9
Minor code improvement 2024-01-17 18:55:36 +05:30
Naveen
9e9eebc5ff
Use extension function 2024-01-17 18:20:20 +05:30
Naveen
18ce6557f7
Use extension function 2024-01-17 18:18:24 +05:30
Agnieszka C
535d722936 Added custom notifications 2023-12-22 09:18:47 +01:00
Naveen
a91cebea53
Update launcher icons 2023-12-21 20:13:12 +05:30
Naveen
7c042f7e6c
Remove old release notes 2023-12-21 19:56:45 +05:30
Naveen
2d8a626ec0
Rename package names to org.fossify.* 2023-12-21 18:15:03 +05:30