- Нет доступа к Termux для доступа к внутренней памяти — даже для чтения
- Termux-setup-storage
- How To
- Android 11
- Внутреннее и внешнее хранилище
- Доступ к внешнему и внутреннему хранилищу
- Internal and external storage
- Access shared and external storage
- Access Termux from a file manager
- Termux setup storage не работает
Нет доступа к Termux для доступа к внутренней памяти — даже для чтения
Используя программу эмуляции терминала termux ( https://termux.com ), я набираю следующую команду:
Я получаю следующую ошибку:
Понимая, что каталог / sdcard на Android — это символическая ссылка, я попытался найти местоположение фактического каталога — узнав, что это не просто символическая ссылка, а символическая ссылка на другую символическую ссылку, а фактический каталог — / storage / emulated / 0
Итак, наконец, я напечатал:
Результат, который я получил, был:
Итак, вкратце — я не знаю, использовался ли termux для запуска с разрешениями группы sdcard_r или o- разрешения, используемые для разрешения чтения-записи, — но мне нужно знать, какой из двух он был раньше, и как все исправить — ведь возможность доступа к содержимому внутренней SD-карты очень важна.
Нет, мое устройство не имеет root-прав, и я не планирую его рутировать — поэтому я не могу предоставить какую-либо информацию, которую мне пришлось бы получить для рутирования устройства. Однако отсутствие рутования никогда не препятствовало мне иметь доступ на чтение к каталогу / sdcard — так что это ново (и тревожно).
Конечно, прошло уже несколько месяцев с тех пор, как я пытался это сделать ранее, но это новое ограничение для Android серьезно препятствует удобству использования termux и тому, кто знает, что еще, поскольку мне нужно иметь доступ к файлам, которые на моей SD-карте. (Я все еще могу многое, даже если не все, даже без разрешения на запись — но я почти застрял в воде, если не могу получить разрешения на чтение, как в настоящее время).
Источник
Termux-setup-storage
In order to have access to shared storage (/sdcard or /storage/emulated/0), Termux needs a storage access permission. It is not granted by default and is not requested on application startup since it is not necessary for normal application functioning.
Storage access permission will not enable write access to the external sdcard and drives connected over USB.
How To
Open Termux application and do following steps:
- Execute command termux-setup-storage . If you already have executed this command previously or for some reason already have storage directory under $HOME, utility will ask you to confirm wiping of
/storage . This is safe as will only rebuild symlink set.
Termux uses utility termux-setup-storage to configure access to the shared storage and setup these symlinks for quick access to various kinds of storages:
- The root of the shared storage between all apps.
- The standard directory for downloads from e.g. the system browser.
- The traditional location for pictures and videos when mounting the device as a camera.
- Standard directory in which to place pictures that are available to the user.
- Standard directory in which to place any audio files that should be in the regular list of music for the user.
- Standard directory in which to place movies that are available to the user.
- Symlink to a Termux-private folder on external storage (only if external storage is available).
Android 11
You may get «Permission denied» error when trying to access shared storage, even though the permission has been granted.
- Go to Android Settings —> Applications —> Termux —> Permissions
- Revoke Storage permission
- Grant Storage permission again
This is a known issue, though this is not Termux bug.
Источник
Внутреннее и внешнее хранилище
Termux предоставляет доступ к трем видам хранилища:
- Приватное: все файлы и директории находящиеся внутри приложения, например $HOME.
- Общее: файлы и директории доступные для всех приложений. Общее хранилище доступно как /storage/emulated/0, /storage/self/primary или /sdcard. Для работы с ним необходимо дать разрешение.
- Внешнее: карты SD или USB накопители. Запись возможна только в приватную дирукторию приложения. Termux не может применять Storage Access Framework API которое используют файловые менеджеры. Причина проста — все утилиты командной строки запускаются вне Android OS и реально их работа обеспечивается лишь ядром.
Доступ к внешнему и внутреннему хранилищу
Для того, чтобы получить доступ к внутреннему (общему) или внешнему хранилищу, необходимо выполнить команду .
При выполнении termux-setup-storage происходит следующее:
- Будет запрошено разрешение на доступ к хранилищу.
- Termux создаст приватную директорию во внешнем и внутреннем хранилищах.
- Создаст директорию $HOME/storage в которой будут символьные ссылки на приватные директории приложения, а также ссылки на стандартные директории Android OS.
Содержимое $HOME/storage представляет собой символьные ссылки на различные директории Termux и Android OS:
- Общее хранилище.
- Стандартная папка для загруженных файлов.
- Стандартная папка для фотографий и видео записанных при помощи камеры.
- Стандартная папка для хранения изображений.
- Стандартная папка для хранения музыки.
- Стандартная папка для хранения видео/фильмов.
- Приватная директория приложения на внешнем хранилище.
Важно: не выполняйте сброс данных приложения если у вас есть важные файлы в приватных директориях Termux на внешнем или общем хранилище. В противном случае эти данные будут удалены.
Источник
Internal and external storage
There are three main types of storage in Termux:
- Internal storage: files put in $HOME, available from inside Termux or when explictly picked in a SAF-compatible file manager.
- Shared storage: general purpose file storage available for the all applications. You need to grant Termux storage access permission to use it.
- External storage: external SD cards or USB hard drives. Typically read-only, except the Termux private directory.
See below for detailed feature comparison between storage types:
| Storage type | chmod/chown support | Special files support | Executables support | Access mode |
|---|---|---|---|---|
| Internal ($HOME/$PREFIX) | yes | yes | yes | RW (app dir) |
| Shared storage | no | no | no | RW |
| External storage | no | no | no | RO / RW (app dir) |
Full read-write access to external SD cards and USB drives is available only on rooted devices. For those who are curious why some applications can write on external storage without restriction: these applications use a special APIs (Storage Access Framework) not available for command line applications.
Shared storage as well as external storage is not suitable for installing software. Do not even try to move Termux directories like $HOME or $PREFIX onto this kind of storage. Such option is only available for advanced users who have rooted device and are familiar with customization of partitions and file system on their external storage. Use of adoptable storage will not make your external SD card compatible with Termux, it is effectively same as shared storage (EXT4/F2FS with FAT32/exFAT compatible overlay).
After creating directory Android/data/com.termux , through file manager or by termux-setup-storage , you can access your external SD directly in this folder. The remainder of the external SD card will not be accessable from Termux unless you grant storage permission for Termux in Android. Important: Please remember that if you uninstall Termux app this directory will be deleted!
Access shared and external storage
To access shared and external storage you need to run termux-setup-storage . You will then be prompted to «Allow Termux access photos, media and files on your device», which you should allow.
Executing termux-setup-storage ensures:
- That permission to shared storage is granted to Termux when running on Android 6.0 or later.
- That an app-private folder on external storage is created (if external storage exists).
- That a folder $HOME/storage is created.
If you have Termux:API application and termux-api package installed, you can use Android file picker to get any file from either shared or external storage by using utility termux-storage-get . Example:
File that has been chosen through file picker will be saved as «filename.txt».
The contents of the created $HOME/storage folder are symlinks to different storage folders:
- The root of the shared storage between all apps.
- The standard directory for downloads from e.g. the system browser.
- The traditional location for pictures and videos when mounting the device as a camera.
- Standard directory in which to place pictures that are available to the user.
- Standard directory in which to place any audio files that should be in the regular list of music for the user.
- Standard directory in which to place movies that are available to the user.
- Symlink to a Termux-private folder on external storage (only if external storage is available).
Important: do not clear Termux application data through Android OS Settings if you have any files placed to
/storage/external-1 . If you do so, all data will be lost as Android will wipe all directories associated with Termux.
Access Termux from a file manager
You can access Termux home directory ($HOME) from the file manager using Storage Access Framework and capable of accessing drives like USB or external SD-card in read-write mode.
Few recommended file managers which can access Termux home directory:
Steps to enable access to $HOME are same as for any external drives: open storage manager —> select drive (Termux) —> Select root directory of storage.
You may use the following command to launch Android internal file manager which also allows to transfer files between Termux and other storage volumes:
And you can also start the Termux Filepicker too:
Alternate way would be direct access to Termux home directory with Superuser permissions. That’s possible only on rooted devices. However, using root to work with Termux files is not recommended way as you can easily mess up file access modes and SELinux contexts.
Источник
Termux setup storage не работает
Краткое описание:
Termux сочетает в себе мощные эмуляцию терминала с обширной коллекцией пакетов Linux.
Termux combines powerful terminal emulation with an extensive Linux package collection.
• Enjoy the bash and zsh shells.
• Edit files with nano and vim.
• Access servers over ssh.
• Compile code with gcc and clang.
• Use the python console as a pocket calculator.
• Check out projects with git and subversion.
• Run text-based games with frotz.
At first start a small base system is downloaded — desired packages can then be installed using the apt package manager known from the Debian and Ubuntu Linux distributions. Access the built-in help by long-pressing anywhere on the terminal and selecting the Help menu option to learn more.
Want to ask questions, report bugs or give feedback?
See https://termux.com/community
Версия: 0.102 Termux (digmavip)
Версия: 0.101 от 29/09/2020 (iMiKED)
Версия: 0.99 от 15/09/2020 (iMiKED)
Версия: 0.98 от 09/08/2020 (RiddickABSent)
Версия: 0.95 от 13/06/2020 (iMiKED)
Версия: 0.94 от 25/03/2020 (iMiKED)
Версия: 0.92 от 09/02/2020 (iMiKED)
Версия: 0.88 от 18/01/2020 (iMiKED)
Версия: 0.84 (7.0+)(f-droid) Сообщение №3704, автор blackeangel
Версия: 0.75 Оригинал (Ultra119)
Версия: 0.75 GP (Ultra119)
Версия: 0.73 04.08.19 GP (hackdog)
Версия: 0.72 Termux (Displax)
Версия: 0.71 Termux (Displax)
версия: 0.68 Termux (Пост Farthah #84737189)
версия: 0.66 Сообщение №1619, автор алекс12
версия: 0.65 Сообщение №785, автор алекс12
версия: 0.64 Сообщение №639, автор алекс12
версия: 0.63 Сообщение №635, автор алекс12
версия: 0.61 Сообщение №623, автор Evbuley
версия: 0.60 Termux (Пост алекс12 #69631056)
Версия: 0.59 Termux (Пост алекс12 #67845982)
Версия: 0.56 Termux (Пост алекс12 #67233087)
Версия: 0.54 Termux (Пост алекс12 #66459493)
Версия: 0.53 Termux (Пост алекс12 #62674540)
Версия: 0.52 Termux (Пост алекс12 #62332662)
версия: 0.51 Termux (Пост алекс12 #62106399)
версия: 0.48 Termux (Пост алекс12 #58901446)
версия: 0.47 Termux (Пост Ramzes26 #58821225)
версия: 0.46 Termux (Пост алекс12 #56940751)
версия: 0.42 Termux (Пост ilyaor #53212592)
версия: 0.34
Сообщение отредактировал iMiKED — 20.07.21, 20:43
Примечательно, что хотя некоторые плагины платные, на странице автора есть ссылки на исходный код на github-e https://github.com/termux, т.е. можно самому собрать как само приложение так и все плагины; термукс из маркета надо будет удалить и собрать и установить руками потому что подписи должны совпадать.
Если кому-то лень самому собирать, в прицепе моя сборка с плагинами. Отдельно плагины из этой сборки не будут работать с версией из маркета, так как я все подписал своим серификатом, который ессно не совпадает с сертификатом автора.
Если кто-то хочет собрать из исходников, то помимо android sdk также потребуется ndk.
Хотя исходники платных плагинов открыты, я один плагин купил по-любому, потому что очень уж хочется поддержать разработчика за такой мега-подарок.
*ВАЖНО*: Только для андроид версии 5.х и выше!
Сообщение отредактировал ccpizz — 13.05.16, 08:26
Сообщение отредактировал LVware — 29.07.16, 18:50
Termux v0.46:
• Work better with the stock CyanogenMod and AOSP keyboards.
• Remove the shaking of the terminal on a bell character introduced in v0.44.
• Restore the ability to press Enter on the on-screen Android TV keyboard.
Termux:API v0.12:
• For use with termux-api version 0.21 or later. Run apt update && apt upgrade to ensure that the latest packages are installed.
• Run any command with a -h flag to learn more.
• Support the new termux-notification-remove command to remove a notification.
• Add several options to termux-notification.
• Add new commands for wifi information: termux-wifi-connectioninfo and termux-wifi-scaninfo.
Termux:Styling v0.16:
• Add monochrome White on Black and Black on White color schemes.
Termux:Widget v0.7:
• Update app icon.
Termux:Task v0.1:
• Initial release for testing and feedback.
Termux:Boot v0.1:
• Initial release for testing and feedback.
Termux:Float v0.7 (Original)
Сообщение отредактировал rezvorck — 20.01.17, 18:07
Источник