Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

termux-storage-get doesn't work #2181

Closed
Efreak opened this issue Jul 20, 2021 · 6 comments
Closed

termux-storage-get doesn't work #2181

Efreak opened this issue Jul 20, 2021 · 6 comments

Comments

@Efreak
Copy link

Efreak commented Jul 20, 2021

Problem description

termux-storage-get hangs and doesn't open the file picker.

Steps to reproduce

Run termux-storage-get

Expected behavior

Filter picker opens

Additional information
All permissions address granted to both termux and termux-api

output from termux-info
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.mentality.rip/termux-main/ stable main
# game-repo (sources.list.d/game.list)
deb https://packages.termux.org/apt/termux-games games stable
# science-repo (sources.list.d/science.list)
deb https://packages.termux.org/apt/termux-science science stable
Updatable packages:
All packages up to date
Android version:
11
Kernel build information:
Linux localhost 4.14.186-21672463 #1 SMP PREEMPT Mon Jun 21 06:09:29 KST 2021 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-A326U
  • Termux application version: 0.95 (according to fdroid; termux-info doesn't say)
  • Android OS version: 11
  • Device model: SM-A326U
@agnostic-apollo
Copy link
Member

Termux application version: 0.95

Current version of termux is v0.117 and v0.48 for Termux:API. Install latest version of both Termux and Termux:API app from F-Droid and then see if issue occurs. Also run pkg install termux-api to update it to v0.56.

@Efreak
Copy link
Author

Efreak commented Jul 27, 2021

Thank you (and apologies) for this. I keep hitting update all in fdroid, but apparently when I set up my new tablet at the beginning of the year, I seem to have let Google Play install Termux for some reason (or so I assume--there was a signature mismatch. Not sure why I was on 0.95 though and not 0.101).

Hopefully there's no issue with keeping my userspace between versions
apt-get autoclean
export ZSTD_NBTHREADS=6
cd /data/data/com.termux
tar --preserve-permissions --zstd -cf /storage/0000-0000/Android/media/com.termux/backup.tzstd /data/data/com.termux/{cache,files,shared_prefs}

Now I uninstalled and reinstalled Termux, and put the files back:

cd /data/data/com.termux
mkdir restore
cd restore
apt-get install zstd
tar -xf /storage/0000-0000/Android/media/com.termux/backup.zstd
cd -
mv -i restore/* .

To deal with prelinker/other issues without setting path and other environment variables, use interactive move to replace the existing file. Before telling saying yes, open a new session and delete the existing files directory.

rm -rf /data/data/com.termux/files && exit

And now go back to the previous session where it's asking if it should overwrite the files directory and hit y.


This is the same process I used to restore a backup of the existing app from my old tablet to my new tablet without taking the massive amount of time required for adb backup to complete. The first step also includes clearing unnecessary apt packages to reduce storage use.

Note that to make my storage/external available to other apps without using the Termux file access paths, I use the sdcard/Android/media/com.termux folder instead of the external data folder; Android still allows access to this folder by other apps (I'm not sure if it's a device-specific thing, or if it's something Google overlooked/allowed).

The only reason to use external sdcard and not internal is due to storage concerns (clearing /data/data/com.termux frees more than half the storage space used on my internal storage), and the fact that I generally keep it linked in $HOME/storage/external anyways. Zstd was used for compression due to having both a decent compression ratio and not making the backup take longer to complete.

@Efreak Efreak closed this as completed Jul 27, 2021
@agnostic-apollo
Copy link
Member

You are welcome.

There shouldn't be any issue as long as you fix mirror and then upgrade to latest version of packages after restore with pkg upgrade. Check #2067

@Miepee
Copy link

Miepee commented Aug 1, 2021

I'm having the same problem under 0.117 .
I only ever installed the fdroid version, ran pkg upgrade already, tried switching mirrors, but termux-storage-get always hangs.
I even tried freshly reinstalling termux, didn't help either.
Output from termux-info

Application version:
0.117
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.org/apt/termux-main/ stable main
# game-repo (sources.list.d/game.list)
deb https://packages.termux.org/apt/termux-games games stable
# science-repo (sources.list.d/science.list)
deb https://packages.termux.org/apt/termux-science science stable
Updatable packages:
All packages up to date
Android version:
7.0
Kernel build information:
Linux localhost 4.1.18-g1b717f5 #1 SMP PREEMPT Tue Dec 4 14:20:03 CST 2018 aarch64 Android
Device manufacturer:
HUAWEI
Device model:
BLN-L21

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Aug 1, 2021

termux-storage-get always hangs.

Make sure Termux and Termux:API is exempted from restrictions as per https://dontkillmyapp.com/huawei

Where is your output file? If on shared storage, make sure termux is granted storage permission or disable and grant it again. Although, that should throw an error.

Lastly, if above doesn't work, post output of adb shell logcat -d here, immediately after running the termux-storage-get command. Use android-tools if running over pc is an issue.

@Miepee
Copy link

Miepee commented Aug 1, 2021

Where is your output file?

Only tried a simple ~/test.txt so far, haven't tried to save to shared storage yet.

Lastly, if above doesn't work, post output of adb shell logcat -d here, immediately after running the termux-storage-get command. Use android-tools if running over pc is an issue.

Not sure exactly what the important information is, so here's the full output of that:
logcat.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants