mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-04 01:35:39 +08:00
Changed: Refactor am socket server
The `AmSocketServer` now handles the entire logic for processing of am commands sent by clients and its results. This can be used by other apps as well to run their own am servers. The server started by `termux-app` will be managed by `TermuxAmSocketServer`. Read their javadocs for details. The extended implementation `TermuxAmSocketServerClient` of `AmSocketServer.AmSocketServerClient`/`ILocalSocketManager` will also send a plugin error notification for all errors to the user instead of just logging to logcat since users are not very good at checking those, this should save dev time debugging problems. We may need to ignore notifications for some errors like broken pipe, based on their `Error` objects if they are normally expected, this requires further investigation. The `TERMUX_APP_AM_SOCKET_SERVER_ENABLED` env variable will also be exported for all shell sessions and tasks for whether the server was successfully started on app startup. The user can disable the server by adding "run-termux-am-socket-server=false" to the "~/.termux/termux.properties" as implemented in5f8a9222
. The env variable will be checked by `$PREFIX/bin/termux-am` before attempting to connect. The new path for the server socket is `/data/data/com.termux/files/apps/termux-app/termux-am/am.sock` as per `TERMUX_APP.APPS_DIR_PATH` added inbcd8f4c4
.
This commit is contained in:
@@ -25,10 +25,6 @@ android {
|
||||
|
||||
implementation project(":terminal-view")
|
||||
implementation project(":termux-shared")
|
||||
|
||||
|
||||
implementation 'com.github.termux:termux-am-library:1.0'
|
||||
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
Reference in New Issue
Block a user