If `ReportActivity` was started with a large report, i.e a few hundred `KB`, like for terminal transcript or other command output, the activity start would fail. To solve the issue, if the serialized size of the ReportInfo info object is above `DataUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES` (`100KB`), it will be saved to a file in a cache directory `/data/data/com.termux/cache/report_activity` as a serialized object and loaded when activity is started. The file will be automatically deleted when activity is destroyed (`Activity.onDetroy()`) or when notification that would have started the activity is deleted (`Notification.deleteIntent`). In case, these two didn't happen, then on `TermuxActivity` startup, a thread will be started to delete files older than `14` days so that unneeded left over files are deleted. If user tries to open plugin error or crash report notifications after 14 days, they will get `ReportInfo` file not found errors, assuming `TermuxActivity` was started to run the cleanup routine. Now these large reports can't be copied or shared with other apps since that would again result in `TransactionTooLargeException` exceptions and `ShareUtils` automatically truncates the data (now from end) to `100KB` length so that the exception doesn't occur. So now a `Save To File` option has been added in context menu (3 dots on top right) of `ReportActivity` so that large or small reports can be saved to a file if needed. They will be save in root of `/storage/emulated/0` or whatever is the default public external storage directory. The filename would depend on type of report. The storage permissions will be asked if missing. On android `11`, if you get permission denied errors even after granting permission, disable permission and grant it again. To solve privacy issues of report being saved to public storage since it may contain private info, an option for custom path will be added in future. The default directory is public storage instead of termux home since its easily accessible via all file managers or from pc. Instructing amateur users to get files via `SAF` from termux home is not something I wanna take on. Another issue is that `ReportActivity` itself may not be able to show the entire report since Android may throw `OutOfMemoryError` exceptions if device memory is low. To solve this issue, `ReportActivity` will truncate the report to `1MB` from end that's shown to the user. It will add a header showing that report was truncated. To view the full report, the user will have to use the `Save To File` option and view the file in an external app or on pc that supports opening large files. The `QuickEdit` app on Android has been a reliable one in my experience that supports large files, although it has max row/column limits too at a few hundred thousand, depending on android version. Despite all this, `OutOfMemoryError` exceptions could still be thrown if you try to view too large a report, like a few MB, since original report + the truncated report is still held in memory by the app and will consume `2-3` times memory when saving. It's fun coding for android, right? The terminal transcript will not be truncated anymore that's generated via `Report Issue` option in terminal. The `ShareUtils.copyTextToClipboard()` will truncate data now automatically, apparently all phones don't do it automatically and exception is raised. The `ShareUtils.saveTextToFile()` has been added that will automatically ask for storage permissions if missing. The `ReportInfo` now expects a `reportSaveFileLabel` and `reportSaveFilePath` arguments so that `ReportActivity` can use them to know where to save the file if users selects `Save To File` option. The `ReportActivityBroadcastReceiver` must now be registered in `AndroidManifest.xml` if you are using `ReportActivity` in your app. Check `ReportActivity` javadoc for details. Moreover, an incremental call to `ReportActivity.deleteReportInfoFilesOlderThanXDays()` must also be made.
72 lines
3.8 KiB
XML
72 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<!DOCTYPE resources [
|
|
<!ENTITY TERMUX_PACKAGE_NAME "com.termux">
|
|
<!ENTITY TERMUX_APP_NAME "Termux">
|
|
<!ENTITY TERMUX_API_APP_NAME "Termux:API">
|
|
<!ENTITY TERMUX_BOOT_APP_NAME "Termux:Boot">
|
|
<!ENTITY TERMUX_FLOAT_APP_NAME "Termux:Float">
|
|
<!ENTITY TERMUX_STYLING_APP_NAME "Termux:Styling">
|
|
<!ENTITY TERMUX_TASKER_APP_NAME "Termux:Tasker">
|
|
<!ENTITY TERMUX_WIDGET_APP_NAME "Termux:Widget">
|
|
]>
|
|
|
|
<resources>
|
|
|
|
<string name="msg_directory_absolute_path">%1$s Directory Absolute Path: \"%2$s\"</string>
|
|
|
|
|
|
|
|
<!-- PackageUtils -->
|
|
<string name="error_get_package_context_failed_title">Failed To Get Package Context</string>
|
|
<string name="error_get_package_context_failed_message">Failed to get package context for the \"%1$s\" package. This may be because the app package is not installed or it has different APK signature from the current app. Check install instruction at %2$s for more details.</string>
|
|
|
|
|
|
|
|
<!-- PermissionUtils -->
|
|
<string name="message_sudo_please_grant_permissions">Please grant permissions on next screen</string>
|
|
|
|
|
|
|
|
<!-- ReportActivity -->
|
|
<string name="action_copy">Copy</string>
|
|
<string name="action_share">Share</string>
|
|
<string name="action_save_to_file">Save To File</string>
|
|
<string name="title_report_text">Report Text</string>
|
|
<string name="msg_report_truncated">**Report Truncated**\n\nReport is too large to view here. Use `Save To File` option from options menu (3-dots on top right) and view it in an external text editor app.\n\n##\n\n</string>
|
|
|
|
|
|
|
|
<!-- ShareUtils -->
|
|
<string name="title_share_with">Share With</string>
|
|
<string name="msg_storage_permission_not_granted">The storage permission not granted."</string>
|
|
<string name="msg_file_saved_successfully">The %1$s file saved successfully at \"%2$s\""</string>
|
|
|
|
|
|
|
|
<!-- ShellUtils -->
|
|
<string name="error_sending_sigkill_to_process">Sending SIGKILL to process on user request or because android is killing the execution service</string>
|
|
<string name="error_execution_cancelled">Execution has been cancelled since execution service is being killed</string>
|
|
<string name="error_failed_to_execute_termux_session_command">"Failed to execute \"%1$s\" termux session command"</string>
|
|
<string name="error_failed_to_execute_termux_task_command">"Failed to execute \"%1$s\" termux task command"</string>
|
|
<string name="error_exception_received_while_executing_termux_session_command">Exception received while to executing \"%1$s\" termux session command.\nException: %2$s</string>
|
|
<string name="error_exception_received_while_executing_termux_task_command">Exception received while to executing \"%1$s\" termux task command.\nException: %2$s"</string>
|
|
|
|
|
|
|
|
<!-- TermuxUtils -->
|
|
<string name="msg_report_issue">If you want to report this issue, then copy its text from the options menu (3-dots on top right) and post an issue on one of the following links.\n\nIf you are posting a Termux app crash report, then please provide details on what you were doing that caused the crash and how to reproduce it, if possible.\n\nIf you are posting an issue on Github, then post it in the repository at which the report belongs at. You may optionally remove any device specific info that you consider private or don\'t want to share or that is not relevant to the issue.</string>
|
|
|
|
|
|
|
|
<!-- Log Level -->
|
|
<string name="log_level_title">Log Level</string>
|
|
<string name="log_level_off">"Off"</string>
|
|
<string name="log_level_normal">"Normal"</string>
|
|
<string name="log_level_debug">"Debug"</string>
|
|
<string name="log_level_verbose">"Verbose"</string>
|
|
<string name="log_level_unknown">"*Unknown*"</string>
|
|
<string name="log_level_value">Logcat log level set to \"%1$s\"</string>
|
|
|
|
</resources>
|