termux

Table of Contents

1. termux

1.1. TICKLER Termux won’t work on Android 10   track

https://github.com/termux/termux-app/issues/1072
https://github.com/termux/termux-app/tree/android-10
https://github.com/termux/termux-app/issues/2155

While i understand the developers concern about google maintaining old API compatibility, I don’t think google is going to drop API 28 compatibility anytime soon
take Google Chrome for example

Chrome 43.0.2357 (2015) No longer supports Android 4.
Chrome 72.0.3626 (2019) No longer supports Android 4.1-4.3
Chrome 83.0.4103 (2020) No longer supports Android 4.4

so far, the minimum API is 23 and even if you install API 17 for example, it will only give a useless warning asking the developer to update the app.

So if google really starts deprecating API 23 by year 2025
termux will still be alive until 2030, which is a lot of time from now.

1.1.1. Termux and Android 10 | Hacker News

1.1.1.1. Impact of Android 10 on Termux usability is already old news. What worries me m… | Hacker News

Impact of Android 10 on Termux usability is already old news.
What worries me more is behaviour of Termux developers. They make dubious claims and effectively sabotage their own application (more on that below).
The solution to Android 10 problems — a software wrapper called “proot” [1] — has already been found. That solution would allow to keep all of Termux functionality and preserve existing package managers (such as apt). Proot allows Android user to compile C code in Termux (which they currently can do) and does not require major changes to Termux itself.
Termux developers refused to adopt proot as solution and even removed it’s mention from their wiki on Github. Instead they are insisting that all Termux packages should be distributed in Android apk files, published on Google Play. That “solution” has major usability issues, does not scale (it uses shoddy Android PackageManager to track all Termux packages) and would prevent users from using Gcc and other compilers in Termux. The only claimed upside of using apk files is that it would better comply with Google’s policies.
Termux developers justify their actions by following arguments:

  1. Termux packages require a lot of bandwidth to host, and Termux does not have money to pay for their mirrors; hosting packages in Google Play would be preferable. That statement is nonsense — even fringe Linux distributions like Artix can find FREE mirrors, willing to host their packages. This is usually done by contacting curators of existing servers, that host Linux packages, and asking them for support. Termux is more popular than some of Linux distributions, but it does not look like Termux devs even TRY to do that — they apparently just sit on their hands, occasionally begging their sole mirror provider (JFrog) for more bandwidth.
  2. Termux currently does not comply with Google’s policy and it’s developers are afraid, that this will result in removal from Google Play. They are technically right, but they are making mistake by downgrading experience of their app in attempt to pacify Google Play censors. They are making even bigger mistake by displaying guilt about that — Termux does nothing wrong, and the display of guilt is a better excuse to punish them than their actions.

There are already several “Linux-like environments” on Android that use proot. GNUroot, UserLAnd, Linux Deploy, AnLinux, Androlinux, etc.
Some of them literally just package existing Linux distros such as Debian (e.g. GNUroot) in a way thatis much more compatible and easier to mantain than something ad-hoc such as Termux.
Termux became popular precisely because they did NOT use proot. Proot is great in theory – using ptrace and hooks in order to simulate a more Linux-like environment, ala Cygwin. In practice, it is just goddamn slow, and ptrace just introduce MORE compatibility issues than the native Android does.
Termux had a shitton of disadvantages compared to the proot-based distributions, such as for example the fact that every package had to be patched in order to use the non-standard Android directory structure, making compatibility with native Linux binaries utright difficult (not even ld is where it should be) and reusing Linux distro scripts impossible. But still it became the most popular because proot is just worse.
No wonder they completely ignore all requests to use proot.
If you want to use proot, there is no point at all for Termux to exist (or at least, for Termux the distro; the terminal emulator itself may still be interesting, your mileage may vary). There’s little point remaining for patching packages for Termux; you can use Debian packages, so just go and use Debian.
And to to top it off, what if a future Android breaks proot, which looks likely?

1.1.2. Here’s why the Termux app is no longer getting updates on Google Play

It doesn’t affect the FDroid build as it’s not enforcing sdkVersion 29

1.1.3. PSA: Android Q blocks executing binaries in your apps private data directory : androiddev

So what termux has to do is, ship all of the packages inside a single apk. That’s what you are referring to? This will lead to enormous size of apk file and Google won’t allow such a big apk file on their platform.

No, that’s not what I said. I never said there has to be a single apk. In fact, I explicitly stated the solution would be shipping bundles of packages through multiple apps. They can split up these packages as much or as little as they want but it would be impractical to have thousands of them. It would be more convenient to have related packages bundled together. It will use more space, since packages won’t be nearly as granular, but it can work. The packages can use symlinks to the executables and native libraries in the native library directory.

1.3. terminal app capable of running small scripts

1.3.1. cronjob is not reliable

Sometimes it runs, sometimes it does not. Depends a lot on battery settings

1.4. Intents and Hooks - Termux Wiki

Permite lanzar cosas en base a una url!! También compartir archivos

  • Para compartir archivos, puedo hacerme un scriptillo para que elija si lo mando a roam/ donde será público, o a Documents/org o lo que sea donde por defecto no es público

1.5. calling another app

1.5.1. Call orgzly

am startservice -a android.intent.action.MAIN -n com.orgzly/com.orgzly.android.sync.SyncService

1.5.2. Taking a picture

am start -a android.media.action.IMAGE_CAPTURE --eu output "file:///storage/emulated/0/IMG_1.jpg"

1.5.3. Setup a crontab

https://www.reddit.com/r/termux/comments/i27szk/how_do_i_crontab_on_termux/

pkg install cronie termux-services
sv-enable crond
crontab -e

Unreliable, doesn’t fire up consistently →

1.5.4. orgzly note search

am start -a android.intent.action.MAIN -n com.orgzly/com.orgzly.android.ui.main.MainActivity --es "com.orgzly.intent.extra.QUERY_STRING" "search term" --activity-clear-task

1.5.5. Samsung | Don’t kill my app! Termux is killed, particularly on Samsung Phones

1.5.6. Common Intents  |  Android Developers

1.5.6.1. Common Intents and NFC Intents

/home/julian/Android/Sdk/platforms/android-30/data → txt with all the intents
https://stackoverflow.com/questions/8971160/what-is-the-exhaustive-list-of-all-android-intent-action-actions-available-in → to get the NFC intents
ACTION_NDEF_DISCOVERED, ACTION_TECH_DISCOVERED
https://developer.android.com/guide/topics/connectivity/nfc/nfc

1.5.7. DONE Launch activity when termux is closed on Android 10

Using Termux:Float works sometimes
I still get manual sync notifications, doesn’t work when the phone is locked
https://stackoverflow.com/questions/60767216/how-to-trigger-a-launch-activity-intent-when-my-app-is-closed-on-android-10-q
Then syncs wouldn’t have to be manual

1.5.7.1. DONE TermuxAm issue to open activity when termux is closed
1.5.7.2. CANCELLED Rootear el teléfono
1.5.7.3. DONE Otras soluciones menos drásticas

https://www.reddit.com/r/tasker/comments/dl47bt/tasker_android_10_starting_activities_without/

  • Draw over other apps
    Parece ser que marcando esta para termux, ya puede disparar notificaciones desde atrás
  • Notification Access
  • Accessibility Access
  • Device Admin

1.5.8. Link para compartir por whatsapp

1.5.8.1. Servidor que lanze intents

Me ahorra batería en Android. Puedo tener un fallback que si no está conectado entonces lanzo un servidor local en el teléfono (porque si no tendría el problema de que si no tengo conexión pierdo acceso a ciertos tipos de links)
Puedo lanzar cosas con am desde un servidor remoto??

1.6. NFC? · Issue #86 · termux/termux-api

https://github.com/termux/termux-api/issues/86
Parece que si quiero esto, voy a tener que implementarlo yo → Common Intents and NFC Intents
NfcActivity.java → lo implementaron en diciembre 2020, sólo funciona con tarjetas NDEF

1.7. Shortcuts

1.7.1. Ctrl+Alt+C Open new session

1.7.2. Ctrl+Alt+N, Ctrl+Alt+P → Next, Previous Session

1.8. Media button interface compatible with PineTime??

Not visible from PineTime:

termux-notification --type media --media-next 'bash -c "echo $(date +%H:%M:%S) next >> log.txt"' --media-pause 'bash -c "echo $(date +%H:%M:%S) pause >> log.txt"' --media-play 'bash -c "echo $(date +%H:%M:%S) play >> log.txt"' --media-previous 'bash -c "echo $(date +%H:%M:%S) previous >> log.txt"'

1.9. DONE Measure battery drain of my termux setup

It seems pretty standard, reduces Syncthing battery usage (sync each 1h instead of 5m), orgzly/termux is on par with spotify for ~1h of music
15:20 52% w/spotify ~1h
Still, I would only activate termux when necessary, and frequent syncs always comes with battery drain

1.10. DONE Notificación termux permanente que te ponga el estado de la sync y te permita activarla y desactivarla

Esto es casi lo mismo que pillarla por sync…
una cosa chula es pillarla por la notif de syncthing

1.11. termux-notification-list

https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/service/notification/StatusBarNotification.java → key format
user.getIdentifier() + “|” + pkg + “|” + id + “|” + tag + “|” + uid;

Author: Julian Lopez Carballal

Created: 2024-09-16 Mon 06:43