-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Let TermuxActivity accept the initial script #1455
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
Conversation
It is useful to run a script under Termux by using adb: ``` adb shell start -n com.termux/.app.TermuxActivity -d file:///path/to/script.sh ```
|
Sorry, but we do not want to allow to initiate execution of arbitrary code by third-party intents without explicit approval by user. Your implementation is suitable for debug builds, but in such case additional changes should be done. |
|
Thanks for taking the time to reply my PR! Your decision about security looks reasonable. In my use case (Termux as a CI), I build and install a custom Termux package for each execution. So, it is enough if an initial script is allowed only when debug build. I've added a commit to allow an initial script only when Is there any chance to merge the change above? Alternatively, it is even enough if I can specify a fixed initial script at the build time, such as Thanks! |
|
Incidentally, if it's possible to send key events to Termux (per the original message "Otherwise, we need to send key events to Termux to input a command that invokes the test script"), it seems like things are already wide-open security-wise....
|
For ADB & root only. |
|
@mame Putting script to /sdcard does not work properly due to missing exec permission in this location (storage access is granted). So what expected path of where script should be put before execution ? |
The path I'm using is hello.sh run.sh |
|
Well, is my script running on hello.sh |
|
Do you use SSH on Termux? |
|
@rubikitch I want to automatically setup Termux on an empty Android image without manual operation. To use SSH, I need to run |
|
I've implemented another idea: specifying the default executable path via gradle properties. We can specify the default path by the following build command. The diff is much simpler than the original proposal. |
|
Hi, I'm running an Android CI environment for Ruby that uses Termux. Currently, to invoke a script in Termux, it sends key events However, because it is not robust, it frequently fails to start the script. https://github.com/mame/rubyci-android/actions/runs/89371431 I'd appreciate it if you provide any way to invoke a startup script in Termux. |
This comment has been minimized.
This comment has been minimized.
|
I've noticed that this is now possible by using RUN_COMMAND Intent. I close my issue. Thank you for your great work! |
This changeset allows us to specify the initial executable as Intent data. In other words, we can invoke a script under Termux by the following adb command:
The motivation is to use Termux as a CI environment. This changeset is helpful to run a test script. Otherwise, we need to send key events to Termux to input a command that invokes the test script, which is very fragile.
What do you think?