Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
2edcb9f
Adding _id to results
gungsukma Apr 20, 2021
cc5a89f
Update SmsInboxAPI.java
gungsukma Apr 22, 2021
6e0198d
Update debug_build.yml
agnostic-apollo Jul 2, 2021
ff4abb9
notification list: return human readable date in 'when' field
Aug 21, 2021
fbcfdb4
call log: use 'HH:mm:ss' for time format
Aug 21, 2021
27af333
Merge pull request #439 from termux/dateformat
Aug 21, 2021
7e2e607
version 0.49
Aug 21, 2021
e5f460c
Update gradle, dependencies and compileSdkVersion
Grimler91 Aug 27, 2021
40635a0
APIs: remove compatiblity with M. We support only >= N
Grimler91 Aug 27, 2021
8ebc674
lint: disable error about google play requiring targetSdkVersion>28
Grimler91 Aug 27, 2021
3fb1b1a
Merge pull request #442 from termux/build-and-dep-updates
Grimler91 Aug 27, 2021
89794f7
changed sender name on the sent Messages
innocentmasuki Oct 12, 2021
f9fa75f
SmsInboxAPI: minor spacing fixes
Grimler91 Nov 20, 2021
6e14433
Merge pull request #454 from Diggerati/master
Grimler91 Nov 21, 2021
d62768c
Add inbox content URI
djlemke Jun 4, 2021
92b4cd8
Merge pull request #412 from gungsukma/patch-2
Grimler91 Nov 21, 2021
a5f7d14
CameraAPI: fix camera issue, and cleanup after taking a photo
povidalo Nov 16, 2021
6631576
Use termux-shared library for constants
Grimler91 Nov 28, 2021
58f9d79
NotificationAPI: use TERMUX_PREFIX_DIR_PATH from termux-shared
Grimler91 Nov 28, 2021
25531cf
Dialog: use constants from termux-shared to get property file paths
Grimler91 Nov 28, 2021
e33dd4a
Manifest: remove hardcoded com.termux.api everywhere
Grimler91 Dec 5, 2021
c4955a5
Define TermuxAPIApplication
Grimler91 Dec 5, 2021
51a7f6d
Update .gitignore
agnostic-apollo Jul 8, 2021
6ef2618
Changed: Enable minifyEnabled
agnostic-apollo Sep 4, 2021
818ad54
Define sdk versions in build.gradle
Grimler91 Dec 5, 2021
ed20ebb
gradle: use 7.3.1
Grimler91 Dec 5, 2021
ebf4511
Changed!: use semantic versioning and add commit hash to APK file names
agnostic-apollo Sep 22, 2021
5ca50e0
Update dependency versions
Grimler91 Dec 5, 2021
44ee2ee
Added: An API to access the Android SAF.
tareksander Dec 15, 2021
d9b9c83
Fixed: Subfolders in SAF.
tareksander Dec 16, 2021
d4e9c06
Changed: Changed the format for termux-saf-dirs to be like termux-saf…
tareksander Dec 20, 2021
5f12af4
Added: Option the specify the channel for termux-notification and an …
tareksander Dec 20, 2021
4c8296e
Changed: Expose a unix server socket
tareksander Dec 1, 2021
9e496d6
Added: Support for Intent actions over the socket connection.
tareksander Dec 2, 2021
22e8171
Changed: Write newline after the URI for manageDocumentTree, createDo…
tareksander Dec 25, 2021
17c0595
Release version v0.50
Grimler91 Dec 26, 2021
e315b53
Bump to v0.50.1
agnostic-apollo Dec 31, 2021
c2754ca
bug report template: ask for termux-api package version as well
Grimler91 Jan 3, 2022
a4fbba0
Changed: Refactor attach_debug_apk_to_release workflow add support fo…
agnostic-apollo Jan 8, 2022
a68ebbe
Changed|Fixed: Fix and refactor debug_build workflow add support for …
agnostic-apollo Jan 8, 2022
e2bb7a8
Changed: Remove termux-emulator JNI libs from APK
agnostic-apollo Jan 8, 2022
c7abdeb
Changed: Renamed App to SocketListener and call that from the real Ap…
tareksander Jan 14, 2022
f88a6a5
Merge pull request #487 from tareksander/master
Grimler91 Jan 19, 2022
a546eeb
Merge pull request #476 from tareksander/saf
Grimler91 Jan 19, 2022
75a5ffe
Merge pull request #477 from tareksander/notification-channels
Grimler91 Jan 19, 2022
a857483
CallLogAPI: Add dual sim feature
wzaw1 Feb 6, 2022
dc89cd6
TelephonyAPI: add 5G NR radio support and additional fields for LTE
jdesai61cts Dec 28, 2021
f5ae1af
Changed: Bump termux-shared to f3ffc36bfd
agnostic-apollo Mar 11, 2022
7ef6b20
Added: Request ACCESS_BACKGROUND_LOCATION as required by android 10+
agnostic-apollo Mar 11, 2022
5a8f817
Changed: Set DEFAULT_LOG_TAG at application startup as per termux/ter…
agnostic-apollo Mar 11, 2022
82515f2
Changed: Move API classes to api package
agnostic-apollo Mar 12, 2022
cb59029
Changed: Rename TermuxAPIApplication setLogLevel() to setLogConfig()
agnostic-apollo Mar 12, 2022
2af9536
Changed: Use requireContext() and requireActivity() instead of requir…
agnostic-apollo Mar 12, 2022
78d76be
Fixed: Use equals() instead of == for nfc mode string comaparison
agnostic-apollo Mar 12, 2022
187e691
Changed: Rename PlayerService to MediaPlayerService
agnostic-apollo Mar 12, 2022
46df001
Changed: Rename SchedulerJobService to JobSchedulerService
agnostic-apollo Mar 12, 2022
645e7ef
Added: Use Logger class for logging and add log entries for all APIs …
agnostic-apollo Mar 12, 2022
feb568c
Fixed: Add missing return statement after error in onReceiveTelephon…
agnostic-apollo Mar 12, 2022
292c309
Changed: Sort permissions and features in AndroidManifest
agnostic-apollo Mar 12, 2022
2968854
Changed: Protect ShareAPI.ContentProvider write acess with permissoio…
agnostic-apollo Mar 12, 2022
5c71e2d
Changed: Use night-mode instead of use-black-ui termux.properties pro…
agnostic-apollo Mar 12, 2022
416c525
Added: Add missing attributes for dialog_textarea_input
agnostic-apollo Mar 14, 2022
c169a51
Fixed: Fix missing API level checks for method calls
agnostic-apollo Mar 14, 2022
28fce53
Added: Add RequiresPermission annotations to methods
agnostic-apollo Mar 14, 2022
8d6c6ce
Added: Declare READ_PRIVILEGED_PHONE_STATE permission for TelePhony A…
agnostic-apollo Mar 14, 2022
d606d13
Changed: Suppress build.gradle validateVersionName() warnings
agnostic-apollo Mar 14, 2022
bf6d834
Fixed: Check for READ_PHONE_STATE for SmsSend API
agnostic-apollo Mar 14, 2022
58c272b
Fixed: Fallback from cellular to unmetered on Android < 9 for JobSche…
agnostic-apollo Mar 14, 2022
cfdcab9
Fixed: Exit loop after "android.nfc.tech.Ndef" found in tech list
agnostic-apollo Mar 14, 2022
6ab3b48
Changed: Remove unnecessary SDK_INT is always >= 24 conditions
agnostic-apollo Mar 14, 2022
9a1e19c
Changed: Remove unused imports
agnostic-apollo Mar 14, 2022
3bea194
Changed: Remove hardcoded `com.termux` values
agnostic-apollo Mar 14, 2022
9a9e3ea
Changed|Fixed: Use TERMUX_API_FILE_SHARE_URI_AUTHORITY for content pr…
agnostic-apollo Mar 14, 2022
94d478d
Fixed: Fix potential NullPointerException in NotificationAPI $REPLY p…
agnostic-apollo Mar 14, 2022
237d36a
Fixed: Fix raw use of parameterized class 'Pair' for NotificationAPI
agnostic-apollo Mar 14, 2022
cc186d0
Changed|Fixed: Fix potential NullPointerException in PhotoAPI and use…
agnostic-apollo Mar 14, 2022
950f9be
Changed|Fixed: Fix potential NullPointerException in StorageGetAPI an…
agnostic-apollo Mar 14, 2022
e7a684a
Changed: Remove redundant return variables
agnostic-apollo Mar 14, 2022
916f321
Changed: Replace c-style array declarations with java style
agnostic-apollo Mar 14, 2022
99080ba
Fixed: Fix NullPointerException when running bell/vibrate on Samsung …
agnostic-apollo Mar 14, 2022
4c5c27b
Fixed: Catch IllegalStateException "Broadcast already finished" and a…
agnostic-apollo Mar 14, 2022
166595c
Fixed: Prevent multiple calls to `ResultReturner.returnData()` in `Di…
agnostic-apollo Mar 16, 2022
364fe33
Fixed: Fix `NullPointerException` if activity is dismissed while dial…
agnostic-apollo Mar 16, 2022
ea5c14b
Fixed: Dismiss dialog before `DialogActivity.onDestroy()` to prevent …
agnostic-apollo Mar 16, 2022
30a58d7
Fixed: Fix `NullPointerException` triggered when trying to show keybo…
agnostic-apollo Mar 16, 2022
ec39025
Added: Add storage permissions since `PermissionUtils.checkPermission…
agnostic-apollo Mar 16, 2022
cfbcde8
Changed: Bump termux-shared to caa13b7047
agnostic-apollo Mar 18, 2022
c3befab
Changed: Use `PermissionUtils` for permission checking
agnostic-apollo Mar 18, 2022
f2c1342
Added: Add launcher icon/activity
agnostic-apollo Mar 18, 2022
6112bf6
Added: Add support to send crash notifications if exceptions are caug…
agnostic-apollo Mar 18, 2022
3c1a6be
Changed: Do not hang indefinitely when exceptions are thrown in `Term…
agnostic-apollo Mar 18, 2022
ac967e8
Changed: Rename `PhotoAPI` to `CameraPhotoAPI`
agnostic-apollo Mar 22, 2022
789957d
Changed: Remove left over `replyKey` key from `NotificationAPI` from …
agnostic-apollo Mar 26, 2022
c845650
Changed: Bump termux-shared to ce12b8ad2d
agnostic-apollo Mar 30, 2022
ba2836b
Added: Request disable battery optimizations and grant draw over apps…
agnostic-apollo Mar 30, 2022
24fbea7
Fixed: Fix typo in `CameraPhotoAPI` and `StorageGetAPI` that was gett…
agnostic-apollo Apr 22, 2022
fab6872
Fixed: Fix exception for missing `android.nfc.action.TECH_DISCOVERED`…
agnostic-apollo Apr 22, 2022
3b85bc1
Fixed: Fix crash if input or output socket extras are not set
agnostic-apollo Apr 22, 2022
c99dc58
Changed: Catch `Throwable` instead of `Exception` for uncaught except…
agnostic-apollo Apr 22, 2022
ba8166a
Changed: Bump termux-shared to 7f7d889dd0
agnostic-apollo Apr 22, 2022
1f4a3f2
Changed: Send plugin error notification instead of crash notification…
agnostic-apollo Apr 22, 2022
b296a0c
Changed: Do not add `liblocal-socket.so` to APK added via termux-shared
agnostic-apollo Apr 22, 2022
df3cb50
Fixed: Text not visible when in dark mode for bottom sheet dialog
dkramer95 Jul 9, 2022
a080909
Fixed: Handle unexpected socket client disconnects
AgentConDier Jul 17, 2022
6e80b07
gitignore: ignore *~ as well
Grimler91 Jun 24, 2022
c31cace
rename dev_keystore.jks to testkey_untrusted.jks
Sep 21, 2022
11eff56
Fixed: Fix termux-call-log api `IllegalArgumentException: Invalid tok…
agnostic-apollo Sep 23, 2022
9e72088
Bump `termux-shared` to `8c1749ef96`
agnostic-apollo Sep 28, 2022
4017a90
Create dependabot.yml
landfillbaby Nov 7, 2022
696af69
Bump actions/upload-artifact from 2 to 3
dependabot[bot] Nov 7, 2022
f96b1d4
Bump actions/checkout from 2 to 3
dependabot[bot] Nov 7, 2022
c7c8d98
Merge pull request #562 from termux/dependabot/github_actions/actions…
landfillbaby Nov 7, 2022
2c6674f
Merge pull request #563 from termux/dependabot/github_actions/actions…
landfillbaby Nov 7, 2022
0b0c305
Changed: Bump gradle to 7.5 and android gradle plugin to 7.3.1
agnostic-apollo Nov 15, 2022
d2f2051
Fixed: Fix `ReportActivityBroadcastReceiver` missing package name in …
agnostic-apollo Nov 15, 2022
83c62b3
Changed: Add termux app installation link to README
agnostic-apollo Aug 21, 2023
8bd2293
Fixed: Fix bool extras parsing for `SocketListener`
agnostic-apollo Aug 23, 2023
b732327
Bump actions/checkout from 3 to 4
dependabot[bot] Sep 4, 2023
4159c62
Bump actions/upload-artifact from 3 to 4 (#646)
dependabot[bot] Jan 1, 2024
e994de5
Fixed: Fix exception in ResultReturner while setting result for a non…
agnostic-apollo Mar 19, 2024
a9abc96
Fixed: Fix vibration not happening if duration is under 1000ms and to…
agnostic-apollo Mar 19, 2024
4c6a519
Fixed: Fix usb fd not being sent due to refactoring in 3c1a6be
dougvj Nov 29, 2023
cff225e
Added: Add `capabilities` field to `termux-wifi-scaninfo` output
agnostic-apollo Apr 26, 2024
c553bc2
Added: Add latest version name info to README.md
agnostic-apollo Jul 30, 2024
a9ab5cb
Changed!: Rename `app/build.gradle` environmental variables to `TERMU…
agnostic-apollo Apr 15, 2024
35a92c5
Added|Changed!: Change `sha256sums` filename to `checksums-sha256.txt…
agnostic-apollo Apr 15, 2024
348d699
Changed: Rename workflow filename of `debug_build.yml` to `github_act…
agnostic-apollo Apr 16, 2024
5dbe9be
Fixed: Fix pull request APK version commit hash for GitHub Action builds
agnostic-apollo Apr 16, 2024
9ebd3ce
Changed: Update references for `github_action_build.yml` and `github_…
agnostic-apollo Apr 16, 2024
30bf7d2
Changed!: Use dot `.` as tags separator instead of dash `-` for `gith…
agnostic-apollo Apr 16, 2024
e6aaf61
Changed!: Add `-app` suffix to app name and add version name in APKs …
agnostic-apollo Jun 22, 2024
828fea2
Changed: Use GitHub `cli` instead of `hub` for uploading GitHub relea…
agnostic-apollo Apr 16, 2024
f60affe
Added: Add `workflow_dispatch` and `cron` schedule for "00:15 on 1st …
agnostic-apollo Apr 16, 2024
dec56b2
Changed: Rename `minSdkVersion` to `minSdk`, `targetSdkVersion` to `t…
agnostic-apollo Apr 17, 2024
66f9dcd
Changed!: Rename `app/build.gradle` environmental variables to `TERMU…
agnostic-apollo Dec 18, 2024
11887f2
Changed: Bump gradle to `8.9`, gradle android plugin to `8.7.3` and `…
agnostic-apollo Dec 22, 2024
013e458
Changed: Use fully qualified name for resource variable references of…
agnostic-apollo Dec 22, 2024
95e420d
Changed: Update gradle dependencies
agnostic-apollo Dec 22, 2024
280e5c7
Changed: Rename `TermuxAPIActivity` to `TermuxAPIMainActivity` stage 1
agnostic-apollo Aug 18, 2024
bab9ef3
Changed: Rename `TermuxAPIActivity` to `TermuxAPIMainActivity` stage 2
agnostic-apollo Dec 22, 2024
fe6e3d4
Added: Add support for unix filesystem sockets for API communication
agnostic-apollo Dec 22, 2024
6207214
Changed: Bump `termux-shared` to `b0e1dbc3da`
agnostic-apollo Dec 22, 2024
11b2bfb
Changed: Set `DEFAULT_LOG_TAG` at application startup as per termux/t…
agnostic-apollo Dec 23, 2024
ea094b0
Added: Add `INTERNET` permission
agnostic-apollo Dec 22, 2024
989a19b
Added: Add `DUMP` and `PACKAGE_USAGE_STATS` permissions
agnostic-apollo Dec 22, 2024
ed867bc
Added: Add Termux:API app settings activity directly in the app itsel…
agnostic-apollo Dec 23, 2024
d5364ef
Added|Changed|Fixed: Add `present`, `technology`, `voltage`, `current…
agnostic-apollo Jan 6, 2025
5467912
Fixed: Remove `FLAG_GRANT_*_URI_PERMISSION` flags when starting docum…
agnostic-apollo Jan 12, 2025
724f275
Fixed: Do not pass `-1` value to `Cursor.get*()` calls returned by `C…
agnostic-apollo Jan 12, 2025
603f6d7
Deprecated(SmsInboxAPI): Deprecate `phone` key for message info and r…
agnostic-apollo Jan 24, 2025
1b60b23
Added|Fixed(SmsInboxAPI): Enhance API with new options and fix errors…
agnostic-apollo Jan 24, 2025
12e7b65
Fixed|Changed(SmsInboxAPI)!: Fix exception for message address/from s…
agnostic-apollo Jan 25, 2025
0eae939
Added: Add monochrome icon
Biswa96 Jan 14, 2025
992ce17
Added(MicRecorderAPI): Add opus audio encoder
Biswa96 Jan 31, 2025
3f74300
Added(SAFAPI): Add `last_modified` attribute for `termux-saf-stat` an…
BryanJacobs Mar 28, 2024
d5da717
Fixed(SensorAPI): Use shortest matched sensor
TomoBossi Jul 20, 2024
15d5fb6
Changed|Fixed(UsbAPI): Add `UsbService` to process usb api requests a…
9hm2 Jun 20, 2024
8c3330c
Changed: Bump `termux-shared` to `9ee1c9d5ad`
agnostic-apollo Mar 29, 2025
ad2161a
Release: v0.51.0
agnostic-apollo Mar 29, 2025
97b4100
Fixed(BatteryStatusAPI): Output double value instead of string for te…
agnostic-apollo Apr 13, 2025
922f358
Fixed: Manually add stack trace of caller function that called `Resul…
agnostic-apollo May 22, 2025
02b1c66
Changed: Remove unused imports
agnostic-apollo May 22, 2025
7c1759a
Fixed(NotificationAPI): Fix `termux-notification` actions not updatin…
agnostic-apollo May 22, 2025
1639e73
Fixed(NotificationAPI): Fix `termux-notification --icon` not working …
agnostic-apollo May 22, 2025
28bc8c8
Fixed: Fix disabling obfuscation added in 6ef2618f caused due to wron…
agnostic-apollo May 22, 2025
c986fb0
Fixed(NfcAPI): Fix `termux-nfc -t x` resulting in error notification …
agnostic-apollo May 22, 2025
4ba140d
Fixed(NfcAPI): Check if `NfcAdapter` is available and not `null` in `…
agnostic-apollo May 22, 2025
5040a66
Fixed(NfcAPI): Explicitly specify `PendingIntent.FLAG_MUTABLE` flag f…
agnostic-apollo May 22, 2025
9be2a6d
Added(JobSchedulerAPI): Add docs for `JobInfo` minimum period being r…
agnostic-apollo May 22, 2025
6fbf61a
Changed|Fixed(JobSchedulerAPI): Fix `ResultReturner.returnData()` bei…
agnostic-apollo May 22, 2025
a3a231e
Changed: Bump `termux-shared` to `da3a0ac4e2`
agnostic-apollo May 22, 2025
7e225c9
Release: v0.52.0
agnostic-apollo May 22, 2025
efbce59
Added: Add `SECURITY.md`
agnostic-apollo Jun 25, 2025
8431c4a
Changed: Bump termux-shared to 7bceab88e2
agnostic-apollo Jul 12, 2025
40abe78
Changed: Do not export `ReportActivity`
agnostic-apollo Aug 13, 2025
27a7599
Fixed: Fix `NullPointerException` in `BatteryStatusAPI` while convert…
agnostic-apollo Aug 22, 2025
6c8eaa2
Release: v0.53.0
agnostic-apollo Sep 1, 2025
760c177
Changed: Bump termux-shared to 8aca6dbbf4
agnostic-apollo Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ A clear and concise description of what you expected to happen.

**Additional information**

* Termux application version:
* termux-api application version:
* termux-api package version (installed through apt):
* Android OS version:
* Device model:
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
18 changes: 0 additions & 18 deletions .github/workflows/debug_build.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/github_action_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: GitHub Action Build

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "15 0 1 */2 *"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Build
shell: bash {0}
run: |
exit_on_error() { echo "$1"; exit 1; }

echo "Setting vars"

if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
GITHUB_SHA="${{ github.event.pull_request.head.sha }}" # Do not use last merge commit set in GITHUB_SHA
fi

# Set RELEASE_VERSION_NAME to "<CURRENT_VERSION_NAME>+<last_commit_hash>"
CURRENT_VERSION_NAME_REGEX='\s+versionName "([^"]+)"$'
CURRENT_VERSION_NAME="$(grep -m 1 -E "$CURRENT_VERSION_NAME_REGEX" ./app/build.gradle | sed -r "s/$CURRENT_VERSION_NAME_REGEX/\1/")"
RELEASE_VERSION_NAME="v$CURRENT_VERSION_NAME+${GITHUB_SHA:0:7}" # The "+" is necessary so that versioning precedence is not affected
if ! printf "%s" "${RELEASE_VERSION_NAME/v/}" | grep -qP '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'; then
exit_on_error "The release version '${RELEASE_VERSION_NAME/v/}' generated from current version '$CURRENT_VERSION_NAME' is not a valid version as per semantic version '2.0.0' spec in the format 'major.minor.patch(-prerelease)(+buildmetadata)'. https://semver.org/spec/v2.0.0.html."
fi

APK_DIR_PATH="./app/build/outputs/apk/debug"
APK_VERSION_TAG="$RELEASE_VERSION_NAME.github.debug" # Note the ".", GITHUB_SHA will already have "+" before it
APK_BASENAME_PREFIX="termux-api-app_$APK_VERSION_TAG"

# Used by upload step later
echo "APK_DIR_PATH=$APK_DIR_PATH" >> $GITHUB_ENV
echo "APK_VERSION_TAG=$APK_VERSION_TAG" >> $GITHUB_ENV
echo "APK_BASENAME_PREFIX=$APK_BASENAME_PREFIX" >> $GITHUB_ENV

echo "Building APK file for '$RELEASE_VERSION_NAME' release with '$APK_VERSION_TAG' tag"
export TERMUX_API_APP__BUILD__APP_VERSION_NAME="${RELEASE_VERSION_NAME/v/}" # Used by app/build.gradle
export TERMUX_API_APP__BUILD__APK_VERSION_TAG="$APK_VERSION_TAG" # Used by app/build.gradle
if ! ./gradlew assembleDebug; then
exit_on_error "Build failed for '$RELEASE_VERSION_NAME' release with '$APK_VERSION_TAG' tag."
fi

echo "Validating APK file"
if ! test -f "$APK_DIR_PATH/${APK_BASENAME_PREFIX}.apk"; then
files_found="$(ls "$APK_DIR_PATH")"
exit_on_error "Failed to find built APK file at '$APK_DIR_PATH/${APK_BASENAME_PREFIX}.apk'. Files found: "$'\n'"$files_found"
fi

echo "Generating checksums-sha256.txt file"
if ! (cd "$APK_DIR_PATH"; sha256sum "${APK_BASENAME_PREFIX}.apk" > checksums-sha256.txt); then
exit_on_error "Generate checksums-sha256.txt file failed for '$RELEASE_VERSION_NAME' release."
fi
echo "checksums-sha256.txt:"$'\n```\n'"$(cat "$APK_DIR_PATH/checksums-sha256.txt")"$'\n```'

- name: Upload files to action
uses: actions/upload-artifact@v4
with:
name: ${{ env.APK_BASENAME_PREFIX }}
path: |
${{ env.APK_DIR_PATH }}/${{ env.APK_BASENAME_PREFIX }}.apk
${{ env.APK_DIR_PATH }}/checksums-sha256.txt
${{ env.APK_DIR_PATH }}/output-metadata.json
64 changes: 64 additions & 0 deletions .github/workflows/github_release_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: GitHub Release Build

on:
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_REF }}

- name: Build and upload files to release
shell: bash {0}
run: |
exit_on_error() {
echo "$1"
echo "Deleting '$RELEASE_VERSION_NAME' release and '$GITHUB_REF' tag"
hub release delete "$RELEASE_VERSION_NAME"
git push --delete origin "$GITHUB_REF"
exit 1
}

echo "Setting vars"
RELEASE_VERSION_NAME="${GITHUB_REF/refs\/tags\//}"
if ! printf "%s" "${RELEASE_VERSION_NAME/v/}" | grep -qP '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'; then
exit_on_error "The release version '${RELEASE_VERSION_NAME/v/}' is not a valid version as per semantic version '2.0.0' spec in the format 'major.minor.patch(-prerelease)(+buildmetadata)'. https://semver.org/spec/v2.0.0.html."
fi

APK_DIR_PATH="./app/build/outputs/apk/debug"
APK_VERSION_TAG="$RELEASE_VERSION_NAME+github.debug"
APK_BASENAME_PREFIX="termux-api-app_$APK_VERSION_TAG"

echo "Building APK file for '$RELEASE_VERSION_NAME' release with '$APK_VERSION_TAG' tag"
export TERMUX_API_APP__BUILD__APK_VERSION_TAG="$APK_VERSION_TAG" # Used by app/build.gradle
if ! ./gradlew assembleDebug; then
exit_on_error "Build failed for '$RELEASE_VERSION_NAME' release with '$APK_VERSION_TAG' tag."
fi

echo "Validating APK file"
if ! test -f "$APK_DIR_PATH/${APK_BASENAME_PREFIX}.apk"; then
files_found="$(ls "$APK_DIR_PATH")"
exit_on_error "Failed to find built APK file at '$APK_DIR_PATH/${APK_BASENAME_PREFIX}.apk'. Files found: "$'\n'"$files_found"
fi

echo "Generating checksums-sha256.txt file"
if ! (cd "$APK_DIR_PATH"; sha256sum "${APK_BASENAME_PREFIX}.apk" > checksums-sha256.txt); then
exit_on_error "Generate checksums-sha256.txt file failed for '$RELEASE_VERSION_NAME' release."
fi
echo "checksums-sha256.txt:"$'\n```\n'"$(cat "$APK_DIR_PATH/checksums-sha256.txt")"$'\n```'

echo "Uploading files to release"
if ! gh release upload "$RELEASE_VERSION_NAME" \
"$APK_DIR_PATH/${APK_BASENAME_PREFIX}.apk" \
"$APK_DIR_PATH/checksums-sha256.txt" \
; then
exit_on_error "Upload files to release failed for '$RELEASE_VERSION_NAME' release."
fi
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# .gitignore from https://gist.github.com/iainconnor/8605514:

# Built application files
build/
release/
*.apk
*.so
.externalNativeBuild
.cxx
*.zip

# Crashlytics configuations
com_crashlytics_export_strings.xml
Expand All @@ -27,3 +31,6 @@ local.properties
.Trashes
ehthumbs.db
Thumbs.db

# Temp/backup files
*~
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ allowed to call the API methods in this app).

## Installation

Latest version is `v0.53.0`.

Termux:API application can be obtained from [F-Droid](https://f-droid.org/en/packages/com.termux.api/).

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](https://github.com/termux/termux-api/actions)
from one of the workflow runs listed on [Github Actions](https://github.com/termux/termux-api/actions/workflows/github_action_build.yml?query=branch%3Amaster+event%3Apush)
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.
all currently installed plugins. Check https://github.com/termux/termux-app#Installation for more info.

## License

Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check https://termux.dev/security for info on Termux security policies and how to report vulnerabilities.
79 changes: 63 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
namespace "com.termux.api"

compileSdk project.properties.compileSdkVersion.toInteger()
def appVersionName = System.getenv("TERMUX_API_APP__BUILD__APP_VERSION_NAME") ?: ""
def apkVersionTag = System.getenv("TERMUX_API_APP__BUILD__APK_VERSION_TAG") ?: ""

defaultConfig {
applicationId "com.termux.api"
minSdkVersion 24
targetSdkVersion 28
versionCode 48
versionName "0.48"
minSdk project.properties.minSdkVersion.toInteger()
targetSdk project.properties.targetSdkVersion.toInteger()
versionCode 1002
versionName "0.53.0"

if (appVersionName) versionName = appVersionName
validateVersionName(versionName)

manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.termux"
manifestPlaceholders.TERMUX_APP_NAME = "Termux"
manifestPlaceholders.TERMUX_API_APP_NAME = "Termux:API"
}

signingConfigs {
debug {
storeFile file('dev_keystore.jks')
storeFile file('testkey_untrusted.jks')
keyAlias 'alias'
storePassword 'xrj45yWGLbsO7W0v'
keyPassword 'xrj45yWGLbsO7W0v'
Expand All @@ -22,8 +33,9 @@ android {

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
minifyEnabled true
shrinkResources false // Reproducible builds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}

debug {
Expand All @@ -32,19 +44,54 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true

sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = new File("termux-api-app_" +
(apkVersionTag ? apkVersionTag : "v" + versionName + "+" + variant.buildType.name) + ".apk")
}
}

packagingOptions {
// Remove terminal-emulator and termux-shared JNI libs added via termux-shared dependency
exclude "lib/*/libtermux.so"
exclude "lib/*/liblocal-socket.so"
}
}

dependencies {
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.biometric:biometric:1.0.0-alpha04'
implementation "androidx.media:media:1.1.0"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"

implementation "com.google.android.material:material:1.12.0"
implementation "androidx.biometric:biometric:1.2.0-alpha05"
implementation "androidx.media:media:1.7.0"
implementation "androidx.preference:preference:1.2.1"

implementation "com.termux.termux-app:termux-shared:8aca6dbbf4"
// Use if below libraries are published locally by termux-app with `./gradlew publishReleasePublicationToMavenLocal` and used with `mavenLocal()`.
// If updates are done, republish there and sync project with gradle files here
// https://github.com/termux/termux-app/wiki/Termux-Libraries
//implementation "com.termux:termux-shared:0.118.0"

implementation "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava"
}

task versionName {
doLast {
print android.defaultConfig.versionName
}
doLast {
print android.defaultConfig.versionName
}
}

@SuppressWarnings("UnnecessaryQualifiedReference")
static def validateVersionName(String versionName) {
// https://semver.org/spec/v2.0.0.html#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
// ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
if (!java.util.regex.Pattern.matches("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?\$", versionName))
throw new GradleException("The versionName '" + versionName + "' is not a valid version as per semantic version '2.0.0' spec in the format 'major.minor.patch(-prerelease)(+buildmetadata)'. https://semver.org/spec/v2.0.0.html.")
}
10 changes: 10 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

-dontobfuscate
Loading