2021-03-08 10:09:22 +00:00
package com.termux.app ;
import android.annotation.SuppressLint ;
import java.io.File ;
2021-03-11 15:11:59 +00:00
/ *
2021-03-18 02:15:00 +00:00
* Version : v0 . 8 . 0
2021-03-11 15:11:59 +00:00
*
* Changelog
*
* - 0 . 1 . 0 ( 2021 - 03 - 08 )
* - Initial Release .
*
* - 0 . 2 . 0 ( 2021 - 03 - 11 )
* - Added ` _DIR ` and ` _FILE ` substrings to paths .
2021-03-15 22:59:54 +00:00
* - Added ` INTERNAL_PRIVATE_APP_DATA_DIR * ` , ` TERMUX_CACHE_DIR * ` , ` TERMUX_DATABASES_DIR * ` ,
* ` TERMUX_SHARED_PREFERENCES_DIR * ` , ` TERMUX_BIN_PREFIX_DIR * ` , ` TERMUX_ETC_DIR * ` ,
* ` TERMUX_INCLUDE_DIR * ` , ` TERMUX_LIB_DIR * ` , ` TERMUX_LIBEXEC_DIR * ` , ` TERMUX_SHARE_DIR * ` ,
* ` TERMUX_TMP_DIR * ` , ` TERMUX_VAR_DIR * ` , ` TERMUX_STAGING_PREFIX_DIR * ` ,
* ` TERMUX_STORAGE_HOME_DIR * ` , ` TERMUX_DEFAULT_PREFERENCES_FILE_BASENAME * ` ,
* ` TERMUX_DEFAULT_PREFERENCES_FILE ` .
2021-03-11 15:11:59 +00:00
* - Renamed ` DATA_HOME_PATH ` to ` TERMUX_DATA_HOME_DIR_PATH ` .
* - Renamed ` CONFIG_HOME_PATH ` to ` TERMUX_CONFIG_HOME_DIR_PATH ` .
* - Updated javadocs and spacing .
*
2021-03-12 00:53:10 +00:00
* - 0 . 3 . 0 ( 2021 - 03 - 12 )
2021-03-15 22:59:54 +00:00
* - Remove ` TERMUX_CACHE_DIR_PATH * ` , ` TERMUX_DATABASES_DIR_PATH * ` ,
* ` TERMUX_SHARED_PREFERENCES_DIR_PATH * ` since they may not be consistent on all devices .
2021-03-12 00:53:10 +00:00
* - Renamed ` TERMUX_DEFAULT_PREFERENCES_FILE_BASENAME ` to
* ` TERMUX_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION ` . This should be used for
* accessing shared preferences between Termux app and its plugins if ever needed by first
* getting shared package context with { @link Context . createPackageContext ( String , int } ) .
*
2021-03-15 22:59:54 +00:00
* - 0 . 4 . 0 ( 2021 - 03 - 16 )
* - Added ` BROADCAST_TERMUX_OPENED ` ,
* ` TERMUX_API_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION `
* ` TERMUX_BOOT_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION ` ,
* ` TERMUX_FLOAT_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION ` ,
* ` TERMUX_STYLING_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION ` ,
* ` TERMUX_TASKER_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION ` ,
* ` TERMUX_WIDGET_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION ` .
*
2021-03-16 14:07:54 +00:00
* - 0 . 5 . 0 ( 2021 - 03 - 16 )
2021-03-16 20:13:44 +00:00
* - Renamed " Termux Plugin app " labels to " Termux Tasker app " .
2021-03-16 16:29:25 +00:00
*
* - 0 . 6 . 0 ( 2021 - 03 - 16 )
2021-03-16 20:13:44 +00:00
* - Added ` TERMUX_FILE_SHARE_URI_AUTHORITY ` .
*
* - 0 . 7 . 0 ( 2021 - 03 - 17 )
* - Fixed javadocs .
2021-03-18 02:15:00 +00:00
*
* - 0 . 8 . 0 ( 2021 - 03 - 18 )
* - Fixed Intent extra types javadocs .
* - Added ` EXTRA_PENDING_INTENT ` , ` EXTRA_RESULT_BUNDLE ` ,
* ` EXTRA_STDOUT ` , ` EXTRA_STDERR ` , ` EXTRA_EXIT_CODE ` , ` EXTRA_ERR ` , ` EXTRA_ERRMSG ` .
2021-03-11 15:11:59 +00:00
* /
2021-03-08 10:09:22 +00:00
/ * *
* A class that defines shared constants of the Termux app and its plugins .
* This class will be hosted by termux - app and should be imported by other termux plugin apps as is
* instead of copying constants to random classes . The 3rd party apps can also import it for
2021-03-11 15:11:59 +00:00
* interacting with termux apps . If changes are made to this file , increment the version number
* and add an entry in the Changelog section above .
2021-03-08 10:09:22 +00:00
*
2021-03-16 20:13:44 +00:00
* Termux app default package name is " com.termux " and is used in { @link # TERMUX_PREFIX_DIR_PATH } .
* The binaries compiled for termux have { @link # TERMUX_PREFIX_DIR_PATH } hardcoded in them but it
* can be changed during compilation .
2021-03-08 10:09:22 +00:00
*
2021-03-16 20:13:44 +00:00
* The { @link # TERMUX_PACKAGE_NAME } must be the same as the applicationId of termux - app build . gradle
* since its also used by { @link # TERMUX_FILES_DIR_PATH } .
* If { @link # TERMUX_PACKAGE_NAME } is changed , then binaries , specially used in bootstrap need to be
* compiled appropriately . Check https : //github.com/termux/termux-packages/wiki/Building-packages
* for more info .
2021-03-08 10:09:22 +00:00
*
* Ideally the only places where changes should be required if changing package name are the following :
2021-03-16 20:13:44 +00:00
* - The { @link # TERMUX_PACKAGE_NAME } in { @link TermuxConstants } .
2021-03-08 10:09:22 +00:00
* - The " applicationId " in " build.gradle " . This is package name that android and app stores will
* use and is also the final package name stored in " AndroidManifest.xml " .
2021-03-16 20:13:44 +00:00
* - The " manifestPlaceholders " values for { @link # TERMUX_PACKAGE_NAME } and * _APP_NAME in " build.gradle " .
* - The " ENTITY " values for { @link # TERMUX_PACKAGE_NAME } and * _APP_NAME in " strings.xml " .
2021-03-08 10:09:22 +00:00
* - The " shortcut.xml " files like in termux - app since dynamic variables don ' t work in it .
* - Optionally the " package " in " AndroidManifest.xml " if modifying project structure . This is
* package name for java classes project structure and is prefixed if activity and service
* names use dot ( . ) notation .
2021-03-16 20:13:44 +00:00
* - Optionally the * _PATH variables in { @link TermuxConstants } containing the string " termux " .
2021-03-08 10:09:22 +00:00
*
* Check https : //developer.android.com/studio/build/application-id for info on "package" in
* " AndroidManifest.xml " and " applicationId " in " build.gradle " .
*
2021-03-16 20:13:44 +00:00
* { @link # TERMUX_PACKAGE_NAME } must be used in source code of Termux app and its plugins instead of
* hardcoded " com.termux " paths .
2021-03-08 10:09:22 +00:00
* /
public final class TermuxConstants {
2021-03-11 15:11:59 +00:00
/ *
* Termux and its plugin app and package names.
2021-03-08 10:09:22 +00:00
* /
2021-03-11 15:11:59 +00:00
/** Termux app name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_APP_NAME = " Termux " ; // Default: "Termux"
2021-03-11 15:11:59 +00:00
/** Termux app package name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_PACKAGE_NAME = " com.termux " ; // Default: "com.termux"
2021-03-11 15:11:59 +00:00
/** Termux API app name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_API_APP_NAME = " Termux:API " ; // Default: "Termux:API"
2021-03-11 15:11:59 +00:00
/** Termux API app package name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_API_PACKAGE_NAME = TERMUX_PACKAGE_NAME + " .api " ; // Default: "com.termux.api"
2021-03-11 15:11:59 +00:00
/** Termux Boot app name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_BOOT_APP_NAME = " Termux:Boot " ; // Default: "Termux:Boot"
2021-03-11 15:11:59 +00:00
/** Termux Boot app package name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_BOOT_PACKAGE_NAME = TERMUX_PACKAGE_NAME + " .boot " ; // Default: "com.termux.boot"
2021-03-11 15:11:59 +00:00
/** Termux Float app name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_FLOAT_APP_NAME = " Termux:Float " ; // Default: "Termux:Float"
2021-03-11 15:11:59 +00:00
/** Termux Float app package name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_FLOAT_PACKAGE_NAME = TERMUX_PACKAGE_NAME + " .window " ; // Default: "com.termux.window"
2021-03-11 15:11:59 +00:00
/** Termux Styling app name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_STYLING_APP_NAME = " Termux:Styling " ; // Default: "Termux:Styling"
2021-03-11 15:11:59 +00:00
/** Termux Styling app package name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_STYLING_PACKAGE_NAME = TERMUX_PACKAGE_NAME + " .styling " ; // Default: "com.termux.styling"
2021-03-11 15:11:59 +00:00
2021-03-16 14:07:54 +00:00
/** Termux Tasker app name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_TASKER_APP_NAME = " Termux:Tasker " ; // Default: "Termux:Tasker"
2021-03-16 14:07:54 +00:00
/** Termux Tasker app package name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_TASKER_PACKAGE_NAME = TERMUX_PACKAGE_NAME + " .tasker " ; // Default: "com.termux.tasker"
2021-03-11 15:11:59 +00:00
/** Termux Widget app name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_WIDGET_APP_NAME = " Termux:Widget " ; // Default: "Termux:Widget"
2021-03-11 15:11:59 +00:00
/** Termux Widget app package name */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_WIDGET_PACKAGE_NAME = TERMUX_PACKAGE_NAME + " .widget " ; // Default: "com.termux.widget"
2021-03-11 15:11:59 +00:00
/ *
* Termux app core directory paths .
2021-03-08 10:09:22 +00:00
* /
2021-03-11 15:11:59 +00:00
/** Termux app internal private app data directory path */
2021-03-08 10:09:22 +00:00
@SuppressLint ( " SdCardPath " )
2021-03-11 15:11:59 +00:00
public static final String INTERNAL_PRIVATE_APP_DATA_DIR_PATH = " /data/data/ " + TERMUX_PACKAGE_NAME ; // Default: "/data/data/com.termux"
/** Termux app internal private app data directory */
public static final File INTERNAL_PRIVATE_APP_DATA_DIR = new File ( INTERNAL_PRIVATE_APP_DATA_DIR_PATH ) ;
2021-03-08 10:09:22 +00:00
2021-03-11 15:11:59 +00:00
/** Termux app Files directory path */
public static final String TERMUX_FILES_DIR_PATH = INTERNAL_PRIVATE_APP_DATA_DIR_PATH + " /files " ; // Default: "/data/data/com.termux/files"
/** Termux app Files directory */
public static final File TERMUX_FILES_DIR = new File ( TERMUX_FILES_DIR_PATH ) ;
/** Termux app $PREFIX directory path */
public static final String TERMUX_PREFIX_DIR_PATH = TERMUX_FILES_DIR_PATH + " /usr " ; // Default: "/data/data/com.termux/files/usr"
/** Termux app $PREFIX directory */
public static final File TERMUX_PREFIX_DIR = new File ( TERMUX_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/bin directory path */
public static final String TERMUX_BIN_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /bin " ; // Default: "/data/data/com.termux/files/usr/bin"
/** Termux app $PREFIX/bin directory */
public static final File TERMUX_BIN_PREFIX_DIR = new File ( TERMUX_BIN_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/etc directory path */
public static final String TERMUX_ETC_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /etc " ; // Default: "/data/data/com.termux/files/usr/etc"
/** Termux app $PREFIX/etc directory */
public static final File TERMUX_ETC_DIR = new File ( TERMUX_ETC_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/include directory path */
public static final String TERMUX_INCLUDE_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /include " ; // Default: "/data/data/com.termux/files/usr/include"
/** Termux app $PREFIX/include directory */
public static final File TERMUX_INCLUDE_DIR = new File ( TERMUX_INCLUDE_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/lib directory path */
public static final String TERMUX_LIB_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /lib " ; // Default: "/data/data/com.termux/files/usr/lib"
/** Termux app $PREFIX/lib directory */
public static final File TERMUX_LIB_DIR = new File ( TERMUX_LIB_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/libexec directory path */
public static final String TERMUX_LIBEXEC_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /libexec " ; // Default: "/data/data/com.termux/files/usr/libexec"
/** Termux app $PREFIX/libexec directory */
public static final File TERMUX_LIBEXEC_DIR = new File ( TERMUX_LIBEXEC_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/share directory path */
public static final String TERMUX_SHARE_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /share " ; // Default: "/data/data/com.termux/files/usr/share"
/** Termux app $PREFIX/share directory */
public static final File TERMUX_SHARE_DIR = new File ( TERMUX_SHARE_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/tmp and $TMP directory path */
public static final String TERMUX_TMP_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /tmp " ; // Default: "/data/data/com.termux/files/usr/tmp"
/** Termux app $PREFIX/tmp and $TMP directory */
public static final File TERMUX_TMP_DIR = new File ( TERMUX_TMP_PREFIX_DIR_PATH ) ;
/** Termux app $PREFIX/var directory path */
public static final String TERMUX_VAR_PREFIX_DIR_PATH = TERMUX_PREFIX_DIR_PATH + " /var " ; // Default: "/data/data/com.termux/files/usr/var"
/** Termux app $PREFIX/var directory */
public static final File TERMUX_VAR_DIR = new File ( TERMUX_VAR_PREFIX_DIR_PATH ) ;
/** Termux app usr-staging directory path */
public static final String TERMUX_STAGING_PREFIX_DIR_PATH = TERMUX_FILES_DIR_PATH + " /usr-staging " ; // Default: "/data/data/com.termux/files/usr-staging"
/** Termux app usr-staging directory */
public static final File TERMUX_STAGING_PREFIX_DIR = new File ( TERMUX_STAGING_PREFIX_DIR_PATH ) ;
/** Termux app $HOME directory path */
public static final String TERMUX_HOME_DIR_PATH = TERMUX_FILES_DIR_PATH + " /home " ; // Default: "/data/data/com.termux/files/home"
/** Termux app $HOME directory */
public static final File TERMUX_HOME_DIR = new File ( TERMUX_HOME_DIR_PATH ) ;
/** Termux app config home directory path */
public static final String TERMUX_CONFIG_HOME_DIR_PATH = TERMUX_HOME_DIR_PATH + " /.config/termux " ; // Default: "/data/data/com.termux/files/home/.config/termux"
/** Termux app config home directory */
public static final File TERMUX_CONFIG_HOME_DIR = new File ( TERMUX_CONFIG_HOME_DIR_PATH ) ;
/** Termux app data home directory path */
public static final String TERMUX_DATA_HOME_DIR_PATH = TERMUX_HOME_DIR_PATH + " /.termux " ; // Default: "/data/data/com.termux/files/home/.termux"
/** Termux app data home directory */
public static final File TERMUX_DATA_HOME_DIR = new File ( TERMUX_DATA_HOME_DIR_PATH ) ;
/** Termux app storage home directory path */
public static final String TERMUX_STORAGE_HOME_DIR_PATH = TERMUX_HOME_DIR_PATH + " /storage " ; // Default: "/data/data/com.termux/files/home/storage"
/** Termux app storage home directory */
public static final File TERMUX_STORAGE_HOME_DIR = new File ( TERMUX_STORAGE_HOME_DIR_PATH ) ;
/ *
2021-03-15 22:59:54 +00:00
* Termux app and plugin preferences and properties file paths .
2021-03-08 10:09:22 +00:00
* /
2021-03-12 00:53:10 +00:00
/* Termux app default SharedPreferences file basename without extension */
public static final String TERMUX_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION = TERMUX_PACKAGE_NAME + " _preferences " ; // Default: "com.termux_preferences"
2021-03-08 10:09:22 +00:00
2021-03-15 22:59:54 +00:00
/* Termux API app default SharedPreferences file basename without extension */
public static final String TERMUX_API_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION = TERMUX_API_PACKAGE_NAME + " _preferences " ; // Default: "com.termux.api_preferences"
/* Termux Boot app default SharedPreferences file basename without extension */
public static final String TERMUX_BOOT_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION = TERMUX_BOOT_PACKAGE_NAME + " _preferences " ; // Default: "com.termux.boot_preferences"
/* Termux Float app default SharedPreferences file basename without extension */
public static final String TERMUX_FLOAT_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION = TERMUX_FLOAT_PACKAGE_NAME + " _preferences " ; // Default: "com.termux.window_preferences"
/* Termux Styling app default SharedPreferences file basename without extension */
public static final String TERMUX_STYLING_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION = TERMUX_STYLING_PACKAGE_NAME + " _preferences " ; // Default: "com.termux.styling_preferences"
2021-03-16 14:07:54 +00:00
/* Termux Tasker app default SharedPreferences file basename without extension */
2021-03-15 22:59:54 +00:00
public static final String TERMUX_TASKER_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION = TERMUX_TASKER_PACKAGE_NAME + " _preferences " ; // Default: "com.termux.tasker_preferences"
/* Termux Widget app default SharedPreferences file basename without extension */
public static final String TERMUX_WIDGET_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION = TERMUX_WIDGET_PACKAGE_NAME + " _preferences " ; // Default: "com.termux.widget_preferences"
2021-03-08 10:09:22 +00:00
2021-03-11 15:11:59 +00:00
/* Termux app termux.properties primary file path */
public static final String TERMUX_PROPERTIES_PRIMARY_FILE_PATH = TERMUX_DATA_HOME_DIR_PATH + " /termux.properties " ; // Default: "/data/data/com.termux/files/home/.termux/termux.properties"
/* Termux app termux.properties primary file */
public static final File TERMUX_PROPERTIES_PRIMARY_FILE = new File ( TERMUX_PROPERTIES_PRIMARY_FILE_PATH ) ;
2021-03-08 10:09:22 +00:00
2021-03-11 15:11:59 +00:00
/* Termux app termux.properties secondary file path */
public static final String TERMUX_PROPERTIES_SECONDARY_FILE_PATH = TERMUX_CONFIG_HOME_DIR_PATH + " /termux.properties " ; // Default: "/data/data/com.termux/files/home/.config/termux/termux.properties"
/* Termux app termux.properties secondary file */
public static final File TERMUX_PROPERTIES_SECONDARY_FILE = new File ( TERMUX_PROPERTIES_SECONDARY_FILE_PATH ) ;
2021-03-08 10:09:22 +00:00
2021-03-15 22:59:54 +00:00
2021-03-11 15:11:59 +00:00
/* Termux app and Termux:Styling colors.properties file path */
public static final String TERMUX_COLOR_PROPERTIES_FILE_PATH = TERMUX_DATA_HOME_DIR_PATH + " /colors.properties " ; // Default: "/data/data/com.termux/files/home/.termux/colors.properties"
/* Termux app and Termux:Styling colors.properties file */
public static final File TERMUX_COLOR_PROPERTIES_FILE = new File ( TERMUX_COLOR_PROPERTIES_FILE_PATH ) ;
2021-03-08 10:09:22 +00:00
2021-03-11 15:11:59 +00:00
/* Termux app and Termux:Styling font.ttf file path */
public static final String TERMUX_FONT_FILE_PATH = TERMUX_DATA_HOME_DIR_PATH + " /font.ttf " ; // Default: "/data/data/com.termux/files/home/.termux/font.ttf"
/* Termux app and Termux:Styling font.ttf file */
public static final File TERMUX_FONT_FILE = new File ( TERMUX_FONT_FILE_PATH ) ;
2021-03-08 10:09:22 +00:00
2021-03-11 15:11:59 +00:00
/ *
* Termux app plugin specific paths .
2021-03-08 10:09:22 +00:00
* /
2021-03-11 15:11:59 +00:00
/* Termux app directory path to store scripts to be run at boot by Termux:Boot */
public static final String TERMUX_BOOT_SCRIPTS_DIR_PATH = TERMUX_DATA_HOME_DIR_PATH + " /boot " ; // Default: "/data/data/com.termux/files/home/.termux/boot"
/* Termux app directory to store scripts to be run at boot by Termux:Boot */
public static final File TERMUX_BOOT_SCRIPTS_DIR = new File ( TERMUX_BOOT_SCRIPTS_DIR_PATH ) ;
/* Termux app directory path to store foreground scripts that can be run by the termux launcher widget provided by Termux:Widget */
public static final String TERMUX_SHORTCUT_SCRIPTS_DIR_PATH = TERMUX_DATA_HOME_DIR_PATH + " /shortcuts " ; // Default: "/data/data/com.termux/files/home/.termux/shortcuts"
/* Termux app directory to store foreground scripts that can be run by the termux launcher widget provided by Termux:Widget */
public static final File TERMUX_SHORTCUT_SCRIPTS_DIR = new File ( TERMUX_SHORTCUT_SCRIPTS_DIR_PATH ) ;
2021-03-08 10:09:22 +00:00
2021-03-11 15:11:59 +00:00
/* Termux app directory path to store background scripts that can be run by the termux launcher widget provided by Termux:Widget */
public static final String TERMUX_SHORTCUT_TASKS_SCRIPTS_DIR_PATH = TERMUX_DATA_HOME_DIR_PATH + " /shortcuts/tasks " ; // Default: "/data/data/com.termux/files/home/.termux/shortcuts/tasks"
/* Termux app directory to store background scripts that can be run by the termux launcher widget provided by Termux:Widget */
public static final File TERMUX_SHORTCUT_TASKS_SCRIPTS_DIR = new File ( TERMUX_SHORTCUT_TASKS_SCRIPTS_DIR_PATH ) ;
2021-03-08 10:09:22 +00:00
2021-03-11 15:11:59 +00:00
/* Termux app directory path to store scripts to be run by 3rd party twofortyfouram locale plugin host apps like Tasker app via the Termux:Tasker plugin client */
public static final String TERMUX_TASKER_SCRIPTS_DIR_PATH = TERMUX_DATA_HOME_DIR_PATH + " /tasker " ; // Default: "/data/data/com.termux/files/home/.termux/tasker"
/* Termux app directory to store scripts to be run by 3rd party twofortyfouram locale plugin host apps like Tasker app via the Termux:Tasker plugin client */
public static final File TERMUX_TASKER_SCRIPTS_DIR = new File ( TERMUX_TASKER_SCRIPTS_DIR_PATH ) ;
/ *
* Termux app and plugins miscellaneous variables .
* /
/* Android OS permission declared by Termux app in AndroidManifest.xml which can be requested by 3rd party apps to run various commands in Termux app context */
2021-03-08 10:09:22 +00:00
public static final String PERMISSION_RUN_COMMAND = TERMUX_PACKAGE_NAME + " .permission.RUN_COMMAND " ; // Default: "com.termux.permission.RUN_COMMAND"
2021-03-11 15:11:59 +00:00
/* Termux property defined in termux.properties file as a secondary check to PERMISSION_RUN_COMMAND to allow 3rd party apps to run various commands in Termux app context */
2021-03-08 10:09:22 +00:00
public static final String PROP_ALLOW_EXTERNAL_APPS = " allow-external-apps " ; // Default: "allow-external-apps"
2021-03-11 15:11:59 +00:00
/* Default value for {@link #PROP_ALLOW_EXTERNAL_APPS} */
2021-03-08 10:09:22 +00:00
public static final String PROP_DEFAULT_VALUE_ALLOW_EXTERNAL_APPS = " false " ; // Default: "false"
2021-03-16 16:29:25 +00:00
/* The broadcast action sent when Termux App opens */
2021-03-15 22:59:54 +00:00
public static final String BROADCAST_TERMUX_OPENED = TERMUX_PACKAGE_NAME + " .app.OPENED " ;
2021-03-11 15:11:59 +00:00
2021-03-16 16:29:25 +00:00
/* The Uri authority for Termux app file shares */
public static final String TERMUX_FILE_SHARE_URI_AUTHORITY = TERMUX_PACKAGE_NAME + " .files " ; // Default: "com.termux.files"
2021-03-11 15:11:59 +00:00
2021-03-08 10:09:22 +00:00
/ * *
* Termux app constants .
* /
public static final class TERMUX_APP {
2021-03-11 15:11:59 +00:00
/** Termux app core activity name. */
public static final String TERMUX_ACTIVITY_NAME = TERMUX_PACKAGE_NAME + " .app.TermuxActivity " ; // Default: "com.termux.app.TermuxActivity"
2021-03-08 10:09:22 +00:00
/ * *
* Termux app core activity .
* /
public static final class TERMUX_ACTIVITY {
2021-03-11 15:11:59 +00:00
/* Intent action to start termux failsafe session */
2021-03-08 10:09:22 +00:00
public static final String ACTION_FAILSAFE_SESSION = TermuxConstants . TERMUX_PACKAGE_NAME + " .app.failsafe_session " ; // Default: "com.termux.app.failsafe_session"
2021-03-11 15:11:59 +00:00
/* Intent action to make termux reload its termux session styling */
2021-03-08 10:09:22 +00:00
public static final String ACTION_RELOAD_STYLE = TermuxConstants . TERMUX_PACKAGE_NAME + " .app.reload_style " ; // Default: "com.termux.app.reload_style"
2021-03-18 02:15:00 +00:00
/* Intent {@code String} extra for what to reload for the TERMUX_ACTIVITY.ACTION_RELOAD_STYLE intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_RELOAD_STYLE = TermuxConstants . TERMUX_PACKAGE_NAME + " .app.reload_style " ; // Default: "com.termux.app.reload_style"
}
2021-03-11 15:11:59 +00:00
/** Termux app core service name. */
public static final String TERMUX_SERVICE_NAME = TERMUX_PACKAGE_NAME + " .app.TermuxService " ; // Default: "com.termux.app.TermuxService"
2021-03-08 10:09:22 +00:00
/ * *
* Termux app core service .
* /
public static final class TERMUX_SERVICE {
2021-03-11 15:11:59 +00:00
/* Intent action to stop TERMUX_SERVICE */
2021-03-08 10:09:22 +00:00
public static final String ACTION_STOP_SERVICE = TERMUX_PACKAGE_NAME + " .service_stop " ; // Default: "com.termux.service_stop"
2021-03-11 15:11:59 +00:00
/* Intent action to make TERMUX_SERVICE acquire a wakelock */
2021-03-08 10:09:22 +00:00
public static final String ACTION_WAKE_LOCK = TERMUX_PACKAGE_NAME + " .service_wake_lock " ; // Default: "com.termux.service_wake_lock"
2021-03-11 15:11:59 +00:00
/* Intent action to make TERMUX_SERVICE release wakelock */
2021-03-08 10:09:22 +00:00
public static final String ACTION_WAKE_UNLOCK = TERMUX_PACKAGE_NAME + " .service_wake_unlock " ; // Default: "com.termux.service_wake_unlock"
2021-03-11 15:11:59 +00:00
/* Intent action to execute command with TERMUX_SERVICE */
2021-03-08 10:09:22 +00:00
public static final String ACTION_SERVICE_EXECUTE = TERMUX_PACKAGE_NAME + " .service_execute " ; // Default: "com.termux.service_execute"
2021-03-11 15:11:59 +00:00
/* Uri scheme for paths sent via intent to TERMUX_SERVICE */
2021-03-08 10:09:22 +00:00
public static final String URI_SCHEME_SERVICE_EXECUTE = TERMUX_PACKAGE_NAME + " .file " ; // Default: "com.termux.file"
2021-03-18 02:15:00 +00:00
/* Intent {@code String[]} extra for command arguments for the TERMUX_SERVICE.ACTION_SERVICE_EXECUTE intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_ARGUMENTS = TERMUX_PACKAGE_NAME + " .execute.arguments " ; // Default: "com.termux.execute.arguments"
2021-03-18 02:15:00 +00:00
/* Intent {@code String} extra for command current working directory for the TERMUX_SERVICE.ACTION_SERVICE_EXECUTE intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_WORKDIR = TERMUX_PACKAGE_NAME + " .execute.cwd " ; // Default: "com.termux.execute.cwd"
2021-03-18 02:15:00 +00:00
/* Intent {@code boolean} extra for command background mode for the TERMUX_SERVICE.ACTION_SERVICE_EXECUTE intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_BACKGROUND = TERMUX_PACKAGE_NAME + " .execute.background " ; // Default: "com.termux.execute.background"
2021-03-18 02:15:00 +00:00
/** Intent {@code Parcelable} extra containing pending intent for the execute command caller */
public static final String EXTRA_PENDING_INTENT = " pendingIntent " ; // Default: "pendingIntent"
/ * * Intent { @code Bundle } extra to store result of execute command that is sent back for the
* TERMUX_SERVICE . ACTION_SERVICE_EXECUTE intent if the { @link # EXTRA_PENDING_INTENT } is not
* { @code null } * /
public static final String EXTRA_RESULT_BUNDLE = " result " ; // Default: "result"
/** Intent {@code String} extra for stdout value of execute command of the {@link #EXTRA_RESULT_BUNDLE} */
public static final String EXTRA_STDOUT = " stdout " ; // Default: "stdout"
/** Intent {@code String} extra for stderr value of execute command of the {@link #EXTRA_RESULT_BUNDLE} */
public static final String EXTRA_STDERR = " stderr " ; // Default: "stderr"
/** Intent {@code int} extra for exit code value of execute command of the {@link #EXTRA_RESULT_BUNDLE} */
public static final String EXTRA_EXIT_CODE = " exitCode " ; // Default: "exitCode"
/** Intent {@code int} extra for err value of execute command of the {@link #EXTRA_RESULT_BUNDLE} */
public static final String EXTRA_ERR = " err " ; // Default: "err"
/** Intent {@code String} extra for errmsg value of execute command of the {@link #EXTRA_RESULT_BUNDLE} */
public static final String EXTRA_ERRMSG = " errmsg " ; // Default: "errmsg"
2021-03-08 10:09:22 +00:00
}
2021-03-11 15:11:59 +00:00
/** Termux app run command service name. */
2021-03-08 10:09:22 +00:00
public static final String RUN_COMMAND_SERVICE_NAME = TERMUX_PACKAGE_NAME + " .app.RunCommandService " ; // Termux app service to receive commands from 3rd party apps "com.termux.app.RunCommandService"
2021-03-11 15:11:59 +00:00
/ * *
* Termux app run command service to receive commands sent by 3rd party apps .
* /
2021-03-08 10:09:22 +00:00
public static final class RUN_COMMAND_SERVICE {
2021-03-11 15:11:59 +00:00
/* Intent action to execute command with RUN_COMMAND_SERVICE */
2021-03-08 10:09:22 +00:00
public static final String ACTION_RUN_COMMAND = TERMUX_PACKAGE_NAME + " .RUN_COMMAND " ; // Default: "com.termux.RUN_COMMAND"
2021-03-18 02:15:00 +00:00
/* Intent {@code String} extra for command path for the RUN_COMMAND_SERVICE.ACTION_RUN_COMMAND intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_COMMAND_PATH = TERMUX_PACKAGE_NAME + " .RUN_COMMAND_PATH " ; // Default: "com.termux.RUN_COMMAND_PATH"
2021-03-18 02:15:00 +00:00
/* Intent {@code String[]} extra for command arguments for the RUN_COMMAND_SERVICE.ACTION_RUN_COMMAND intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_ARGUMENTS = TERMUX_PACKAGE_NAME + " .RUN_COMMAND_ARGUMENTS " ; // Default: "com.termux.RUN_COMMAND_ARGUMENTS"
2021-03-18 02:15:00 +00:00
/* Intent {@code String} extra for command current working directory for the RUN_COMMAND_SERVICE.ACTION_RUN_COMMAND intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_WORKDIR = TERMUX_PACKAGE_NAME + " .RUN_COMMAND_WORKDIR " ; // Default: "com.termux.RUN_COMMAND_WORKDIR"
2021-03-18 02:15:00 +00:00
/* Intent {@code boolean} extra for command background mode for the RUN_COMMAND_SERVICE.ACTION_RUN_COMMAND intent */
2021-03-08 10:09:22 +00:00
public static final String EXTRA_BACKGROUND = TERMUX_PACKAGE_NAME + " .RUN_COMMAND_BACKGROUND " ; // Default: "com.termux.RUN_COMMAND_BACKGROUND"
}
}
2021-03-11 15:11:59 +00:00
2021-03-08 10:09:22 +00:00
/ * *
* Termux : Styling app constants .
* /
public static final class TERMUX_STYLING {
2021-03-11 15:11:59 +00:00
/** Termux:Styling app core activity name. */
2021-03-08 10:09:22 +00:00
public static final String TERMUX_STYLING_ACTIVITY_NAME = TERMUX_STYLING_PACKAGE_NAME + " .TermuxStyleActivity " ; // Default: "com.termux.styling.TermuxStyleActivity"
}
}