T
Termux•2mo ago
PSYCHO

2 questions about termux

It all started when I tried to delete a folder inside Android/data, but i got the error "Permision Denied" so I tried Shizuku + Termux to delete it, I set it up and run the command "rm -rf [folder]" but I also got "Permission denied" (First image), so I searched a little and saw that I should've used the "termux-setup-storage" command, so i went and used, but I got a text (image 2) and I got afraid that typing "Y" would erase all my data (even if it's saying that will not be deleted). So I'm here to ask, if I type "Y" all my data will be erased? And if not, am I be able to delete that folder?
No description
No description
86 Replies
Mlwls
Mlwls•2mo ago
as it said, pressing Y would not delete your data as for how to delete android/data/stuff folder, idk
ted
ted•2mo ago
if you don't have root, you can't, and if you do have root, you shouldn't. whatever search told you termux-setup-storage would help is sending you a wildly wrong direction. @PSYCHO why do you want to do this? what problem do you think it's going to solve?
PSYCHO
PSYCHOOP•2mo ago
The reason is dumb tbh, i just wanted to remove a skin pack inside minecraft, but ingame didnt have the option, so I tried just deleting whats inside that folder But it looks like without root i can only delete with a pc And even if the pc doesnt work, I'll just give up
ted
ted•2mo ago
I don't think you can do this at all dunno where you're getting this info also entirely possible that you break that app because it's not expecting that file to be deleted out from under it
PSYCHO
PSYCHOOP•2mo ago
Pure guess
ted
ted•2mo ago
yeah, you should probably let this one go bad idea
PSYCHO
PSYCHOOP•2mo ago
But i found a way
ted
ted•2mo ago
that doesn't mean it wasn't and isn't a bad idea :P
PSYCHO
PSYCHOOP•2mo ago
Just wipe all the data of the app, simple
ted
ted•2mo ago
... sure that's safe to do, assuming you aren't losing any other data you care about
PSYCHO
PSYCHOOP•2mo ago
I mean, I was only trying to delete a folder inside that skin_packs folder I don't think doing this would break the app Yah, I just made a backup before doing it
ted
ted•2mo ago
so the thing about android is that apps can correctly assume that no one will do what you're trying to do /data/data/com.whatever is their private storage
PSYCHO
PSYCHOOP•2mo ago
But I tried deleting on the pc but didn't work either, android 11 broke everthing
ted
ted•2mo ago
nobody but the com.whatever app should be able to delete anything in there so if there's a list of things that are in the skins dir, and you delete something from it, and then it goes and tries to access all the skins it thinks it has, and it hasn't expected the case that the skin disappears out from under it because android is not supposed to let anyone else delete that you have a crash you can't recover from
PSYCHO
PSYCHOOP•2mo ago
If I had root, I could delete any folder inside the data folder, right? Or its literally impossible?
ted
ted•2mo ago
and you can't actually know if it'll do that ahead of time sure, and you could very easily break stuff doing so this is not a good assumption :)
PSYCHO
PSYCHOOP•2mo ago
I wasn't that important, if it broke just reinstall the app 😭
ted
ted•2mo ago
sure, if you don't care about reinstalling it, you can do whatever
PSYCHO
PSYCHOOP•2mo ago
Yah
ted
ted•2mo ago
it's still a bad assumption that you can just go in and fuck with other apps' files and they should be fine this is an important point
PSYCHO
PSYCHOOP•2mo ago
But i wish there was a easier way to delete those things
ted
ted•2mo ago
welcome to android apps are protected against the user in ways they are not on normal computers
PSYCHO
PSYCHOOP•2mo ago
Yah It would cost nothing to also add option to delete inside the app
ted
ted•2mo ago
it would not, in fact, cost nothing
Juhan
Juhan•2mo ago
Although, for minecraft, i dont think it would cause much issues. A few years ago they used to store gamedata in /sdcard/games/` folder instead of Android/data. So it was expected people modify that dir (e.g. importing/exporting worlds/texture pack/etc)
ted
ted•2mo ago
because that's not the model apps are given in android
PSYCHO
PSYCHOOP•2mo ago
I had a phone with root a long time ago, so I'm not used to root anymore, but if I root my phone, id be able to update it?
ted
ted•2mo ago
the point is that once it's in private storage, it is reasonable and safe for the app to start assuming no one else can touch that stuff so that doesn't really help, either depends on your phone? there's no general answer to that question
PSYCHO
PSYCHOOP•2mo ago
Hm, a Samsung one
ted
ted•2mo ago
I don't know
PSYCHO
PSYCHOOP•2mo ago
Or need to be more especifc? XD
ted
ted•2mo ago
xda is generally the best place to get info on rooting specific phones yeah, it matters exactly which
PSYCHO
PSYCHOOP•2mo ago
And today I noticed that the OEM unlocking option disappeared from my setting, maybe its an android 16 thing Or one ui 8
Juhan
Juhan•2mo ago
Also you can delete files using this file browser (its builtin, i think its called saf?)
No description
PSYCHO
PSYCHOOP•2mo ago
Saf?
ted
ted•2mo ago
storage access framework, it's a file access API for android apps, not an app itself it does not grant any unique permissions you know you're looking at a different dir, right
Juhan
Juhan•2mo ago
But it allows the user to delete the files inside Android/data dir
ted
ted•2mo ago
Android/data/$package in shared storage, not /data/data/$package (which is private storage)
PSYCHO
PSYCHOOP•2mo ago
But not in subfolders
Juhan
Juhan•2mo ago
Is he talking about /data/data/* dir?
ted
ted•2mo ago
yes
PSYCHO
PSYCHOOP•2mo ago
Am I?
Juhan
Juhan•2mo ago
That too
ted
ted•2mo ago
no I misread
PSYCHO
PSYCHOOP•2mo ago
Bruh U can?
ted
ted•2mo ago
I think Android/data/$package is actually also private, but that's another thing
PSYCHO
PSYCHOOP•2mo ago
Yah only the so itself can modify it
ted
ted•2mo ago
yes, I think it's actually restricted the same way
Juhan
Juhan•2mo ago
Yes, you ca
ted
ted•2mo ago
but didn't think that was relevant I mean, I can't even ls ~/storage/shared/Android/data over here
PSYCHO
PSYCHOOP•2mo ago
How did u access that app?
ted
ted•2mo ago
which makes sense because the list of apps you have installed is supposed to be protected at this point I think that's a normal file app
Mlwls
Mlwls•2mo ago
using activity manager app on f droid its just called file app
ted
ted•2mo ago
uhhh it looks a lot like the files app that ships with lineageos
Mlwls
Mlwls•2mo ago
using am might also possible
Juhan
Juhan•2mo ago
Using material files -> then open Android/data -> then it will open native android file browser (material files itself cant access that) !tag saf
ted
ted•2mo ago
I am not sure the tag helps though I guess we're not getting it
PSYCHO
PSYCHOOP•2mo ago
I'm not understanding shit 😭
ted
ted•2mo ago
android makes a lot of promises to apps. at least on A16 here, one of them is that other apps can't touch your files in Android/data, same as /data/data, or even tell if you have any. I think earlier versions might not enforce that. you can try with that file browser but it has no superpowers I don't know why it would work if your built in one doesn't
PSYCHO
PSYCHOOP•2mo ago
Let's try then
Juhan
Juhan•2mo ago
ted
ted•2mo ago
what version of android do you have?
Juhan
Juhan•2mo ago
Material files cant access that. But it can open the android native file manager,which can
ted
ted•2mo ago
might be an sdk target difference, actually
Juhan
Juhan•2mo ago
12
ted
ted•2mo ago
I don't think the android native file manager has superpowers, either
PSYCHO
PSYCHOOP•2mo ago
It needs root
ted
ted•2mo ago
the guarantees made to apps aren't supposed to have clever workarounds I don't think it needs root bet you five internet bux this changed between 12 and 16
PSYCHO
PSYCHOOP•2mo ago
No description
ted
ted•2mo ago
remote filesystem :blobhyperthink: anyway again no superpowers
Juhan
Juhan•2mo ago
no, from side pannel add storage device and then add Android/data
ted
ted•2mo ago
your phone is enforcing that those dirs are private to their apps or try that idk
Mlwls
Mlwls•2mo ago
am start --user 0 -n com.google.android.documentsui/com.android.documentsui.files.FilesActivity
am start --user 0 -n com.google.android.documentsui/com.android.documentsui.files.FilesActivity
PSYCHO
PSYCHOOP•2mo ago
U cant delete folders tho, weird
Juhan
Juhan•2mo ago
I think its only for /data/data/* and not /storage/emulated/0/Android/data/* because you can access the later using a pc
ted
ted•2mo ago
read the last paragraph there - it's definitely at least enforced for apps targeting >29 == A10
Juhan
Juhan•2mo ago
I can delete everything for me (android 12) Yesc i remember when that change occured. but that saf has more permissions over regular file managers. Like if i plug in a usb, it wont automatically show up in material files, i have to add it using the saf
ted
ted•2mo ago
I don't think "more" is correct, exactly? it allows things that are not filesystems to be exposed through the same APIs as the filesystems. like how termux lets you mess with its private storage, even though that's obviously illegal uh SAF is an android system API "add it using the SAF" doesn't parse not sure what you mean
Juhan
Juhan•2mo ago
Yeah, i my be getting the term wrong. Hold on a minute (or two) let me record what I am trying to say
PSYCHO
PSYCHOOP•2mo ago
Damn, Samsung removed the oem unlock option on one ui 8 💔
ted
ted•2mo ago
@Juhan meet me in #off-topic for the rest of this, let's close out this person's question here @PSYCHO I think you're out of luck on both, but is there anything else left to try?
PSYCHO
PSYCHOOP•2mo ago
Nah, the problem was already solved, thank you guys for offering help and info
ted
ted•2mo ago
sorry we couldn't figure it out for you
PSYCHO
PSYCHOOP•2mo ago
Np In the end it was an android problem XD

Did you find this page helpful?