1

I want to know how to read files placed in root folder. For instance let's take file /init.trace.rc. When I'm trying to read it I get exception:

java.io.FileNotFoundException: /init.trace.rc: EACCES (Permission denied)

I thought that I need to get superuser access. I did it but that made no difference ((( I still can't read it. Could anybody help me? ...and also I wonder how file explorers like "RootExplorer" read that stuff?

YS-L
  • 13,600
  • 3
  • 42
  • 54
iamarkadyt
  • 1,980
  • 2
  • 12
  • 11
  • You need to add root permissions to your app – John Apr 22 '14 at 16:46
  • possible duplicate of [How can I get root permissions through the Android SDK?](http://stackoverflow.com/questions/5293615/how-can-i-get-root-permissions-through-the-android-sdk) – John Apr 22 '14 at 16:47

1 Answers1

1

apparently this is all you need to run to get root access:

Process root = Runtime.getRuntime().exec("su");

taken from:

Community
  • 1
  • 1
John
  • 3,673
  • 5
  • 29
  • 46
  • 1
    That or use RootTools library from Stericson. Keep in mind the device will NEED to be rooted. – shkschneider Apr 22 '14 at 17:00
  • My device is rooted and as I said above I requested root permissions and got them. But when I tried again to read that file I got the same exception!!! (( – iamarkadyt Apr 23 '14 at 05:12