Reputation: 1107
I have seen this questioned asked a couple times but it's never been fully answered (that I can find).
To be clear, my phone is rooted.
What I need to do is read and write files under root owned directories, such-as, /data
. I understand I need to run it has a superuser (Runtime.getRuntime().exec("su");
). But I can't figure out how to do the IO its self.
Upvotes: 2
Views: 2346
Reputation: 52936
Copy the file to the SD card using something like su -c cp /data/file.txt /mnt/sdcard
, read it and delete it when done.
Upvotes: 3