Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Termux Various Fixes And Improvements #1953

Conversation

agnostic-apollo
Copy link
Member

Some minor fixes to TermuxActivity and RunCommandService. Need to add/fix some other stuff, but will do it together when I do some (major) refactoring, have yet to see whether committing to master or android-10 will be more wiser, depending on differences in existing files.

@agnostic-apollo
Copy link
Member Author

agnostic-apollo commented Feb 26, 2021

Would be better if someone tested before we merge, since changes to activity stuff, don't wanna repeat 0.105 crash scenarios. Working fine on android 7 device and android 11 avd though. The RUN_COMMAND intent is working fine too, including log errors for denials.

This commit adds `logcat` errors if an invalid intent action is passed or if `allow-external-apps` is not set to `true` while sending an intent to `RunCommandService`, so that users can detect issues.
This commit fixes `getExpandedTermuxPath()` (previously `parsePath()`) not expanding path if exactly `$PREFIX` is passed and addition of extra trailing slashes in some cases.
This commit fixes the workdir logic to not send `EXTRA_CURRENT_WORKING_DIRECTORY` extra to `TermuxService` if workdir is empty, since that will raise `No such file or directory` exceptions if `cwd` is empty when targeting sdk `29`.
This commit fixes the issue when `cwd` is empty and is passed to `Runtime.getRuntime().exec(progArray, env, new File(cwd));`, it raises the `No such file or directory` exceptions when targeting sdk `29`.
This commit fixes the non-crashing exception `Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;` on termux startup due to `setContentView()` call by `TermuxActivity.onCreate()`. The recommended solution seems to be to add `androidx.core:core` dependency, which has solved the issue.

https://issuetracker.google.com/issues/117685087
@agnostic-apollo agnostic-apollo force-pushed the termux-various-fixes-and-improvements branch from b6fc824 to 9fd2cf9 Compare February 27, 2021 08:43
@agnostic-apollo
Copy link
Member Author

agnostic-apollo commented Feb 27, 2021

Fixed the commit messages, doing them in haste wasn't wise. The Fix current working directory default value commit would mainly apply for android-10 branch, but doing it here as well in case it occurs in other scenarios too and so that its not forgotten if android-10 branch is merged later. Check number 12 in termux/termux-tasker#36 pull request for details.

@RalfWerner
Copy link

if android-10 branch is merged later

I used the branch for my check and also started rebase to v108 (1-2 tloc) but then canceled. The branch is suitable to check 29+ but the concept aims to replace apt with apk, while my pkg/apt boot-loop idea/artifact keeps apt. But then many functions from the branch are superfluous and some important ones have been removed.

When do you plan the merge and could you consider my boot-loop extension?

This will allow users to run `dumpsys` command after running `adb shell pm grant com.termux android.permission.DUMP`.

https://developer.android.com/studio/command-line/dumpsys
@RalfWerner
Copy link

For your addendum I had this on Pixel*.avd (as expected) and Galaxy*.avd (strange) checked. Patching with Studio usually leads to irritating effects (better remove before)

@agnostic-apollo
Copy link
Member Author

@RalfWerner

When do you plan the merge and could you consider my boot-loop extension?

This pull request is not meant to merge android-10 branch with master. This is only for commits to current master branch that's targeting sdk 28. I'll merge termux-various-fixes-and-improvements branch with master after pushing a few more commits.

For your addendum

If you are talking about hasFragileUserData, then as mentioned, it can't be added to current master branch since its targeting sdk 28, so users can't benefit from it currently, they can use it when android-10 branch is merged later. xeffyr has already added hasFragileUserData in android-10 branch, with this commit.

@RalfWerner
Copy link

Thanks for the answer! I understand the content of this PR :) I didn't intend to create my own PR and therefore used this to ask about my 3 loc and tell you about my experience with/without hasFragileUserData on my *.avd (you use words: seems/not sure).
If you're interested, I can go into more detail. You didn't answer my "When" question!

This will allow users to access `Android/obb` on android 11 after explicitly granting Termux the permission by going to Termux `App Info` in Android `Settings` -> `Advance` -> `Install unknown apps`.

https://medium.com/androiddevelopers/android-11-storage-faq-78cefea52b7c
- Decouple the `CursorController`, `TextSelectionCursorController`(previously `SelectionModifierCursorController`) and `TextSelectionHandleView` (previously `HandleView`) from `TerminalView` by moving them to their own class files.
- Fixes termux#1501 which caused the `java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.` exception to be thrown when long pressing the down key while simultaneously long pressing the terminal view for text selection.
…x app and its plugins

This commit removes almost all hardcoded paths in Termux app and moves the references to the `TermuxConstants` class.

The `TermuxConstants` class should be imported by other termux plugin apps instead of copying and defining their own constants. The 3rd party apps can also import it for interacting with termux apps. App and sub class specific constants are defined in their own nested classes to keep them segregated from each other and for better readability.
The termux properties handling was mixed in with termux preferences. They are now moved out of into a separate sub package, the following classes are added:

- `SharedProperties` class which is an implementation similar to android's `SharedPreferences` interface for reading from ".properties" files which also maintains an in-memory cache for the key/value pairs. Two types of in-memory cache maps are maintained, one for the literal `String` values found in the file for the keys and an additional one that stores (near) primitive `Object` values for internal use by the caller. Write support is currently not implemented, but may be added if we provide users a GUI to modify the properties. We cannot just overwrite the ".properties" files, since comments also exits, so in-place editing would be required.
- `SharedPropertiesParser` interface that the caller of `SharedProperties` must implement. It is currently only used to map `String` values to internal `Object` values.
- `TermuxPropertyConstants` class that defines shared constants of the properties used by Termux app and its plugins. This class should be imported by other termux plugin apps instead of copying and defining their own constants.
- `TermuxSharedProperties` class that acts as manager for handling termux properties. It implements the `SharedPropertiesParser` interface and acts as the wrapper for the `SharedProperties` class.
The `TermuxConstants` and `TermuxPropertyConstants` classes have both been updated to `v0.2.0`. Check their Changelog sections for info on changes.
Some other hardcoded termux paths have been removed as well and are now referenced from `TermuxConstants` class.
…andService

The `RunCommandService` will now call the `TermuxSharedProperties` for getting current value of `allow-external-apps`, instead of using its own duplicated function to read "termux.properties" files.
`TerminalView` will use the `TerminalViewClient` interface implemented by `TermuxViewClient` in termux-app to get "enforce-char-based-input" and "ctrl-space-workaround" property values. It will also not read the file every time it needs to get the property value and will get it from the in-memory cache of `TermuxSharedProperties`.
Also moves `TermuxViewClient` into com.termux.app.terminal package
The `TermuxConstants` classes has been updated to `v0.3.0`. Check its Changelog sections for info on changes.
The termux preferences handling was mixed in with termux properties before an earlier commit. They are now moved out of into a separate sub package, the following classes are added:

- `TermuxPreferenceConstants` class that defines shared constants of the preferences used by Termux app and its plugins. This class should be imported by other termux plugin apps instead of copying and defining their own constants.
- `TermuxSharedPreferences` class that acts as manager for handling termux preferences.
@RalfWerner
Copy link

RalfWerner commented Apr 12, 2021

Please answer the question that was asked.

After searching for your Termux (App) settings in vain on all my devices and emulators (Android), I found the following setting with long tab -> More ... in termux! Thus (7 taps), OS-KB can be completely de/re-activated. Shots:
grafik
The last shot (5) is from my Android 8 device with your 108a.apk, split mode, X11 (top) and Termux (middle).
Unfortunately, it looks good but the KB (below) works in Termux not! What did I do:

  • Termux started and disabled as in Shot1-4. Then OS-KB never opened, even not with the Keyboard Extra Key *).
  • with X11 extra key toggent, split enabled, Termux activated (below) and displayed with back key (X11) OS KB.
  • The KB can only be used in X11 except when the seven tabs steps of Shot1-4 are repeated. But it appears than again at all inappropriate occasions and seven tabs for a simple y(es) or n(o) is too much.

*) If this would work despite of disabled, that would be the perfect solution!

@agnostic-apollo
Copy link
Member Author

All issues for this pull request have been resolved. If someone wants to do some basic testing, they can do so. Everything is fine on my own end.

  • Email reporting support for termuxreports@groups.io has been added thanks to @Grimler91 which will forwarded to grimler, xeffyr and me.
  • hasFragileUserData will not be added for now.
  • Changelog has been updated with latest changes.
  • All versions have been bumped to v0.109.

@xeffyr you can build the updated bootstrap and release at your own convenience. Thanks

@agnostic-apollo
Copy link
Member Author

seven tabs for a simple y(es) or n(o) is too much.

I already gave solutions and asked you if you wanted that, but I don't where were you at. Anyways. too late now, will be looked into in future.

Are you saying that you want the KEYBOARD extra key button to disable the keyboard instead of just toggle it? That will require adding another key to change default behaviour since not everybody would want to disable it. Can be looked into later, other higher priority stuff now.

Are you asking about whether KEYBOARD button should disable the keyboard instead of just toggling?

And Termux:Float is a completely different app from Termux, its issues can't be solved here, post them at

https://github.com/termux/termux-float/issues

@RalfWerner
Copy link

Everything is fine on my own end ... I already gave solutions and asked you if you wanted that ...

Thanks for 109.apk! It is 6358b larger than 108a. Basic checks were successful. You make an excellent work!
"Fine" - yes, "Perfect" - no. That's how something is to do and that's again "good!"

I had read, understood and answered your KEYBOARD solution suggestions. I am very satisfied with the KEYBOARD Extra Key toggling, if it would always work and Termux:float I've never used, since Android 11 (10) does not need it anymore.

What disturbs me is the unmotivated and unwanted show/raise of the OS KB. The seven-tabs-solution is a workaround or I accept, that hide OS-KB is the most common of all finger actions. Especially with PiP and Split.
Are you not suffering from it?

@agnostic-apollo agnostic-apollo merged commit b33b906 into termux:master Apr 12, 2021
@agnostic-apollo
Copy link
Member Author

Thanks for 109.apk! It is 6358b larger than 108a.

Welcome. It is larger because lot of code has been added and because obfuscation has been disabled to preserve full stacktraces for crash reports.

The seven-tabs-solution is a workaround or I accept, that hide OS-KB is the most common of all finger actions. Especially with PiP and Split.

I will try to add a termux.properties property to change behaviour of KEYBOARD to disable instead of toggle in future.

Are you not suffering from it?

Yeah, I'm suff.. No, I don't use hardware keyboard, PiP or Split screen.

@agnostic-apollo
Copy link
Member Author

agnostic-apollo commented Apr 12, 2021

Changelog

0.109 - 2021-04-13

Added

  • Added SettingsActivity (Termux Settings) which can be accessed by Long pressing terminal view -> More -> Settings. This will allow GUI based management of settings in future, like keyboard key mapping, etc. Currently supports controlling log level, plugin errors and softkeyboard state. (d39972b)

  • Add SettingsActivity to launcher shortcuts. (2b3f681, 325a6f7)

  • Added ReportActivity and ReportInfo to be used as base for showing reports to users. Currently supports plugin errors, app crashes and issue reports. (9d36e9a)

  • Added centralized Logging framework to the entire app and terminal-view and terminal-emulator libraries which has 4 levels, Off, Normal (default), Debug, Verbose which can be used by users via logcat to debug problems. Users can set the log level from Termux Settings -> Debugging -> Log Level. Terminal view key logging can now also be enabled with the Terminal View Key Logging toggle without having to recompile the app. Support for writing to files in addition to writing to logcat will/can be added in future. (d39972b)

  • Added logging for termux bootstrap package installation and setup of storage symlinks. (92b804d).

  • Requested android.permission.DUMP permission so that users can use dumsys commands without root after running adb shell pm grant com.termux android.permission.DUMP. (356a442)

  • Requested android.permission.REQUEST_INSTALL_PACKAGES permission to allow users to access Android/obb on android 11 after explicitly granting Termux the permission by going to Termux App Info in Android Settings -> Advance -> Install unknown apps. (93a5bf8)

  • Added support to warn users if Draw over other apps permission is missing when attempting to start Termux foreground session from the background with plugin commands, like for RUN_COMMAND intent. Check android background restrictions for more info. Now, the Termux foreground session will not even be attempted to be started if permission is missing since it would fail randomly otherwise and users would report bugs for it. (d3ddb21)

  • Added hide-soft-keyboard-on-startup termux.properties property which when set to true will automatically hide the soft keyboard on Termux startup to solve issues for when users use hardware keyboard and soft keyboard wastes screen space. Fixes Close virtual keyboard by terminal-setting #1978. (1ef8eb9)

  • Added support for disabling soft keyboard completely for when users use hardware keyboard. Users can toggle the state from Termux Settings -> Keyboard I/O -> Soft Keyboard toggle. (2a8d5e2)

  • Added support for adjusting termux toolbar height with terminal-toolbar-height termux.properties property. The user can set a float value between 0.4 and 3.0 which will be used as the scaling factor for the default height. The default scaling factor is 1. So adding an entry like terminal-toolbar-height=2.0 to termux.properties file will make the toolbar height twice its original height. Fixes Feature request: adjust height of extra commands  #1857. (ff0440d)

  • Added executable and working directory validation for RUN_COMMAND intent. The working directory will also also be created if its under TermuxConstants.TERMUX_FILES_DIR_PATH. (b4995ef)

  • Added support for session actions for foreground session commands received via RUN_COMMAND intent or termux-tasker. (ec7568d)

  • Added support for sending back background and foreground command results for RUN_COMMAND intent and foreground command results for Termux:Tasker. Check RUN_COMMAND Intent Wiki for more info. (a2209dd)

  • Added support to notify users of errors via flashes and notifications for plugin commands, like for allow-external-apps not set to true when RUN_COMMAND intent is received. Clicking the notification will open the ReportActivity to show the report. The flashes and notifications can be controlled with the Termux Settings -> Debugging -> Plugin Error Notifications toggle. (8612a1d, 31371b5)

  • Added support for stdin for background RUN_COMMAND intent, TERMUX_SERVICE.ACTION_SERVICE_EXECUTE and Termux:Tasker (will require update) commands. This will allow users to pass (bash, python, etc) scripts or other data via stdin to the executable. Arguments would still be passed to the executable and not the script. (192b208, f1034c2)

  • Added crash reporting so that whenever the Termux app crashes, the crash report (stacktrace, app and device info) will be logged to ~/crash_log.md file in markdown format. When the user will reopen the app, a notification will be shown which when clicked will show the crash report content in ReportActivity. The activity will have important links like email (termuxreports@groups.io), reddit, github issues of termux app and packages at which the user can optionally report an issue if necessary after copying the crash report text. The ~/crash_log.md file will be moved to ~/crash_log-backup.md so that a notification is not shown again on next startup and can be viewed again via SAF, etc. The notifications can be controlled with the Termux Settings -> Debugging -> Crash Report Notifications toggle. (69e4b57, cf5bb69)

  • Added support to allow users to report an issue based on terminal transcript with Long pressing terminal view -> More -> Report Issue. Selecting the option will open the ReportActivity with the terminal transcript, app device and APT info with important links like email (termuxreports@groups.io), reddit, github issues of termux app and packages at which the user can optionally report an issue after copying the report text. The report text will be in markdown format so that it is more readable and will take a few seconds to generate. (939338a, df4d8ac, 6293f5f)

  • Added termux-shared library. This defines shared constants and utils of Termux app and its plugins. This allows for removal of all hardcoded paths in Termux app. The termux plugins should use this in future as well. (682ce08)

  • Added TermuxConstants class to store all shared constants of Termux app and its plugins. This also has info on what changes need to be made if forking Termux app and changing its package name. (14c4986, 0225a8b)

  • Added TermuxPropertyConstants class that defines shared constants of SharedProperties used by Termux app and its plugins. Also added TermuxSharedProperties class that acts as manager for handling termux properties. (7b4acb5)

  • Added TermuxPreferenceConstants class that defines shared constants of the SharedPreferences used by Termux app and its plugins. Also added TermuxSharedPreferences class that acts as manager for handling termux preferences. (93b506a, 9e82561)

  • Added SharedProperties class which is an implementation similar to android's SharedPreferences interface for reading from .properties files which also maintains an in-memory cache for the key/value pairs. Write support is currently not there since .properties files also have comments and escapes, so in-place editing would be required to update values. For this apron library could be looked into. (7b4acb5)

  • Added ExecutionCommand to stores all data related to an execution command. This allows easier management and passing of execution command data between classes and management of it, like post processing and failure management. (bccc35b, 31371b5, 1b5e5b5)

  • Added ShellUtils to provide utilities for shell related stuff, since they don't belong in BackgroundJob which has been removed. (dff2794, 249f7c6, 8598b92)

  • Added the TermuxSession class for linking a TerminalSession to an ExecutionCommand and to maintain info for foreground Termux sessions. (78a99fd, 0cd7cb8)

  • Added the TermuxTask class for linking a Process to an ExecutionCommand and to maintain info for background Termux tasks. It also supports synchronous command execution as well to run shell commands and scripts from anywhere for internal use by termux app and its plugins. (f62febb, 0cd7cb8)

  • Added StreamGobbler class which has been imported from libsuperuser and partially modified to read stdout and stderr of background commands. (f62febb)

  • Added interface methods to TerminalViewClient in terminal-view library so that it becomes agnostic of termux.properties files. (10d6eaa)

  • Added MarkdownUtitls to provide utilities for markdown support in the app, like for error and crash reports. It uses the commonmark-spec via the markwon library. (131f481)

  • Added ShareUtils to provide utilities for sharing data from termux apps. It will also try to prevent android.os.TransactionTooLargeException exceptions when sharing large data. (c28990a)

  • Added TermuxUtils to provide utilities for termux app specific operations, like getting termux app info, device info, report info, Context object of each termux plugin app, etc. (c9e18e5, 3491956, 69e4b57, 15eb56d)

  • Added NotificationUtils to provide utilities to build and manage notifications. (20d20f4)

  • Added PackageUtils to provide utilities to get various package related info. This will be used to get info based on app Context objects instead of using BuildConfig which wouldn't have been available across termux plugins. (15eb56d)

  • Added FileUtils to provide utilities to safely manage files. Also added support to get detailed UNIX file attributes by porting classes from android's libcore/ojluni. (d4fc34c)

Changed

  • Refactored TermuxActivity. Dedicated classes and functions have been created for various actions and commands. (c9e18e5)

  • The dedicated TerminalToolbarViewPager class has been created to handle the now called toolbar that shows on the bottom of the terminal view. (c9e18e5)

  • The dedicated TermuxSessionsListViewController class has been created to handle view related functionality of the termux sessions list shown in the left drawer. (c9e18e5)

  • The dedicated TermuxTerminalSessionClient class has been created to handle TerminalSession class TerminalSessionClient interface (previously SessionChangedCallback). (c9e18e5, 824b3e6)

  • Refactored TermuxService. Dedicated classes and functions have been created for various actions and commands. (d9b5344)

  • Refactored terminal-view. Dedicated classes and functions have been created for various actions and commands. (ada5087)

  • The dedicated CursorController, TextSelectionCursorController(previously SelectionModifierCursorController) and TextSelectionHandleView (previously HandleView) classes have been created to handle text selection and have been moved from TerminalView. (ada5087)

  • Get TERMUX_VERSION while building shell environment via Termux package context instead of BuildConfig so that termux plugin apps can use it too. (d4653d0)

  • Use FileUtils for bootstrap and shared storage symlinks setup. (b2cd20c)

  • Use FileUtils for clearing TMPDIR and move clearing function to ShellUtils from TermuxService. (8598b92)

  • Disable obfuscation of termux-app in release builds without disabling optimizations and shrinking to allow stacktraces to have full class and method names when a crash report is generated. (067709b)

  • Changed compileSdkVersion (NOT targetSdkVersion) to 29 so that newer APIs can be used. (8e80e88)

  • Moved activities and fragments to respective packages. (b856e16)

  • Fixed xml files naming convention. (c9e18e5, 4eced52)

  • Fixed string resources naming convention. (eeb8554)

Fixed

  • Fixed Duplicate finish request for ActivityRecord errors. (f50d15d)

  • Fixed executable and working directory path expansion in RunCommandService where it was not expanding path if exactly $PREFIX is passed and was adding extra trailing slashes in some cases. (80858ba)

  • Fixed the issue when cwd is empty and is passed to Runtime.getRuntime().exec(progArray, env, new File(cwd));, it raises the No such file or directory exceptions when targeting sdk 29. (85b2c44)

  • Fixed non-crashing NoClassDefFoundError exceptions for TermuxActivity. (9fd2cf9)

  • Fixed few potential null pointer exceptions (and probably added a few more). (dbf8477)

  • Fix old issue where termux app would crash if sessions list ListView was not notified of new sessions. (ae260fa)

  • Fixed issue which caused the java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. exception to be thrown when long pressing the down key while simultaneously long pressing the terminal view for text selection and crashed the app. Fixes A bug for termux-terminal #1501. (ada5087)

  • Fixed issue to restore keyboard input into terminal view when toggling extra-keys slider input with VOL_UP+q. Fixes Unhiding extra keys while input view was shown causes incorrect keyboard handling #1420. (395759c)

  • Fixed TermuxActivityBroadcastReceiver wrongly designed intent actions and extras. (e5c5174)

  • Fixed potential crashes of TermuxService due to startForeground() and stopForeground() not being called in all the right places. (d9b5344)

  • Fixed performance degradation of background commands since logging of every line separately was enabled. They will now only be logged if log level is set to verbose. This will also prevent potentially private user data from being sent to logcat by default. (f62febb)

  • Fixed issue where TermuxService was stopped and Termux notification canceled if background tasks were still running but all sessions had been closed. (f888f35)

  • Fixed issue where Termux:Tasker would hang indefinitely when the command was executed with Runtime.getRuntime().exec() and it raised an exception, like for invalid or missing interpreter errors and Termux:Tasker was not notified of it. Now the errmsg will be used to send any exceptions back to Termux:Tasker and other 3rd party calls. (f62febb)

  • Fixed issue where stdout or stderr were too large in size and the TransactionTooLargeException exception was raised and result of background commands was not sent back to the caller. This previously only applied to Termux:Tasker which would hang indefinitely. Now stdout and stderr will be truncated from the start to max 100KB combined. The original size of stdout and stderr will now also be sent to the caller so that they can check if either of them were truncated, these additional variables need to be implemented in Termux:Tasker but will be available for the now supported RUN_COMMAND intent results. The errmsg will also be truncated from end to max 25KB to preserve start of stacktraces. (f62febb)

  • Fixed issue where Termux:Tasker would hang indefinitely for background commands when TermuxService was killed before the commands completed or before they even started because TermuxService was about to be killed since Termux:Tasker was not notified of it. Now, TermuxService will kill all background commands started by plugins for which the result is expect back via a pending intent before it is destroyed and notify Termux:Tasker. For commands that have not even started, Termux:Tasker will be notified that they have been canceled. This previously only applied to Termux:Tasker and not RUN_COMMAND intent, but now will apply to the later as well if result is expected back. Note that there may still be cases where TermuxService is killed without even having the chance to notify the command sender, in which case reasonable timeout values should be used, like the one available for Tasker actions. (0cd7cb8)

Deprecated

  • TERMUX_ACTIVITY.EXTRA_RELOAD_STYLE (com.termux.app.reload_style) which was previously used for requesting storage permissions if its value equaled storage has been deprecated. (e5c5174)

The above is the changelog that covers most of the stuff updated, there might be some important stuff left in the commit messages that's not even mentioned here, but this is the max amount of brain cells I'm willing to sacrifice for this changelog, so it will have to do ;). The commit messages also have a lot more detail about stuff.

@Grimler91
Copy link
Member

🎉

@agnostic-apollo you should be able to tag the release yourself if you want to. Since you have bumped the version code in the app it just you be a git tag/release needed: https://github.com/termux/termux-app/releases/new, and then F-droid should pick it up.

Releases can be edited afterwards as well in case something goes wrong.

@agnostic-apollo
Copy link
Member Author

Thanks, but xeffyr asked me not to do that myself since he has to build the bootstrap with updated packages.

@Grimler91
Copy link
Member

Ah, alright

@ghost
Copy link

ghost commented Apr 13, 2021

Thanks, but xeffyr asked me not to do that myself since he has to build the bootstrap

Will do that today and then new release.

@agnostic-apollo
Copy link
Member Author

Great, thanks!

@RalfWerner
Copy link

... It is larger because lot of code has been added

Sorry @agnostic-apollo my "6358b" note should not be a request to explain - thank you that you do it even.
My 108->109 change notes I've extend in check. The three boot loop extensions I have done but a first build with the master clone failed! Possibly you can see immediately what this is - here the BUILD FAILED in 1m 37s error:

> Task :termux-shared:compileDebugJavaWithJavac
D:\Android\109\termux-shared\src\main\java\com\termux\shared\termux\TermuxUtils.java:307: error: cannot find symbol
        InputStream inputStream = context.getResources().openRawResource(com.termux.shared.R.raw.apt_info_script);
                                                                                            ^
  symbol:   variable raw
  location: class R
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

> Task :termux-shared:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':termux-shared:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

... to change behaviour of KEYBOARD to disable instead of toggle in future ... No, I don't use ...

Please not! Better ensure the Extra Key toggle always works and unmotivated show of OS KB not longer. I later try to create an example video, that can be repeated on your avd. Split is possible like shot5 above and the external KB (PC) is connected to each emulator.

@agnostic-apollo
Copy link
Member Author

agnostic-apollo commented Apr 13, 2021

the master clone failed!
InputStream inputStream = context.getResources().openRawResource(com.termux.shared.R.raw.apt_info_script);

If you are using android studio, then either restart it or File (top left) -> Invalidate Caches/Restart -> Invalidate and Restart.

@RalfWerner
Copy link

RalfWerner commented Apr 13, 2021

If you are using android studio

No I use call gradlew assembleDebug in a cmd - but Thanks I tried to use Studio as you suggest and done the Steps (Studio restarts) and repeat the build. Unfortunatly with the same bug! Shot of Studio:
grafik

@ghost
Copy link

ghost commented Apr 13, 2021

Invalidate the caches and restart Android Studio.

@agnostic-apollo
Copy link
Member Author

There is a left over dot at the end of the termux-app/termux-shared/src/main/res/raw/apt_info_script. file which is probably causing the issue. @xeffyr left me fix that first.

@agnostic-apollo
Copy link
Member Author

Fixed by #2002 which has been merged. @xeffyr you can release it now.

@RalfWerner
Copy link

RalfWerner commented Apr 13, 2021

Your new Artifact is reduced by 76148b (do not comment). But can you explain to me, why this and your last build was successful and not in master after the Merge?

Not currently since there are no immediate plans for android-10 branch merge above.

I remember again that my 29+ idea based on the master banch and not android-10. I only use that because there are MANAGE*STORAGE and sysmlinks to $nl. My merge attempts (98->103/107) I have given up and at 109 is almost everything else.

... I later try to create an example video, that can be repeated on your avd.

If I remember well, you have a Pixel_2_api_30 to check the KEYBOARD toggeling (looks like the shot) right?
grafik
Are you still interested in a Video (github manage up to 10 Mb)?

@agnostic-apollo
Copy link
Member Author

your last build was successful and not in master after the Merge?

Build after merging into master branch was successful too. Issue was on your local device, I don't know what. The dot was left because I had tried to add an extension to the apt_info_script file with android studio which apparently failed, but kept the dot . at the end and didn't show the dot in android studio files list in the side bar (bug), had to open file manager to notice the dot. But it still compiled locally after restarting android studio.

If I remember well, you have a Pixel_2_api_30 to check the KEYBOARD toggeling (looks like the shot) right?
Are you still interested in a Video?

I don't think video is needed.

To disable soft keyboard for all apps, click on the keyboard button on the bottom right (top right in landscape), there should a toggle for disabling soft keyboard if hardware keyboard is connected. This requires 2 clicks. Same (older) phones show a notification for choosing input method instead of that button. The button shows in both my android 10 and 11 avds.

To disable soft keyboard for only termux, Termux Settings -> Keyboard I/O -> Soft Keyboard toggle can be used, but requires lots of clicks. To optionally make KEYBOARD extra keys either toggle or disable keyboard depending on user preference so that 1 click is required will require "lot" of work because of the way Termux is designed, lot of functions will need to be added and will be considered in future.

@RalfWerner
Copy link

RalfWerner commented Apr 14, 2021

But it still compiled locally after restarting android studio.

Thanks! After your last #2002 Merge, I can create with the current master and my three changes + version: b.109 the *.apk with gradlew, Studio and without/with boot*.zip. The first one is identical to yours and F-Droid but with developer signature. All others contain only $arch (25/30MB). I use my own clean with which the sources are reduced to the necessary (now) 196 files and to avoid conflicts. Open question: is Pixel_2_api_30 your AVD?

I don't think video is needed ... will need to be added and will be considered in future.

grafik
Ok! Less preparation for me and more opportunity to misunderstand. Your disabling proposal works, but only on avd. In all my real devices (also Android 11) the switch is not included - so the 7 taps/clicks remain. There would be no problem, if KEYBORD as extra key would still works. Currently nothing happens when I Tap on it.
In X11, the problem appears already solved. There back key is used. The effect above is in any case difficult to understand/explain.

Above is a .bashrc version that creates .shortcuts. I supplemented (6 lines) by a few alias, symlinks and as well storage access inclusive allow dialog. The start from the widget table deny without draw over apps Your answer (not to my Question) was:

Yes, this is why added the flash message if permission was missing since people may not know how to fix it and open issues or think it was normal behaviour.

After explaining to me, where this was done on my device I succeeded. Maybe I'm too stupid to find it but it would be easier, to have the allow dialogue in line 4 (behind mkdir in my language) as with storage in line 6. With the following script, this can be repeated with Copy/Paste in Termux after a virgin 109.apk installation/start.

echo 's=storage t=com.termux c=$t.app.reload_style f="\`find u/"; w="|wc -l\`"
alias ll="ls -al" s="echo u/nl $f$w/$f/nl/$w" d="du -hd 1" pp="ps -eo pid,ppid,comm,etime"
f=`df|grep $s|grep \-|cut -d% -f2`; [ -e u ]&& . uu.sh . .; # only if file exist!
sc=.shortcuts; if [ ! -d $sc ];then mkdir $sc;cd $sc;$e "bash uu.sh uu n uu.sh">nedit
$e "env;ls -la;$ps;pstree;exit 1">env-ls-ps;$e "nano .bashrc">nano;cd;fi;[ -e u ]&& return
ln -s ../usr u; ln -s /$s/emulated/0 sd; am broadcast --es $c $s -a $c $t'>.bashrc

Sufficient for this example is e=echo in uu.sh, for the first two WP. The file (shortcut: alias u bash uu.sh) is included in the boot-loop of *.apk or copied/linked to ~/uu.sh. If it exist, the first two lines and last one of .bashrc you could remove and Extra-Keys can be created by u ky. For the WP nedit (ubuntu) and X11 plugin/toggle, further data and processes are necessary - checks here by pp. If you want to repeat it, I could provide the code here.

To produce the next boot*.zip generation is offered u sc. Without further parameters or with u from the current installation or with parameter sd/tu.tgz. This Termux backup file is produced with u tu. To my boot-loop idea and checks, you have previously given me only the reference to the open 29+ decision*). But It is more: In addition to the continuation of the 28 master + two (u/nl-symlink + u/libnl-path) files, the boot and pkg/apt effort can be significantly reduced.
*)could you please do?

@RalfWerner
Copy link

RalfWerner commented May 8, 2021

ps: above are some open "?"

@agnostic-apollo
Copy link
Member Author

agnostic-apollo commented May 8, 2021

Comment moved here. Respond there, this is not the place for this discussion anymore.

AdamMickiewich pushed a commit to VolyaTeam/dzida-app that referenced this pull request Aug 8, 2022
shrihankp pushed a commit to reisxd/termux-app that referenced this pull request Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants