Termux API

badge.svg

68747470733a2f2f6261646765732e6769747465722e696d2f7465726d75782f7465726d75782e737667

This is an app exposing Android API to command line usage and scripts or programs.

When developing or packaging, note that this app needs to be signed with the same

key as the main Termux app for permissions to work (only the main Termux app are

allowed to call the API methods in this app).

Installation

Termux:API application can be obtained from F-Droid.

Additionally we provide per-commit debug builds for those who want to try

out the latest features or test their pull request. This build can be obtained

from one of the workflow runs listed on Github Actions

page.

Signature keys of all offered builds are different. Before you switch the

installation source, you will have to uninstall the Termux application and

all currently installed plugins.

License

Released under the GPLv3 license.

How API calls are made through the termux-api helper binary

The termux-api

client binary in the termux-api package generates two linux anonymous namespace

sockets, and passes their address to the TermuxApiReceiver broadcast receiver

as in:

/system/bin/am broadcast ${BROADCAST_RECEIVER} --es socket_input ${INPUT_SOCKET} --es socket_output ${OUTPUT_SOCKET}

The two sockets are used to forward stdin from termux-api to the relevant API

class and output from the API class to the stdout of termux-api.

Client scripts

Client scripts which processes command line arguments before calling the

termux-api helper binary are available in the termux-api package.

Ideas

Wifi network search and connect.

Add extra permissions to the app to (un)install apps, stop processes etc.

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐