Android Question Can't read file after changing its owner

androidsoftcoder

Member
Licensed User
Longtime User
Encountered with an issue: from my app I had created plain text file. It got attributes -600 and owner 10219 both for owner and group. I changed this file content via ADB. I have Totalcommander with installed ADB-plugin - so I simply connect to device, open file for edit, type new content, close editor, and TC push it back to device. But! After this I got attributes -660 and owner 0 for owner and 1015 for group. Now my app can't even read this file, throwing exception
java.io.FileNotFoundException: /data/user/0/MyApp/files/users: open failed: EACCES (Permission denied)
in simple statement
UsersList = File.ReadList(File.DirInternal, "config")
Changing file attributes to -777 doesn't resolve issue.
Unfortunately I can't change owner via ADB-plugin in TC.
Unfortunately I can't preserve ownership changing (I set preserve option in TC, but it doesn't work).

I can't refused editing of this file outside of my app.
Is the any way to read such files (with different owner)?
 
Last edited:

androidsoftcoder

Member
Licensed User
Longtime User
but I have this case as a USUAL stuff. I have to edit file with a lot of text. It's really more easy to open it on PC and use fullsize keyboard and PC's editor features.
If there is an any way to resolve this - I want to make even a try. If not .... ok, but it will be great disadvantage for me.
 
Upvote 0

androidsoftcoder

Member
Licensed User
Longtime User
Yes I have root, so I can access File.DirInternal from aboard.
Text file as a config storage was chosen because of its simplicity. But may be the other solution exists for my app? Every simple storage, available via ADB may be good in my case.
The only one main requirement for this particular app - no any data in external sd-card. That is why I'm using File.DirInternal (
 
Upvote 0
Top