github termux/termux-api v0.54.0

37 minutes ago

v0.54.0 - 2026-12-06

Commit history: v0.53.0...v0.54.0

Changelog

Fixed

  • Do not show java.io.IOException: Connection refused error notification if it was due to API server process being killed before it was able to receive the result. Closes #782, Closes #887 (comment). (c4dee53d057c, 3676676cb372, 62f9628faf00)

  • Add support in SocketListener for long extras (--el) (Error Unsupported argument type: --el api_server_starttime xxxxxxxx). Closes #937. (374431c9f411)

  • Throw dedicated exception and show notification for repeat calls to ResultReturner.returnData() by an API command. (fc26ce17e3ba)

  • Attempt to activate NotificationListenerService and then check every 1s for next 15s to see if it became active (Error java.lang.NullPointerException: Attempt to invoke virtual method 'android.service.notification.StatusBarNotification[] android.service.notification.NotificationListenerService.getActiveNotifications()' on a null object reference). Closes #662, #899. (eef397759f79)

  • Catch all exceptions when starting recording instead of just IllegalStateException and IOException. (224d5eb627c6)

  • Ask user to set Allow all the time for location permission on Android >= 11. The location permission page that Termux:API starts if permission is missing does not have the Allow all the time option and only the Allow only while using the app, which is not enough to access location while Termux app is in background. There are Android APIs to request it, they can be looked into in future. (ee29d4314ca4)

  • ! Add LocationService to handle termux-location commands and use CountDownLatch to wait for responses instead of Thread.sleep() shenanigans and fix updates/once commands.

    1. The termux-location -p gps -r updates will now send responses in an array at root level, where each response will get added as a dict inside the array.
    2. Now multiple location responses should be properly received, including being able to run multiple termux-location commands at once.
    3. The termux-location -r updates command sends responses for the next 30 seconds, with a minimum interval of 5 seconds. Previously, minimum distance between location updates was 50 meters, but now it is 1 meter to support location updates while walking for people who like to touch grass. In future these parameters can be configurable.

    For Android >= 11, if Termux:API gets frozen, the Termux:API app will not be able to send back location and other API command responses, and native termux-api commands will hang, sometimes in between responses, like after only getting 1 or 2 location updates before the 30s complete. It is recommended to use adb shell "settings put global cached_apps_freezer disabled" to disable freezing, and then at least start Termux:API app once from the launcher in case it was already frozen. Check #638 (comment) for more info. You may instead try termux-api-start command to start a foreground service, but it may get killed anytime too.

    (255bc405f526)


 

Don't miss a new termux-api release

NewReleases is sending notifications on new releases.