Commit Graph

1425 Commits

Author SHA1 Message Date
Yaksh Bariya 124646f2d8
tmp: use latest commit of upload-release-action 2023-02-16 17:24:49 +05:30
Yaksh Bariya 1eb0912e22
ci: print error for assembleDebug again 2023-02-08 19:39:24 +05:30
Yaksh Bariya 85b84b93a5
ci(attach_debug_apks_to_release): delete release on failure to
build/upload
2023-02-08 19:34:11 +05:30
Yaksh Bariya 2ac7fd1e56
ci: use termux/upload-release-actions to attach debug builds to new releases 2023-02-08 19:15:51 +05:30
Young-Lord c6dce12510 Fix GitHub spelling 2023-01-23 11:13:48 +02:00
Lucy Phipps 2f5a6f7de6
WcWidth.c: fix 2nd typo 2022-12-16 07:01:40 +00:00
Lucy Phipps 82f83a2970
WcWidth.c: fix typo 2022-12-16 06:58:37 +00:00
Lucy Phipps b1c043d540
update WcWidth.java to Unicode 15.0.0 2022-12-16 06:56:27 +00:00
Lucy Phipps cff6cff609
Create dependabot.yml 2022-11-07 01:16:28 +00:00
Frieder Bluemle 29cf9820e1 Fix GitHub spelling 2022-10-27 11:37:17 +03:00
Yaksh Bariya c8a74dc588
feat(KeyHandler): respect modifiers with PgUp and PgDn 2022-10-24 07:58:37 +05:30
daywalk3r666 20dee0e940 Update actions/upload-artifact to v3 2022-10-14 10:02:36 +03:00
Sushrut1101 3516f1979f Update actions/checkout to v3 2022-10-13 10:56:35 +03:00
EduardDurech 5bc3d2db8d Added: Add `KEY_LAST_PENDING_INTENT_REQUEST_CODE` to `TermuxAPIAppSharedPreferences` 2022-10-13 08:48:31 +05:00
agnostic-apollo 3f7a939313 Added: Add support for `Share selected text` of terminal in long hold `MORE` menu so that users don't have to copy and paste to move text between apps 2022-10-04 04:47:58 +05:00
agnostic-apollo 0c14c291b2 Changed: Use `ShareUtils` to copy and paste text and prevent potential `NPE`
The `copyTextToClipboard()` method has been updated to pass clip label when copying text to clipboard and `getTextFromClipboard()` and `getTextStringFromClipboardIfSet()` methods have been added to get current clipboard.
2022-10-04 04:29:15 +05:00
agnostic-apollo 63d035ce39
Changed: Update phantom process links 2022-10-03 15:37:26 +05:00
agnostic-apollo 8c1749ef96 Added|Changed: Add `AppSharedPreferences` to hold `SharedPreferences` of apps and inherit termux app prefrences from it 2022-09-29 02:45:31 +05:00
Leonid Pliushch 6c56073958
readme: add notes about test keystore 2022-09-21 20:01:13 +03:00
Leonid Pliushch 061dc776bd
rename dev_keystore.jks to testkey_untrusted.jks
Hopefully the new name of keystore file would provide to potential user
more info about what it actually is.
2022-09-21 10:30:24 +03:00
agnostic-apollo 211340781b Added: Add multi language i18n support for docs per termux/termux.github.io@f234d089e 2022-07-17 08:48:03 +05:00
agnostic-apollo 605dd6c192 Added: Add check for if Termux has been granted Display Over Apps Permission if starting activities and services with termux-am-socket on Android 10+ 2022-07-06 02:53:36 +05:00
agnostic-apollo 4646aca597 Added: Start termux app docs support at https://termux.dev/docs/apps/termux as per termux/termux.github.io@612fa084 and termux/termux.github.io@f9c8d848 2022-06-21 04:11:23 +05:00
agnostic-apollo f1d411a5ab Fixed: Fix shared terminal transcript joining back lines
Regression of 370ac2bd caused in 5f71e3e7 by the (in)famous @trygveaa
2022-06-19 03:08:28 +05:00
agnostic-apollo 5fc2b4cd4a Added: Add `SCROLL` extra key to toggle auto scrolling of terminal to bottom on terminal text updates and termux activity return
The toggle will apply to each terminal session separately.

Closes #2535
2022-06-18 22:45:48 +05:00
agnostic-apollo a2df7d791a Fixed: Fix bootstrap not installing on app install
Previously, bootstrap was only installed if `$PREFIX` didn't exist, was empty or only had `$PREFIX/tmp`. But now with 03e1d14e, `$PREFIX/etc/termux/termux.env` was also created at app startup before bootstrap check was made, hence it was being assumed that bootstrap was already installed.

Now, bootstrap will be installed even if `$PREFIX/tmp`, `$PREFIX/etc/termux/termux.env.tmp` or `$PREFIX/etc/termux/termux.env` exist but no other files do.

Closes #2844
2022-06-18 05:53:26 +05:00
agnostic-apollo 82b1580312 Fixed: Fix `termux.properties` reload not working if the properties file didn't exist at app startup
Closes #2836
2022-06-15 18:31:29 +05:00
agnostic-apollo e92a6db06b Fixed: Ensure CSI parameter value is not greater than `9999` as per vt510 2022-06-15 05:05:04 +05:00
agnostic-apollo 4c47f4f732 Fixed: Fix CSI parameters parsing like for SGR sequences that start with a `;` or have sequential `;` characters
https://vt100.net/docs/vt510-rm/chapter4.html#S4.3.3

https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences

Credits for finding the issue belongs to @Screwtapello

https://github.com/mawww/kakoune/issues/4339#issuecomment-916980723

Closes #2272, Closes mawww/kakoune#4339
2022-06-15 05:05:04 +05:00
agnostic-apollo 26ff978b0f Changed: Use black or white cursor color based on terminal background instead of always white if colors.properties didn't have cursor color set
Credit for algorithm link belong to @Jamie-Landeg-Jones

Closes #2653
2022-06-14 19:13:19 +05:00
agnostic-apollo b80126fd61 Fixed: Catch exceptions if failed to bypass hidden API restrictions
Attempting to bypass restrictions while tests are running will fail due to call to `TermuxApplication.onCreate()` -> `TermuxShellEnvironment.init()` -> `SELinuxUtils.getContext()`
2022-06-14 04:08:03 +05:00
agnostic-apollo 162469f7ce Fixed: Fix message dialog button text not showing in day mode due to white text 2022-06-14 04:05:00 +05:00
agnostic-apollo e75680a884 Changed: Do not re-set component state if current state equals new state in `PackageUtils.setComponentState()` 2022-06-14 04:04:09 +05:00
agnostic-apollo af6ac30bb1 Added: Allow users to disable termux file view and share receivers
The user can add `disable-file-share-receiver=true` entry to `termux.properties` file to disable termux from showing in Android file `Share With` apps list.
The user can add `disable-file-view-receiver=true` entry to `termux.properties` file to disable termux from showing in Android file `Open With` apps list.

The default value is `false`. Restarting termux app or running `termux-reload-settings` command will update the behaviour instantaneously if changed.

Closes #2549
2022-06-14 04:03:29 +05:00
agnostic-apollo 79d799a99d Fixed: Fix `ExecutionCommand.pid` not being set for first and background terminal sessions since `TermuxTerminalSessionClientBase` was still being used instead of `TermuxTerminalSessionActivityClient`
This commit adds onto 841c41bf and implements the `setTerminalShellPid()` interface method in `TermuxTerminalSessionServiceClient` so that `pid` is set properly for all cases.
2022-06-13 16:11:13 +05:00
agnostic-apollo 841c41bf37 Added|Changed: Added `TermuxTerminalSessionServiceClient` and renamed `TermuxTerminalSessionClient` to `TermuxTerminalSessionActivityClient`
Addition of `TermuxTerminalSessionServiceClient` is required so that interface methods that `TermuxService` can handle without `TermuxActivity` should implemented instead of relying on base implementation of `TermuxTerminalSessionClientBase`.
2022-06-13 16:07:04 +05:00
agnostic-apollo c2ddc23ae5 Added: Add `MAX_PHANTOM_PROCESSES` and `DEVICE_CONFIG_SYNC_DISABLED` value to device info output like shown in Termux About page
Related commit b6963035
2022-06-12 02:50:38 +05:00
agnostic-apollo b69630355a Added: Add `PhantomProcessUtils` to get phantom processes related settings values
- `settings_enable_monitor_phantom_procs` feature flag value can be received with a call to `getFeatureFlagMonitorPhantomProcsValueString()`. Likely only available on Android `12L+`.

- `max_phantom_processes` value from `dumpsys activity settings` output can be received with a call to `getActivityManagerMaxPhantomProcesses()`. Requires granting Termux `DUMP` and `PACKAGE_USAGE_STATS` permission. Can be granted with `adb shell "pm grant com.termux android.permission.PACKAGE_USAGE_STATS; pm grant com.termux android.permission.DUMP"` and revoked with `adb shell "pm revoke com.termux android.permission.PACKAGE_USAGE_STATS; pm revoke com.termux android.permission.DUMP"`.

- `device_config_sync_disabled` settings global namespace value can be received with a call to `getSettingsGlobalDeviceConfigSyncDisabled()`.
2022-06-12 02:48:36 +05:00
agnostic-apollo 42eee49d30 Added: Add `SettingsProviderUtils` to get `Setting` global, secure and system namespace values 2022-06-12 02:35:46 +05:00
agnostic-apollo 03e1d14e1e Added: Write termux shell environment to `/data/data/com.termux/files/usr/etc/termux/termux.env` on app startup and package changes
The `termux.env` can be sourced by shells to set termux environment normally exported. This can be useful for users starting termux shells with `adb` `run-as` or `root`. The file will not contain `SHELL_CMD__` variables since those are shell command specific.

The items in the `termux.env` file have the format `export name="value"`.
The `"`\$` characters will be escaped with `a backslash `\`, like `\"` if characters are for literal value. Note that if `$` is escaped and if its part of variable, then variable expansion will not happen if `.env` file is sourced. The `\` at the end of a value line means line continuation. Value can contain newline characters.

The `termux.env` file should be sourceable by `POSIX` compliant shells like `bash`, `zsh`, `sh`, android's `mksh`, etc. Other shells with require manual parsing of the file to export variables.

Related discussion #2565
2022-06-12 00:51:19 +05:00
agnostic-apollo f76c20d036 Added: Init `TermuxShellEnvironment` at app startup
This will currently cache `TermuxAppShellEnvironment` so that its not regenerated for each shell started since it contains some slightly expensive operations.
2022-06-12 00:38:02 +05:00
agnostic-apollo 150b1ff99c Added: Add `ShellCommandShellEnvironment` and `TermuxShellCommandShellEnvironment` to export `ExecutionCommand` variables
This adds onto f102ea20 to build termux environment. Variables for `ExecutionCommand` app have the `SHELL_CMD__` scope. Docs will be provided for details of the variables.

- `SHELL_CMD__SHELL_ID`
- `SHELL_CMD__SHELL_NAME`
- `SHELL_CMD__APP_SHELL_NUMBER_SINCE_BOOT`
- `SHELL_CMD__TERMINAL_SESSION_NUMBER_SINCE_BOOT`
- `SHELL_CMD__APP_SHELL_NUMBER_SINCE_APP_START`
- `SHELL_CMD__TERMINAL_SESSION_NUMBER_SINCE_APP_START`

The commit also adds `SystemEventReceiver` to Termux app that will receive `ACTION_BOOT_COMPLETED`.
2022-06-12 00:38:02 +05:00
agnostic-apollo ebdab0e59c Changed: Update `TERMUX_APP__AM_SOCKET_SERVER_ENABLED` environment variable value if `termux-am-socket` server state changes 2022-06-12 00:33:08 +05:00
agnostic-apollo afc06cfd0a Added|Changed!: Add `TermuxAppShellEnvironment` and `TermuxAPIShellEnvironment` to export `Termux` and `Termux:API` app variables in `TermuxShellEnvironment`
This adds onto f102ea20 to build termux environment. Variables for `Termux` app have the `TERMUX_APP__` scope and variables for `Termux:API` app have `TERMUX_API_APP__` scope, which allows easier management for variables and know which variable belongs to which component. Some variables that were added in the last `termux-app` `v0.118.0` release have been renamed as per scoped variable design. The `TERMUX_VERSION` variable will stay as is for backward compatibility and will be duplicate of `TERMUX_APP__VERSION_NAME`. Docs will be provided for details of the variables.

- `TERMUX_APP__VERSION_NAME`
- `TERMUX_APP__VERSION_CODE`
- `TERMUX_APP__PACKAGE_NAME`
- `TERMUX_APP__PID` (previously `TERMUX_APP_PID`)
- `TERMUX_APP__UID`
- `TERMUX_APP__TARGET_SDK`
- `TERMUX_APP__IS_DEBUGGABLE_BUILD` (previously `TERMUX_IS_DEBUGGABLE_BUILD`)
- `TERMUX_APP__APK_RELEASE` (previously `TERMUX_APK_RELEASE`)
- `TERMUX_APP__APK_PATH`
- `TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE`
- `TERMUX_APP__SE_PROCESS_CONTEXT`
- `TERMUX_APP__SE_FILE_CONTEXT`
- `TERMUX_APP__SE_INFO`
- `TERMUX_APP__USER_ID`
- `TERMUX_APP__PROFILE_OWNER`
- `TERMUX_APP__PACKAGE_MANAGER` (previously `TERMUX_APP_PACKAGE_MANAGER`)
- `TERMUX_APP__PACKAGE_VARIANT` (previously `TERMUX_APP_PACKAGE_VARIANT`)
- `TERMUX_APP__FILES_DIR`
- `TERMUX_APP__AM_SOCKET_SERVER_ENABLED` (previously `TERMUX_APP_AM_SOCKET_SERVER_ENABLED`)

- `TERMUX_API_APP__VERSION_NAME` (previously `TERMUX_API_VERSION`)
2022-06-12 00:33:07 +05:00
agnostic-apollo 9749360caa Added: Add `UnixShellEnvironment.LOGIN_SHELL_BINARIES` variable for common/supported login shell binaries searched and add `fish` and `sh` shell as additional backups 2022-06-12 00:32:18 +05:00
agnostic-apollo 29d05cc72c Changed: All `ExecutionCommands` not managed by `TermuxShellManager` should have `id` `-1` 2022-06-12 00:32:18 +05:00
agnostic-apollo 2998558e9f Added: Add support in `AppShell` and `TermuxSession` for caller to add/override additional environment variables not added by `IShellEnvironment.setupShellCommandEnvironment()` 2022-06-12 00:32:18 +05:00
agnostic-apollo 13d93ccac7 Added: Add `TermuxShellManager` to manage all termux app wide shells 2022-06-12 00:32:18 +05:00
agnostic-apollo f102ea20b2 Added|Changed!: Implement new design for shell environment generation and add support for `MIT` licensed shell environment client
- `ShellEnvironmentClient` has been renamed to `IShellEnvironment` with certain changes to its interface methods, including requirement for `Execution` command itself for `setupShellCommandEnvironment()`.
- `UnixShellEnvironment` implements the `IShellEnvironment` interface as is the abstract base class of all other shell environments.
- `AndroidShellEnvironment` extends from the `UnixShellEnvironment` class and provides an environment that would work for Android shells. This is `MIT` licensed and can be used by users importing the `termux-shared` library or the library itself to run `AppShell` shells. Previously, `TermuxShellEnvironmentClient` existed which was `GPLv3` licensed and it would not have been possible to use it for non-GPL code.
- `TermuxShellEnvironment` extends from the `AndroidShellEnvironment` class and adds/overrides additional environment variables required for Termux shells to work, including setting `HOME`, `TMPDIR`, `PATH` and `LD_LIBRARY_PATH` appropriately. Termux app related variables will be added in a later commit. `TermuxShellEnvironment` replaces `TermuxShellEnvironmentClient` and is `GPLv3` licensed.
2022-06-12 00:32:18 +05:00
agnostic-apollo 0328d15ea7 Fixed: Fix duplicate logging of `file` word in `FileUtils.copyOrMoveFile()` 2022-06-11 14:24:26 +05:00