Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- Fixed the modification of the original timestamp when decompressing folders ([#190])
- Fixed a crash when opening very large text files in the built-in editor by adding a 1 MB size limit ([#123])

## [1.6.1] - 2026-02-14
### Changed
Expand Down Expand Up @@ -125,6 +126,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#105]: https://github.com/FossifyOrg/File-Manager/issues/105
[#106]: https://github.com/FossifyOrg/File-Manager/issues/106
[#120]: https://github.com/FossifyOrg/File-Manager/issues/120
[#123]: https://github.com/FossifyOrg/File-Manager/issues/123
[#131]: https://github.com/FossifyOrg/File-Manager/issues/131
[#136]: https://github.com/FossifyOrg/File-Manager/issues/136
[#149]: https://github.com/FossifyOrg/File-Manager/issues/149
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ReadTextActivity : SimpleActivity() {
private const val SELECT_SAVE_FILE_INTENT = 1
private const val SELECT_SAVE_FILE_AND_EXIT_INTENT = 2
private const val KEY_UNSAVED_TEXT = "KEY_UNSAVED_TEXT"
private const val FILE_SIZE_LIMIT = 1000 * 1000 // 1 MB, same limit as Fossify Notes
}

private val binding by viewBinding(ActivityReadTextBinding::inflate)
Expand Down Expand Up @@ -285,6 +286,18 @@ class ReadTextActivity : SimpleActivity() {
}

private fun checkIntent(uri: Uri, savedInstanceState: Bundle?) {
val fileSize = if (uri.scheme == "file") {
File(uri.path!!).length()
} else {
getSizeFromContentUri(uri)
}

if (fileSize > FILE_SIZE_LIMIT) {
toast(R.string.file_too_large)
finish()
return
}

originalText = if (uri.scheme == "file") {
filePath = uri.path!!
val file = File(filePath)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

<!-- File Editor -->
<string name="file_editor">File Editor</string>
<string name="file_too_large">File too large, the limit is 1MB</string>

<!-- Storage analysis -->
<string name="storage_analysis">Storage analysis</string>
Expand Down
Loading