Commit Graph

993 Commits

Author SHA1 Message Date
agnostic-apollo
b711a467c1 Bump to v0.113 2021-05-16 23:44:43 +05:00
agnostic-apollo
d736b1eba5 Implement TermuxActivity callbacks in TermuxTerminalViewClient and TermuxTerminalSessionClient 2021-05-16 23:33:44 +05:00
agnostic-apollo
58d577066a Release terminal beep SoundPool resources on activity stop to attempt to prevent exception
The following exception may be thrown, likely because of unreleased resources.

Related https://stackoverflow.com/a/28708351/14686958

java.util.concurrent.TimeoutException: android.media.SoundPool.finalize() timed out after 10 seconds
  at android.media.SoundPool.native_release(Native Method)
  at android.media.SoundPool.release(SoundPool.java:177)
  at android.media.SoundPool.finalize(SoundPool.java:182)
  at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250)
  at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237)
  at java.lang.Daemons$Daemon.run(Daemons.java:103)
  at java.lang.Thread.run(Thread.java:764)
2021-05-16 23:33:44 +05:00
agnostic-apollo
89a1e02713 Updates to terminal cursor blinking
Fixed bug where cursor would become invisible when long holding (arrow) keys when editing commands (outside of text editors like nano).

Updated javadocs with info on how cursor blinking works

"Performance Improvements" and removed redundant mRendering check
2021-05-16 23:33:44 +05:00
Leonid Pliushch
6524a619f6 update bootstrap archives 2021-05-16 19:40:25 +03:00
agnostic-apollo
f8ccbb4953 Log invalid values stored in termux.properties file during load time
All external and internal values were already logged and required log level to be set to "Verbose" in Termux Settings, but now invalid  values and the default value used instead will be logged at log level "Normal" as well.

The `TermuxPropertyConstants` class has been updated to `v0.10.0`. Check its Changelog sections for info on changes.
2021-05-16 01:31:34 +05:00
agnostic-apollo
31298b8857 Allow users to enable terminal cursor blinking with termux.properties
This `terminal-cursor-blink-rate` key can be used to enable terminal cursor blinking. The user can set an int value between `100` and `2000` which will be used as blink rate in millisecond. The default value is `0`, which disables cursor blinking. So adding an entry like `terminal-cursor-blink-rate=600` to `~/termux.properties` file will make the cursor attempt to blink every 600ms. Running `termux-reload-settings` command will also update the cursor blinking rate instantaneously if changed.

A background thread is used to control the blinking by toggling the cursor visibility and then invalidating the view every x milliseconds set. This will have a performance impact, so use wisely and at your own risk.

If the cursor itself is disabled, which is controlled by whether DECSET_BIT_CURSOR_ENABLED (DECSET 25, DECTCEM), then blinking will be automatically disabled. You can enable the cursor with `tput cnorm` or `echo -e '\e[?25h'` and disable it with `tput civis` or `echo -e '\e[?25l'`.

Note that you can also change the cursor color by adding `cursor` property to `~/colors.properties` file, like `cursor=#FFFFFF` for a white cursor.

The `TermuxPropertyConstants` class has been updated to `v0.9.0`. Check its Changelog sections for info on changes.

Closes #153
2021-05-15 16:35:54 +05:00
agnostic-apollo
11f5c0afd1 Normalize gradlew.bat 2021-05-14 08:41:15 +05:00
agnostic-apollo
27dc211e2d Update .gitattributes 2021-05-14 08:05:08 +05:00
agnostic-apollo
2f828255ee Generate potentially long running reports in background threads instead of main UI thread 2021-05-14 07:05:14 +05:00
agnostic-apollo
339b2a24a2 Add support for setting Termux:Tasker log level from TermuxSettings 2021-05-14 06:47:42 +05:00
agnostic-apollo
6de3713049 Add in-app Donation link in Termux Settings for non google playstore releases
The `TermuxConstants` class has been updated to `v0.22.0`. Check its Changelog sections for info on changes.
2021-05-14 05:19:18 +05:00
agnostic-apollo
79df863b75 Ensure we read/write to/from current SharedPreferences
When getting SharedPreferences of other termux sharedUserId app packages, we get its Context first and if its null, it would mean that the package is not installed or likely has a different signature. For this case, we force exit the app in some places, since that shouldn't occur. Previously, if it was null, we were defaulting to getting SharedPreferences of current package context instead, which would mix keys of other packages with current one. SharedPreferences of other app packages aren't being used currently, so this isn't an issue, this commit just fixes the issue for future.

Force exit will also be triggered if Termux is forked and TermuxConstants.TERMUX_PACKAGE_NAME is not updated to the same value as applicationId since TermuxActivity.onCreate() will fail to get SharedPreferences of TermuxConstants.TERMUX_PACKAGE_NAME.

Moreover, its normally not allowed to install apps with different signatures, but if its done, we "may" need AndroidManifest `queries` entries in andorid 11, check PackageUtils.getSigningCertificateSHA256DigestForPackage() for details.
2021-05-14 03:54:13 +05:00
agnostic-apollo
af115c9966 Add generic functions to show a message in dialog and exit app with an error message 2021-05-13 17:37:01 +05:00
agnostic-apollo
1e30022ce7 Add support for APK signing certificate SHA-256 digest and detecting APK release type and add them to App Info reports
The `TermuxConstants` class has been updated to `v0.21.0`. Check its Changelog sections for info on changes.
2021-05-13 15:40:09 +05:00
agnostic-apollo
4629276500 Changed TermuxAppSharedPreferences function naming convention 2021-05-13 05:08:25 +05:00
agnostic-apollo
d42514d8c9 Moved Termux app settings into dedicated "directory" in Termux Settings and added About page
The `TermuxConstants` class has been updated to `v0.20.0`. Check its Changelog sections for info on changes.
2021-05-13 05:07:45 +05:00
agnostic-apollo
90c9a7b3bc Allow users to disable soft keyboard automatically if hardware keyboard is connected
Users can enable this behaviour by enabling the `Termux Settings` -> `Keyboard I/O` -> `Soft Keyboard Only If No Hardware` toggle.

Currently, for this case, soft keyboard will be disabled on Termux app startup and when switching back from another app. Soft keyboard can be temporarily enabled in show/hide soft keyboard toggle behaviour with keyboard toggle buttons and will continue to work when tapping on terminal view for opening and back button for closing, until Termux app is switched to another app. After returning back, keyboard will be disabled until toggle is pressed again.

This also may help for the Lineage OS bug where blank space is shown where soft keyboard should be if "Show soft keyboard" toggle in "Language and Input" is disabled. Check KeyboardUtils.shouldSoftKeyboardBeDisabled() and https://github.com/termux/termux-app/issues/1995#issuecomment-837080079 for details.

The `TermuxPreferenceConstants` class has been updated to `v0.10.0`. Check its Changelog sections for info on changes.
2021-05-12 23:04:58 +05:00
agnostic-apollo
e6dac93352 Preserve the termux.properties literal string values internally that were being converted to boolean on load time
The `TermuxPropertyConstants` class has been updated to `v0.8.0`. Check its Changelog sections for info on changes.
2021-05-10 07:10:38 +05:00
agnostic-apollo
e4e638bd31 Allow users to enable/disable keyboard instead of just show/hide with keyboard toggle buttons
This `soft-keyboard-toggle-behaviour` key can be used to change the behaviour. The default behaviour is `show/hide`. The user can set the value to `enable/disable` in `termux.properties` file to change default behaviour of keyboard toggle buttons to enable/disable. In this mode, tapping the keyboard toggle button will disable (and hide) the keyboard and tapping on the terminal view will not open the keybaord automatically, until the keyboard toggle button is pressed again manually. This applies to split screen and floating keyboard as well. The keyboard can also be enabled from Settings -> Keyboard I/O -> Soft Keyboard toggle. Running `termux-reload-settings` command will also update the behaviour instantaneously if changed.

Fixed issue where "hide-soft-keyboard-on-startup" property wouldn't work if Termux app was switched back from another app. Fixes #1098

Fixed issue where soft keyboard may not show on startup on some devices but it still may fail sometimes.

The `TermuxPropertyConstants` class has been updated to `v0.7.0`. Check its Changelog sections for info on changes.
2021-05-10 06:03:29 +05:00
agnostic-apollo
fe8c3ba216 Update KeyboardUtils will null checks and add setSoftKeyboardVisibility() 2021-05-10 05:21:54 +05:00
agnostic-apollo
4ecea144bb Create KeyboardUtils 2021-05-09 21:08:54 +05:00
agnostic-apollo
116b9b42d8 Bump compileSdkVersion (NOT targetSdkVersion) to 30 2021-05-09 21:07:23 +05:00
agnostic-apollo
39c69db820 Fix issues where soft keyboard was not shown in some cases when hardware keyboard was attached v2
This is an update to 4d1851e6 commit.

The toggle logic change previously was actually being applied to ctrl+alt+k hardware keyboard shortcut instead of the mentioned extra keys "KEYBOARD" toggle. However, now it applies to the extra keys "KEYBOARD" toggle button as well, in addition to  drawer "KEYBOARD" toggle button and ctrl+alt+k hardware keyboard shortcut. They will all behave the same now.

Updated onSingleTapUp() to also forcefully show keyboard.

Fixed issue where "hide-soft-keyboard-on-startup" property wasn't respected anymore due to forced keyboard showing done in 4d1851e6.

Removed "stateAlwaysVisible" flag from AndroidManifest since its ignored in Android 10 by default and not needed due to usage of InputMethodManager.showSoftInput(). https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_ALWAYS_VISIBLE

Moved "adjustResize" from AndroidManifest into java code (which is also deprecated in API 30) to centralize keyboard logic.
2021-05-09 07:28:12 +05:00
agnostic-apollo
4d1851e6be Fix issues where soft keyboard was not shown in some cases when hardware keyboard was attached
For Termux app to be able to show a soft keyboard while a hardware keyboard is attached requires either of 2 cases:

1. User has enabled "Show on-screen keyboard while hardware keyboard is attached" toggle in Android "Language and Input" settings.
2. The toggle is disabled, but the soft keyboard app overrides the default implementation of `InputMethodService.onEvaluateInputViewShown()` and returns `true`. Some keyboard apps have a setting for this, like HackerKeyboard, but its not supported by all keyboard apps.

https://cs.android.com/android/platform/superproject/+/android-11.0.0_r3:frameworks/base/core/java/android/inputmethodservice/InputMethodService.java;l=1751

Termux previously didn't forcefully show a keyboard when the drawer "KEYBOARD" toggle button was pressed and only did that for the "KEYBOARD" extra keys toggle button. This prevented the keyboard to be shown for case 2 even when the user attempted to show the keyboard with the drawer "KEYBOARD" toggle. Now both buttons will forcefully show the keyboard.

Moreover, previously at app startup for case 2, the keyboard wasn't being shown. Now it will automatically be shown without requiring a manual press of a "KEYBOARD" toggle button.

This may also solve the issue where the soft keyboard wouldn't show even when the toggle of case 1 was enabled.
2021-05-08 04:16:51 +05:00
agnostic-apollo
596aa56b38 Update report issue message to ask users to provide details on what they were doing that caused the Termux app crash 2021-05-08 03:24:09 +05:00
agnostic-apollo
4850678d55 Move Build.ID and Build.DISPLAY to Software section of device info markdown 2021-05-08 03:14:20 +05:00
agnostic-apollo
bc52a4e90c Update README.md 2021-05-03 16:28:02 +05:00
agnostic-apollo
3e7b3604a4 Update LICENSE.md 2021-05-03 16:08:04 +05:00
agnostic-apollo
f3f58c8fc7 Update README.md 2021-05-03 16:07:18 +05:00
agnostic-apollo
4711094614 Bump ndk to v22.1.7171670
Will also remove requirement for F-Droid metadata/com.termux.yml ndk version patch

1fe5c6b905 (54c3cc576ac595d35a41ce9e4a69e1c905fd6ea4)
2021-05-03 00:40:03 +05:00
agnostic-apollo
42ad3723fd Fix NullPointerExceptions for cases when TermuxActivity tries to access TermuxService when it doesn't hold a reference
Fixes #2026
2021-05-03 00:39:42 +05:00
agnostic-apollo
b268b6edf7 Disable error flashes when clearing TMPDIR directory on termux app exit
Rooted users were getting `Clearing $TMPDIR directory at path "/data/data/com.termux/files/usr/tmp" failed` flash errors when they exited Termux if directories existed in TMPDIR that only had `root` user ownership, since they would fail to get cleared since clearing was being run as the termux app user instead of as the root user. Now errors will only be logged to logcat.
2021-05-01 23:31:02 +05:00
agnostic-apollo
b84854af92 Update README.md 2021-05-01 19:35:52 +05:00
agnostic-apollo
cfebb3358d Update README 2021-04-27 15:50:57 +05:00
agnostic-apollo
93e1b13278 Update README 2021-04-26 12:43:55 +05:00
Fredrik Fornwall
0d4bfb7bd5 Replace jcenter() with mavenCentral()
This is since JCenter is being shut down.
2021-04-26 01:11:35 +02:00
agnostic-apollo
0aa5a123b7 Bump to v0.112
This only reverts the versioning login change done in a6ae656c since that caused F-Droid bot and Github Packages to fail to pick up new releases. The versions must be bumped directly in `build.gradle` file in future and not through other files like `gradle.properties`.
2021-04-22 19:57:08 +05:00
agnostic-apollo
2e156d4621 Update LICENSE 2021-04-21 17:01:52 +05:00
agnostic-apollo
fdcf6cb6e1 Update LICENSE 2021-04-21 17:00:38 +05:00
agnostic-apollo
01f2ed0892 Update LICENSE 2021-04-21 16:51:20 +05:00
agnostic-apollo
c9abfe5438 Update README 2021-04-21 16:51:08 +05:00
agnostic-apollo
8f9771adce Bump to v0.111 2021-04-21 14:07:25 +05:00
agnostic-apollo
b34f60b1b0 Fix the bootstrap reinstallation logic for when PREFIX is a symlink
Changes were made to bootstrap reinstallation logic in 107927f5, but it wasn't considering that PREFIX may be a symlink file to a directory instead of a directory file. With this commit, the previous behaviour of termux is restored where PREFIX can optionally be a symlink to a valid directory where the symlink isn't broken/dangling.
2021-04-21 14:06:57 +05:00
agnostic-apollo
0fe608f91e Revert "Bump to v0.111"
This reverts commit 5d911ef93f.
2021-04-21 13:55:25 +05:00
agnostic-apollo
5d911ef93f Bump to v0.111 2021-04-21 07:01:59 +05:00
agnostic-apollo
1d06ff9bf0 Bump gradle to v7.0 2021-04-20 13:05:15 +05:00
agnostic-apollo
107927f5a1 Fix cases where bootstrap was not reinstalled even if PREFIX was broken
The TermuxInstaller.setupBootstrapIfNeeded() previously only checked if PREFIX directory existed or not to decide whether to install bootstrap or not. Now it will also check if its empty or only contains the tmp directory, since in that case the PREFIX must be deleted and bootstrap reinstalled, otherwise a broken environment will be loaded since no termux binaries/libs would exist.

It will now also delete any file at the prefix or staging prefix path, even if its not a directory. If the user does not want the bootstrap to be installed for some reason, then any other file other than "tmp" can be created under PREFIX.
2021-04-20 12:49:43 +05:00
agnostic-apollo
d6eb5e3511 Fix termux-reset
The TMPDIR was being automatically cleared and recreated even if it didn't already exist when TermuxService was stopped. This left an empty TMPDIR in the PREFIX directory when termux-reset was run and on termux restart the bootstrap wasn't installed again because PREFIX directory already existed. This resulted in a broken environment since no binaries/libs existed under PREFIX and /system/bin/sh was loaded.

This issue was created due to v0.109.
2021-04-20 12:39:54 +05:00
agnostic-apollo
a6ae656c9f Bump to v0.110 2021-04-15 05:14:31 +05:00